Skip to content

Commit bc34566

Browse files
committed
More fixes after rebase
1 parent 8d65b95 commit bc34566

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

ground_station/src/hmi/hmi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void Hmi::update(void *pvParameter) {
572572

573573
if (millis() - barUpdate >= 1000) {
574574
barUpdate = millis();
575-
float voltage = static_cast<float>(analogRead(18)) * 0.00059154929F;
575+
const float voltage = static_cast<float>(analogRead(18)) * 0.00059154929F;
576576
if (!ref->isLogging) {
577577
ref->flashFreeMemory = Utils::getFlashMemoryUsage();
578578
}

ground_station/src/hmi/window.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,26 @@ void Window::initBar() {
6868
display.drawLine(0, 18, 400, 18, BLACK);
6969
}
7070

71-
void Window::updateBar(float batteryVoltage, bool usb, bool logging, bool location, bool time, int32_t free_memory) {
71+
void Window::updateBar(float batteryVoltage, bool usb, bool logging, bool location, bool time, uint32_t free_memory) {
7272
static int32_t oldHour = 0;
7373
static int32_t oldMinute = 0;
7474
static bool oldUsbStatus = false;
7575
static bool oldLoggingStatus = false;
76-
static int32_t oldFreeMemory = 0;
76+
static uint32_t oldFreeMemory = 0;
7777
static bool blinkStatus = false;
7878

7979
// Logging
8080
if (logging != oldLoggingStatus) {
81-
display.drawBitmap(75, 1, bar_download, 16, 16, !logging);
81+
display.drawBitmap(75, 1, bar_download, 16, 16, static_cast<uint16_t>(!logging));
8282
oldLoggingStatus = logging;
8383
}
8484
if (logging) {
85-
display.drawBitmap(75, 1, bar_download, 16, 16, blinkStatus);
85+
display.drawBitmap(75, 1, bar_download, 16, 16, static_cast<uint16_t>(blinkStatus));
8686
}
8787

8888
// Location
8989
if (location) {
90-
display.drawBitmap(329, 1, bar_location, 16, 16, !location);
90+
display.drawBitmap(329, 1, bar_location, 16, 16, static_cast<uint16_t>(!location));
9191
}
9292

9393
// Memory Usage

ground_station/src/hmi/window.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Window {
3131

3232
void initBar();
3333
void updateBar(float batteryVoltage, bool usb = false, bool logging = false, bool location = false, bool time = false,
34-
int32_t free_memory = 100);
34+
uint32_t free_memory = 100);
3535

3636
void initMenu(int16_t index);
3737
void updateMenu(int16_t index);

ground_station/src/logging/recorder.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ void Recorder::recordTask(void *pvParameter) {
5050
ref->createFile();
5151
}
5252
const auto &data = element.data;
53-
snprintf(line, 128, "%hu,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", element.source, data.timestamp, data.state, data.errors,
54-
data.lat, data.lon, data.altitude, data.velocity, data.voltage,
55-
static_cast<bool>(data.pyro_continuity & 0x01), static_cast<bool>(data.pyro_continuity & 0x02));
53+
const auto pyro1_continuity = static_cast<bool>(data.pyro_continuity & 0x01U);
54+
const auto pyro2_continuity = static_cast<bool>(data.pyro_continuity & 0x02U);
55+
snprintf(line, 128, "%hu,%d,%d,%d,%d,%d,%d,%d,%d,%hu,%hu", element.source, data.timestamp, data.state,
56+
data.errors, data.lat, data.lon, data.altitude, data.velocity, data.voltage,
57+
static_cast<uint8_t>(pyro1_continuity), static_cast<uint8_t>(pyro2_continuity));
5658
ref->file.println(line);
5759
count++;
5860

ground_station/src/telemetry/telemetry.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ void Telemetry::initLink() {
6969
}
7070

7171
if (testingPhrase[0] != 0) {
72+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) uint8 to char is OK
7273
testingCrc = crc32(testingPhrase, strlen(reinterpret_cast<const char*>(testingPhrase)));
7374
}
7475
}

0 commit comments

Comments
 (0)