Skip to content

Commit

Permalink
More fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
stojadin2701 committed Oct 15, 2023
1 parent 0263e45 commit 4c7d8a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ground_station/src/hmi/hmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void Hmi::update(void *pvParameter) {

if (millis() - barUpdate >= 1000) {
barUpdate = millis();
float voltage = static_cast<float>(analogRead(18)) * 0.00059154929F;
const float voltage = static_cast<float>(analogRead(18)) * 0.00059154929F;
if (!ref->isLogging) {
ref->flashFreeMemory = Utils::getFlashMemoryUsage();
}
Expand Down
10 changes: 5 additions & 5 deletions ground_station/src/hmi/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ void Window::initBar() {
display.drawLine(0, 18, 400, 18, BLACK);
}

void Window::updateBar(float batteryVoltage, bool usb, bool logging, bool location, bool time, int32_t free_memory) {
void Window::updateBar(float batteryVoltage, bool usb, bool logging, bool location, bool time, uint32_t free_memory) {
static int32_t oldHour = 0;
static int32_t oldMinute = 0;
static bool oldUsbStatus = false;
static bool oldLoggingStatus = false;
static int32_t oldFreeMemory = 0;
static uint32_t oldFreeMemory = 0;
static bool blinkStatus = false;

// Logging
if (logging != oldLoggingStatus) {
display.drawBitmap(75, 1, bar_download, 16, 16, !logging);
display.drawBitmap(75, 1, bar_download, 16, 16, static_cast<uint16_t>(!logging));
oldLoggingStatus = logging;
}
if (logging) {
display.drawBitmap(75, 1, bar_download, 16, 16, blinkStatus);
display.drawBitmap(75, 1, bar_download, 16, 16, static_cast<uint16_t>(blinkStatus));
}

// Location
if (location) {
display.drawBitmap(329, 1, bar_location, 16, 16, !location);
display.drawBitmap(329, 1, bar_location, 16, 16, static_cast<uint16_t>(!location));
}

// Memory Usage
Expand Down
2 changes: 1 addition & 1 deletion ground_station/src/hmi/window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Window {

void initBar();
void updateBar(float batteryVoltage, bool usb = false, bool logging = false, bool location = false, bool time = false,
int32_t free_memory = 100);
uint32_t free_memory = 100);

void initMenu(int16_t index);
void updateMenu(int16_t index);
Expand Down
8 changes: 5 additions & 3 deletions ground_station/src/logging/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ void Recorder::recordTask(void *pvParameter) {
ref->createFile();
}
const auto &data = element.data;
snprintf(line, 128, "%hu,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", element.source, data.timestamp, data.state, data.errors,
data.lat, data.lon, data.altitude, data.velocity, data.voltage,
static_cast<bool>(data.pyro_continuity & 0x01), static_cast<bool>(data.pyro_continuity & 0x02));
const auto pyro1_continuity = static_cast<bool>(data.pyro_continuity & 0x01U);
const auto pyro2_continuity = static_cast<bool>(data.pyro_continuity & 0x02U);
snprintf(line, 128, "%hu,%d,%d,%d,%d,%d,%d,%d,%d,%hu,%hu", element.source, data.timestamp, data.state,
data.errors, data.lat, data.lon, data.altitude, data.velocity, data.voltage,
static_cast<uint8_t>(pyro1_continuity), static_cast<uint8_t>(pyro2_continuity));
ref->file.println(line);
count++;

Expand Down
1 change: 1 addition & 0 deletions ground_station/src/telemetry/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void Telemetry::initLink() {
}

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

0 comments on commit 4c7d8a4

Please sign in to comment.