Skip to content

Commit 01d42af

Browse files
committed
Rename espnowStart()
1 parent 76e4ec2 commit 01d42af

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Firmware/RTK_Everywhere/ESPNOW.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ void promiscuous_rx_cb(void *buf, wifi_promiscuous_pkt_type_t type)
156156
// If the radio is off entirely, start the radio, turn on only the LR protocol
157157
void espnowStart()
158158
{
159+
if (settings.enableEspNow == false)
160+
{
161+
espnowStop();
162+
return;
163+
}
164+
159165
#ifdef COMPILE_ESPNOW
160166

161167
// Before we can issue esp_wifi_() commands WiFi must be started

Firmware/RTK_Everywhere/States.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void stateUpdate()
110110
NETWORK_STOP(NETWORK_TYPE_WIFI);
111111
WIFI_STOP(); // Stop WiFi, ntripClient will start as needed.
112112
bluetoothStart(); // Turn on Bluetooth with 'Rover' name
113-
radioStart(); // Start internal radio if enabled, otherwise disable
113+
espnowStart(); // Start internal radio if enabled, otherwise disable
114114

115115
// Start the UART connected to the GNSS receiver for NMEA and UBX data (enables logging)
116116
if (tasksStartGnssUart() == false)
@@ -306,7 +306,7 @@ void stateUpdate()
306306
// Start the NTRIP server if requested
307307
RTK_MODE(RTK_MODE_BASE_FIXED);
308308

309-
radioStart(); // Start internal radio if enabled, otherwise disable
309+
espnowStart(); // Start internal radio if enabled, otherwise disable
310310

311311
rtcmPacketsSent = 0; // Reset any previous number
312312
changeState(STATE_BASE_TEMP_TRANSMITTING);
@@ -373,7 +373,7 @@ void stateUpdate()
373373
{
374374
baseStatusLedOn(); // Turn on the base/status LED
375375

376-
radioStart(); // Start internal radio if enabled, otherwise disable
376+
espnowStart(); // Start internal radio if enabled, otherwise disable
377377

378378
changeState(STATE_BASE_FIXED_TRANSMITTING);
379379
}

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ void menuRadio()
721721
printUnknown(incoming);
722722
}
723723

724-
radioStart();
724+
espnowStart();
725+
726+
// LoRa radio state machine will start/stop radio upon next updateLora in loop()
725727

726728
clearBuffer(); // Empty buffer of any newline chars
727729
}

0 commit comments

Comments
 (0)