Skip to content

Commit 6b2e0d8

Browse files
committed
ESP-NOW: Replace espnowStart with ESPNOW_START macro
1 parent 1233c51 commit 6b2e0d8

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ void webServerUpdate() {}
177177

178178
#ifndef COMPILE_ESPNOW
179179

180-
bool espNowStart() {return false;}
181180
bool espNowStop() {return false;}
182181

183182
bool espnowGetState() {return ESPNOW_OFF;}
@@ -187,6 +186,7 @@ esp_err_t espnowRemovePeer(uint8_t *peerMac) {return ESP_OK;}
187186
esp_err_t espnowSendPairMessage(uint8_t *sendToMac) {return ESP_OK;}
188187
bool espnowSetChannel(uint8_t channelNumber) {return false;}
189188
void espnowStart() {}
189+
#define ESPNOW_START() false
190190
void espnowStaticPairing() {}
191191
void espnowStop() {}
192192
void updateEspnow() {}

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ uint8_t receivedMAC[6]; // Holds the broadcast MAC during pairing
614614

615615
unsigned long lastEspnowRssiUpdate;
616616

617+
#define ESPNOW_START() espnowStart()
617618
#endif // COMPILE_ESPNOW
618619

619620
int espnowRSSI;

Firmware/RTK_Everywhere/States.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void stateUpdate()
113113
setMuxport(settings.dataPortChannel); // Return mux to original channel
114114

115115
bluetoothStart(); // Turn on Bluetooth with 'Rover' name
116-
espnowStart(); // Start internal radio if enabled, otherwise disable
116+
ESPNOW_START(); // Start internal radio if enabled, otherwise disable
117117

118118
webServerStop(); // Stop the web config server
119119
baseCasterDisableOverride(); // Disable casting overrides
@@ -333,7 +333,7 @@ void stateUpdate()
333333
// Start the NTRIP server if requested
334334
RTK_MODE(RTK_MODE_BASE_FIXED);
335335

336-
espnowStart(); // Start internal radio if enabled, otherwise disable
336+
ESPNOW_START(); // Start internal radio if enabled, otherwise disable
337337

338338
rtcmPacketsSent = 0; // Reset any previous number
339339
changeState(STATE_BASE_TEMP_TRANSMITTING);
@@ -400,7 +400,7 @@ void stateUpdate()
400400
{
401401
baseStatusLedOn(); // Turn on the base/status LED
402402

403-
espnowStart(); // Start internal radio if enabled, otherwise disable
403+
ESPNOW_START(); // Start internal radio if enabled, otherwise disable
404404

405405
changeState(STATE_BASE_FIXED_TRANSMITTING);
406406
}

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ void menuRadio()
605605

606606
// Start ESP-NOW so that getChannel runs correctly
607607
if (settings.enableEspNow == true)
608-
espnowStart();
608+
ESPNOW_START();
609609
else
610610
espnowStop();
611611
}
@@ -644,7 +644,7 @@ void menuRadio()
644644
else if (settings.enableEspNow == true && incoming == 5 && settings.debugEspNow == true)
645645
{
646646
if (espnowGetState() == ESPNOW_OFF)
647-
espnowStart();
647+
ESPNOW_START();
648648

649649
uint8_t peer1[] = {0xB8, 0xD6, 0x1A, 0x0D, 0x8F, 0x9C}; // Random MAC
650650
#ifdef COMPILE_ESPNOW
@@ -668,7 +668,7 @@ void menuRadio()
668668
else if (settings.enableEspNow == true && incoming == 6 && settings.debugEspNow == true)
669669
{
670670
if (espnowGetState() == ESPNOW_OFF)
671-
espnowStart();
671+
ESPNOW_START();
672672

673673
uint8_t espnowData[] =
674674
"This is the long string to test how quickly we can send one string to the other unit. I am going to "
@@ -681,7 +681,7 @@ void menuRadio()
681681
else if (settings.enableEspNow == true && incoming == 7 && settings.debugEspNow == true)
682682
{
683683
if (espnowGetState() == ESPNOW_OFF)
684-
espnowStart();
684+
ESPNOW_START();
685685

686686
uint8_t espnowData[] =
687687
"This is the long string to test how quickly we can send one string to the other unit. I am going to "
@@ -717,7 +717,7 @@ void menuRadio()
717717
printUnknown(incoming);
718718
}
719719

720-
espnowStart();
720+
ESPNOW_START();
721721

722722
// LoRa radio state machine will start/stop radio upon next updateLora in loop()
723723

0 commit comments

Comments
 (0)