@@ -173,7 +173,7 @@ const RtkMode_t ntripServerMode = RTK_MODE_BASE_FIXED;
173
173
// ----------------------------------------
174
174
175
175
// NTRIP Servers
176
- static NTRIP_SERVER_DATA ntripServerArray[NTRIP_SERVER_MAX];
176
+ volatile static NTRIP_SERVER_DATA ntripServerArray[NTRIP_SERVER_MAX];
177
177
178
178
// ----------------------------------------
179
179
// NTRIP Server Routines
@@ -184,7 +184,7 @@ static NTRIP_SERVER_DATA ntripServerArray[NTRIP_SERVER_MAX];
184
184
// ----------------------------------------
185
185
bool ntripServerConnectCaster (int serverIndex)
186
186
{
187
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
187
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
188
188
const int SERVER_BUFFER_SIZE = 512 ;
189
189
char serverBuffer[SERVER_BUFFER_SIZE];
190
190
@@ -239,7 +239,7 @@ bool ntripServerConnectLimitReached(int serverIndex)
239
239
{
240
240
bool limitReached;
241
241
int minutes;
242
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
242
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
243
243
int seconds;
244
244
245
245
// Retry the connection a few times
@@ -249,8 +249,8 @@ bool ntripServerConnectLimitReached(int serverIndex)
249
249
// Shutdown the NTRIP server
250
250
ntripServerStop (serverIndex, limitReached || (!ntripServerEnabled (serverIndex, nullptr )));
251
251
252
- ntripServer->connectionAttempts ++ ;
253
- ntripServer->connectionAttemptsTotal ++ ;
252
+ ntripServer->connectionAttempts = ntripServer-> connectionAttempts + 1 ;
253
+ ntripServer->connectionAttemptsTotal = ntripServer-> connectionAttemptsTotal + 1 ;
254
254
if (settings.debugNtripServerState )
255
255
ntripServerPrintStatus (serverIndex);
256
256
@@ -334,7 +334,7 @@ bool ntripServerEnabled(int serverIndex, const char ** line)
334
334
// ----------------------------------------
335
335
void ntripServerPrintStateSummary (int serverIndex)
336
336
{
337
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
337
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
338
338
339
339
switch (ntripServer->state )
340
340
{
@@ -362,7 +362,7 @@ void ntripServerPrintStateSummary(int serverIndex)
362
362
// ----------------------------------------
363
363
void ntripServerPrintStatus (int serverIndex)
364
364
{
365
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
365
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
366
366
uint64_t milliseconds;
367
367
uint32_t days;
368
368
byte hours;
@@ -410,7 +410,7 @@ void ntripServerPrintStatus(int serverIndex)
410
410
// ----------------------------------------
411
411
void ntripServerProcessRTCM (int serverIndex, uint8_t incoming)
412
412
{
413
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
413
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
414
414
415
415
if (ntripServer->state == NTRIP_SERVER_CASTING)
416
416
{
@@ -445,8 +445,8 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
445
445
if (ntripServer->networkClient && ntripServer->networkClient ->connected ())
446
446
{
447
447
ntripServer->networkClient ->write (incoming); // Send this byte to socket
448
- ntripServer->bytesSent ++ ;
449
- ntripServer->rtcmBytesSent ++ ;
448
+ ntripServer->bytesSent = ntripServer-> bytesSent + 1 ;
449
+ ntripServer->rtcmBytesSent = ntripServer-> rtcmBytesSent + 1 ;
450
450
ntripServer->timer = millis ();
451
451
netOutgoingRTCM = true ;
452
452
}
@@ -464,7 +464,7 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
464
464
// ----------------------------------------
465
465
void ntripServerResponse (int serverIndex, char *response, size_t maxLength)
466
466
{
467
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
467
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
468
468
char *responseEnd;
469
469
470
470
// Make sure that we can zero terminate the response
@@ -483,7 +483,7 @@ void ntripServerResponse(int serverIndex, char *response, size_t maxLength)
483
483
// ----------------------------------------
484
484
void ntripServerRestart (int serverIndex)
485
485
{
486
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
486
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
487
487
488
488
// Save the previous uptime value
489
489
if (ntripServer->state == NTRIP_SERVER_CASTING)
@@ -496,7 +496,7 @@ void ntripServerRestart(int serverIndex)
496
496
// ----------------------------------------
497
497
void ntripServerSetState (int serverIndex, uint8_t newState)
498
498
{
499
- NTRIP_SERVER_DATA * ntripServer;
499
+ volatile NTRIP_SERVER_DATA * ntripServer;
500
500
501
501
ntripServer = &ntripServerArray[serverIndex];
502
502
if (settings.debugNtripServerState )
@@ -548,7 +548,7 @@ void ntripServerStop(int serverIndex, bool shutdown)
548
548
{
549
549
bool enabled;
550
550
int index;
551
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
551
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
552
552
553
553
if (ntripServer->networkClient )
554
554
{
@@ -612,7 +612,7 @@ void ntripServerUpdate(int serverIndex)
612
612
const char * line = " " ;
613
613
614
614
// Get the NTRIP data structure
615
- NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
615
+ volatile NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
616
616
617
617
// Shutdown the NTRIP server when the mode or setting changes
618
618
DMW_if
0 commit comments