Skip to content

Commit b4ddbd0

Browse files
committed
Whitespace change
1 parent e44e5d0 commit b4ddbd0

File tree

1 file changed

+80
-80
lines changed

1 file changed

+80
-80
lines changed

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,14 +1284,16 @@ void buttonCheckTask(void *e)
12841284
thisButtonRelease = millis();
12851285
}
12861286

1287-
if ((previousButtonRelease > 0) && (thisButtonRelease > 0) && ((thisButtonRelease - previousButtonRelease) <= doubleTapInterval)) // Do we have a double tap?
1287+
if ((previousButtonRelease > 0) && (thisButtonRelease > 0) &&
1288+
((thisButtonRelease - previousButtonRelease) <= doubleTapInterval)) // Do we have a double tap?
12881289
{
12891290
doubleTap = true;
12901291
singleTap = false;
12911292
previousButtonRelease = 0;
12921293
thisButtonRelease = 0;
12931294
}
1294-
else if ((thisButtonRelease > 0) && ((millis() - thisButtonRelease) > doubleTapInterval)) // Do we have a single tap?
1295+
else if ((thisButtonRelease > 0) &&
1296+
((millis() - thisButtonRelease) > doubleTapInterval)) // Do we have a single tap?
12951297
{
12961298
doubleTap = false;
12971299
singleTap = true;
@@ -1316,43 +1318,43 @@ void buttonCheckTask(void *e)
13161318

13171319
else if (doubleTap)
13181320
{
1319-
// If we are in Rover/Base mode, enter WiFi Config Mode
1320-
if (inRoverMode() || inBaseMode())
1321+
// If we are in Rover/Base mode, enter WiFi Config Mode
1322+
if (inRoverMode() || inBaseMode())
1323+
{
1324+
// Beep if we are not locally compiled or a release candidate
1325+
if (ENABLE_DEVELOPER == false)
13211326
{
1322-
// Beep if we are not locally compiled or a release candidate
1323-
if (ENABLE_DEVELOPER == false)
1324-
{
1325-
beepOn();
1326-
delay(300);
1327-
beepOff();
1328-
delay(100);
1329-
beepOn();
1330-
delay(300);
1331-
beepOff();
1332-
}
1333-
1334-
forceSystemStateUpdate = true; // Immediately go to this new state
1335-
changeState(STATE_WIFI_CONFIG_NOT_STARTED);
1327+
beepOn();
1328+
delay(300);
1329+
beepOff();
1330+
delay(100);
1331+
beepOn();
1332+
delay(300);
1333+
beepOff();
13361334
}
13371335

1338-
// If we are in WiFi Config Mode, exit to Rover
1339-
else if (inWiFiConfigMode())
1340-
{
1341-
// Beep if we are not locally compiled or a release candidate
1342-
if (ENABLE_DEVELOPER == false)
1343-
{
1344-
beepOn();
1345-
delay(300);
1346-
beepOff();
1347-
delay(100);
1348-
beepOn();
1349-
delay(300);
1350-
beepOff();
1351-
}
1336+
forceSystemStateUpdate = true; // Immediately go to this new state
1337+
changeState(STATE_WIFI_CONFIG_NOT_STARTED);
1338+
}
13521339

1353-
forceSystemStateUpdate = true; // Immediately go to this new state
1354-
changeState(STATE_ROVER_NOT_STARTED);
1340+
// If we are in WiFi Config Mode, exit to Rover
1341+
else if (inWiFiConfigMode())
1342+
{
1343+
// Beep if we are not locally compiled or a release candidate
1344+
if (ENABLE_DEVELOPER == false)
1345+
{
1346+
beepOn();
1347+
delay(300);
1348+
beepOff();
1349+
delay(100);
1350+
beepOn();
1351+
delay(300);
1352+
beepOff();
13551353
}
1354+
1355+
forceSystemStateUpdate = true; // Immediately go to this new state
1356+
changeState(STATE_ROVER_NOT_STARTED);
1357+
}
13561358
}
13571359

13581360
// The RTK Torch uses a shutdown IC configured to turn off ~3s
@@ -1363,7 +1365,7 @@ void buttonCheckTask(void *e)
13631365
if (ENABLE_DEVELOPER == false)
13641366
beepDurationMs(500); // Announce powering down
13651367
}
1366-
} // End productVariant == Torch
1368+
} // End productVariant == Torch
13671369
else // RTK EVK, RTK Facet v2, RTK Facet mosaic
13681370
{
13691371
if (systemState == STATE_SHUTDOWN)
@@ -1448,71 +1450,69 @@ void buttonCheckTask(void *e)
14481450
requestChangeState(STATE_CONFIG_VIA_ETH_RESTART_BASE);
14491451
break;
14501452

1451-
/* These lines are commented to allow default to print the diagnostic.
1452-
case STATE_KEYS_STARTED:
1453-
case STATE_KEYS_NEEDED:
1454-
case STATE_KEYS_WIFI_STARTED:
1455-
case STATE_KEYS_WIFI_CONNECTED:
1456-
case STATE_KEYS_WIFI_TIMEOUT:
1457-
case STATE_KEYS_EXPIRED:
1458-
case STATE_KEYS_DAYS_REMAINING:
1459-
case STATE_KEYS_LBAND_CONFIGURE:
1460-
case STATE_KEYS_LBAND_ENCRYPTED:
1461-
case STATE_KEYS_PROVISION_WIFI_STARTED:
1462-
case STATE_KEYS_PROVISION_WIFI_CONNECTED:
1463-
// Abort key download?
1464-
// TODO: check this! I think we want to be able to terminate STATE_KEYS via the button?
1465-
break;
1466-
*/
1453+
/* These lines are commented to allow default to print the diagnostic.
1454+
case STATE_KEYS_STARTED:
1455+
case STATE_KEYS_NEEDED:
1456+
case STATE_KEYS_WIFI_STARTED:
1457+
case STATE_KEYS_WIFI_CONNECTED:
1458+
case STATE_KEYS_WIFI_TIMEOUT:
1459+
case STATE_KEYS_EXPIRED:
1460+
case STATE_KEYS_DAYS_REMAINING:
1461+
case STATE_KEYS_LBAND_CONFIGURE:
1462+
case STATE_KEYS_LBAND_ENCRYPTED:
1463+
case STATE_KEYS_PROVISION_WIFI_STARTED:
1464+
case STATE_KEYS_PROVISION_WIFI_CONNECTED:
1465+
// Abort key download?
1466+
// TODO: check this! I think we want to be able to terminate STATE_KEYS via the button?
1467+
break;
1468+
*/
14671469

14681470
default:
14691471
systemPrintf("buttonCheckTask single tap - untrapped system state: %d\r\n", systemState);
1470-
//requestChangeState(STATE_BASE_NOT_STARTED);
1472+
// requestChangeState(STATE_BASE_NOT_STARTED);
14711473
break;
14721474
} // End singleTap switch (systemState)
1473-
} // End singleTap
1475+
} // End singleTap
14741476
else if (doubleTap && (firstRoverStart == false) && (settings.disableSetupButton == false))
14751477
{
14761478
switch (systemState)
14771479
{
1478-
case STATE_DISPLAY_SETUP:
1480+
case STATE_DISPLAY_SETUP: {
1481+
// If we are displaying the setup menu, a single tap will cycle through possible system states - see
1482+
// above Exit into new system state on double tap Exit display setup into previous state after ~10s
1483+
// - see updateSystemState()
1484+
lastSetupMenuChange = millis(); // Prevent a timeout during state change
1485+
uint8_t thisIsButton = 0;
1486+
for (auto it = setupButtons.begin(); it != setupButtons.end(); it = std::next(it))
14791487
{
1480-
// If we are displaying the setup menu, a single tap will cycle through possible system states - see above
1481-
// Exit into new system state on double tap
1482-
// Exit display setup into previous state after ~10s - see updateSystemState()
1483-
lastSetupMenuChange = millis(); // Prevent a timeout during state change
1484-
uint8_t thisIsButton = 0;
1485-
for (auto it = setupButtons.begin(); it != setupButtons.end(); it = std::next(it))
1488+
if (thisIsButton == setupSelectedButton)
14861489
{
1487-
if (thisIsButton == setupSelectedButton)
1490+
setupButton theButton = *it;
1491+
1492+
if (theButton.newState == STATE_PROFILE)
14881493
{
1489-
setupButton theButton = *it;
1490-
1491-
if (theButton.newState == STATE_PROFILE)
1492-
{
1493-
displayProfile = theButton.newProfile; // paintProfile needs the unit
1494-
requestChangeState(STATE_PROFILE);
1495-
}
1496-
else if (theButton.newState == STATE_NOT_SET) // Exit
1497-
requestChangeState(lastSystemState);
1498-
else
1499-
requestChangeState(theButton.newState);
1500-
1501-
break;
1494+
displayProfile = theButton.newProfile; // paintProfile needs the unit
1495+
requestChangeState(STATE_PROFILE);
15021496
}
1503-
thisIsButton++;
1497+
else if (theButton.newState == STATE_NOT_SET) // Exit
1498+
requestChangeState(lastSystemState);
1499+
else
1500+
requestChangeState(theButton.newState);
1501+
1502+
break;
15041503
}
1504+
thisIsButton++;
15051505
}
1506-
break;
1507-
1506+
}
1507+
break;
15081508

15091509
default:
15101510
systemPrintf("buttonCheckTask double tap - untrapped system state: %d\r\n", systemState);
1511-
//requestChangeState(STATE_BASE_NOT_STARTED);
1511+
// requestChangeState(STATE_BASE_NOT_STARTED);
15121512
break;
15131513
} // End doubleTap switch (systemState)
1514-
} // End doubleTap
1515-
} // End productVariant != Torch
1514+
} // End doubleTap
1515+
} // End productVariant != Torch
15161516

15171517
feedWdt();
15181518
taskYIELD();

0 commit comments

Comments
 (0)