Skip to content

Commit d3f94bf

Browse files
committed
Fix ESPNOW state change error
1 parent 6824306 commit d3f94bf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Firmware/RTK_Surveyor/Base.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming)
230230
ntripServerProcessRTCM(incoming);
231231

232232
#ifdef COMPILE_ESPNOW
233-
if (wifiState == ESPNOW_PAIRED)
233+
if (espnowState == ESPNOW_PAIRED)
234234
{
235235
//Move this byte into ESP NOW to send buffer
236236
espnowOutgoing[espnowOutgoingSpot++] = incoming;
@@ -241,7 +241,7 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming)
241241
espnowOutgoingSpot = 0; //Wrap
242242
esp_now_send(0, (uint8_t *) &espnowOutgoing, sizeof(espnowOutgoing)); //Send packet to all peers
243243
delay(10); //We need a small delay between sending multiple packets
244-
//log_d("ESPNOW: Sending %d bytes", sizeof(espnowOutgoing));
244+
log_d("ESPNOW: Sending %d bytes", sizeof(espnowOutgoing));
245245
}
246246
}
247247
#endif

Firmware/RTK_Surveyor/ESPNOW.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void espnowStart()
102102
//If ESP-Now is active, WiFi is active, do nothing
103103
else
104104
{
105-
Serial.println("Wi-Fi on, ESP-Now on");
105+
Serial.println("Wi-Fi already on, ESP-Now already on");
106106
}
107107

108108
// Init ESP-NOW
@@ -299,7 +299,7 @@ esp_err_t espnowRemovePeer(uint8_t *peerMac)
299299
}
300300

301301
//Update the state of the ESP Now state machine
302-
void espnowSetState(byte newState)
302+
void espnowSetState(ESPNOWState newState)
303303
{
304304
if (espnowState == newState)
305305
Serial.print("*");

Firmware/RTK_Surveyor/settings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ enum WiFiState
114114
};
115115
volatile byte wifiState = WIFI_OFF;
116116

117-
enum ESPNOWState
117+
typedef enum ESPNOWState
118118
{
119119
ESPNOW_OFF,
120120
ESPNOW_ON,
121121
ESPNOW_PAIRING,
122122
ESPNOW_MAC_RECEIVED,
123123
ESPNOW_PAIRED,
124-
};
125-
volatile byte espnowState = ESPNOW_OFF;
124+
} ESPNOWState;
125+
volatile ESPNOWState espnowState = ESPNOW_OFF;
126126

127127
enum NTRIPClientState
128128
{

0 commit comments

Comments
 (0)