Skip to content

Commit

Permalink
Fix led blink on transmit
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanjma committed Nov 18, 2024
1 parent b2173f1 commit de9d26e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions src/ControlTasks/RadioControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,21 @@ void RadioControlTask::init()

bool RadioControlTask::transmit(uint8_t *packet, uint8_t size)
{
// digitalWrite(constants::led::led_pin, HIGH);
if (millis() - sfr::gps::boot_time > constants::led::led_on_time) {
digitalWrite(constants::led::led_pin, HIGH);
}

uint32_t start = millis();
code = radio.transmit(packet, size);
uint32_t time = millis() - start;
// digitalWrite(constants::led::led_pin, LOW);

if (millis() - sfr::gps::boot_time > constants::led::led_on_time) {
digitalWrite(constants::led::led_pin, LOW);
}
#ifdef VERBOSE
Serial.print(F("Time to transmit (ms): "));
Serial.println(time);
#endif

if (code == RADIOLIB_ERR_NONE) {
// the packet was successfully transmitted
Expand Down
8 changes: 4 additions & 4 deletions src/Monitors/GPSMonitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class GPSMonitor
*/
void init();

// TODO: Test edge cases for lat, lon, alt
const char *gpsStream = "$GPGGA,045104.000,3014.1985,N,09749.2873,W,1,09,1.2,211.6,M,-22.5,M,,0000*62\r\n"
"$GPGGA,045201.000,3014.3864,N,09748.9411,W,1,10,1.2,200.8,M,-22.5,M,,0000*6C\r\n"
"$GPGG@,045252.000,3014.4273,S,09749.0628,W,1,09,1.3,206.9,M,-22.5,M,,0000*6F\r\n";
// for edge case testing only
// const char *gpsStream = "$GPGGA,045104.000,3014.1985,N,09749.2873,W,1,09,1.2,211.6,M,-22.5,M,,0000*62\r\n"
// "$GPGGA,045201.000,3014.3864,N,09748.9411,W,1,10,1.2,200.8,M,-22.5,M,,0000*6C\r\n"
// "$GPGG@,045252.000,3014.4273,S,09749.0628,W,1,09,1.3,206.9,M,-22.5,M,,0000*6F\r\n";
};

#endif

0 comments on commit de9d26e

Please sign in to comment.