Skip to content

Commit 86bc849

Browse files
committed
Add compile gates to ESP Now functions
1 parent e1d47d1 commit 86bc849

File tree

11 files changed

+322
-227
lines changed

11 files changed

+322
-227
lines changed

Firmware/RTK_Surveyor/Base.ino

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

232+
#ifdef COMPILE_ESPNOW
232233
if (wifiState == ESPNOW_PAIRED)
233234
{
234235
//Move this byte into ESP NOW to send buffer
@@ -238,11 +239,10 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming)
238239
if (espnowOutgoingSpot == sizeof(espnowOutgoing))
239240
{
240241
espnowOutgoingSpot = 0; //Wrap
241-
#ifdef COMPILE_WIFI
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
244244
//log_d("ESPNOW: Sending %d bytes", sizeof(espnowOutgoing));
245-
#endif
246245
}
247246
}
247+
#endif
248248
}

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void beginSD()
202202
else if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) != pdPASS)
203203
{
204204
//This is OK since a retry will occur next loop
205-
log_d("sdCardSemaphore failed to yield, Begin.ino line %d\r\n", __LINE__);
205+
log_d("sdCardSemaphore failed to yield, Begin.ino line %d", __LINE__);
206206
break;
207207
}
208208
gotSemaphore = true;
@@ -837,8 +837,9 @@ void beginI2C()
837837
}
838838

839839
//Depending on radio selection, begin hardware
840-
void beginRadio()
840+
void radioStart()
841841
{
842+
#ifdef COMPILE_ESPNOW
842843
if (settings.radioType == RADIO_EXTERNAL)
843844
{
844845
espnowStop();
@@ -849,4 +850,5 @@ void beginRadio()
849850
{
850851
espnowStart();
851852
}
853+
#endif
852854
}

0 commit comments

Comments
 (0)