Skip to content

Commit b83b326

Browse files
committed
Show bubble menu based on accel online
1 parent 20e478f commit b83b326

File tree

2 files changed

+184
-52
lines changed

2 files changed

+184
-52
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 156 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,45 +2225,106 @@ void paintDisplaySetup()
22252225
{
22262226
if (setupState == STATE_MARK_EVENT)
22272227
{
2228-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2229-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2230-
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2231-
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2228+
if (online.accelerometer)
2229+
{
2230+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2231+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2232+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2233+
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2234+
}
2235+
else
2236+
{
2237+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2238+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2239+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2240+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2241+
}
22322242
}
22332243
else if (setupState == STATE_ROVER_NOT_STARTED)
22342244
{
2235-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2236-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2237-
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2238-
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2245+
if (online.accelerometer)
2246+
{
2247+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2248+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2249+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2250+
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2251+
}
2252+
else
2253+
{
2254+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2255+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2256+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2257+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2258+
}
22392259
}
22402260
else if (setupState == STATE_BASE_NOT_STARTED)
22412261
{
2242-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2243-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2244-
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, true);
2245-
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2262+
if (online.accelerometer)
2263+
{
2264+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2265+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2266+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, true);
2267+
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, false);
2268+
}
2269+
else
2270+
{
2271+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2272+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2273+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, true);
2274+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2275+
}
22462276
}
22472277
else if (setupState == STATE_BUBBLE_LEVEL)
22482278
{
2249-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2250-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2251-
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2252-
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, true);
2279+
if (online.accelerometer)
2280+
{
2281+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2282+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2283+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2284+
printTextCenter("Bubble", 12 * 3, QW_FONT_8X16, 1, true);
2285+
}
2286+
else
2287+
{
2288+
//We should never get here, but just in case
2289+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false); //string, y, font type, kerning, inverted
2290+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2291+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2292+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2293+
}
22532294
}
22542295
else if (setupState == STATE_WIFI_CONFIG_NOT_STARTED)
22552296
{
2256-
printTextCenter("Rover", 12 * 0, QW_FONT_8X16, 1, false);
2257-
printTextCenter("Base", 12 * 1, QW_FONT_8X16, 1, false);
2258-
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2259-
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2297+
if (online.accelerometer)
2298+
{
2299+
printTextCenter("Rover", 12 * 0, QW_FONT_8X16, 1, false);
2300+
printTextCenter("Base", 12 * 1, QW_FONT_8X16, 1, false);
2301+
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2302+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2303+
}
2304+
else
2305+
{
2306+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2307+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2308+
printTextCenter("Base", 12 * 2, QW_FONT_8X16, 1, false);
2309+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2310+
}
22602311
}
22612312
else if (setupState == STATE_ESPNOW_PAIRING_NOT_STARTED)
22622313
{
2263-
printTextCenter("Base", 12 * 0, QW_FONT_8X16, 1, false);
2264-
printTextCenter("Bubble", 12 * 1, QW_FONT_8X16, 1, false);
2265-
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2266-
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2314+
if (online.accelerometer)
2315+
{
2316+
printTextCenter("Base", 12 * 0, QW_FONT_8X16, 1, false);
2317+
printTextCenter("Bubble", 12 * 1, QW_FONT_8X16, 1, false);
2318+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2319+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2320+
}
2321+
else
2322+
{
2323+
printTextCenter("Rover", 12 * 0, QW_FONT_8X16, 1, false);
2324+
printTextCenter("Base", 12 * 1, QW_FONT_8X16, 1, false);
2325+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2326+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2327+
}
22672328
}
22682329
else if (setupState == STATE_PROFILE)
22692330
paintDisplaySetupProfile("Base");
@@ -2272,38 +2333,89 @@ void paintDisplaySetup()
22722333
{
22732334
if (setupState == STATE_MARK_EVENT)
22742335
{
2275-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2276-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2277-
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2278-
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2336+
if (online.accelerometer)
2337+
{
2338+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2339+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2340+
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2341+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2342+
}
2343+
else
2344+
{
2345+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, true); //string, y, font type, kerning, inverted
2346+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2347+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2348+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, false);
2349+
}
22792350
}
22802351
else if (setupState == STATE_ROVER_NOT_STARTED)
22812352
{
2282-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2283-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2284-
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2285-
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2353+
if (online.accelerometer)
2354+
{
2355+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2356+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2357+
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2358+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2359+
}
2360+
else
2361+
{
2362+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2363+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, true);
2364+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2365+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, false);
2366+
}
22862367
}
22872368
else if (setupState == STATE_BUBBLE_LEVEL)
22882369
{
2289-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2290-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2291-
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, true);
2292-
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2370+
if (online.accelerometer)
2371+
{
2372+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2373+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2374+
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, true);
2375+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, false);
2376+
}
2377+
else
2378+
{
2379+
//We should never get here, but just in case
2380+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2381+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2382+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, true);
2383+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, false);
2384+
}
22932385
}
22942386
else if (setupState == STATE_WIFI_CONFIG_NOT_STARTED)
22952387
{
2296-
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2297-
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2298-
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2299-
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2388+
if (online.accelerometer)
2389+
{
2390+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2391+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2392+
printTextCenter("Bubble", 12 * 2, QW_FONT_8X16, 1, false);
2393+
printTextCenter("Config", 12 * 3, QW_FONT_8X16, 1, true);
2394+
}
2395+
else
2396+
{
2397+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2398+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2399+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, true);
2400+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, false);
2401+
}
23002402
}
23012403
else if (setupState == STATE_ESPNOW_PAIRING_NOT_STARTED)
23022404
{
2303-
printTextCenter("Rover", 12 * 0, QW_FONT_8X16, 1, false);
2304-
printTextCenter("Bubble", 12 * 1, QW_FONT_8X16, 1, false);
2305-
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2306-
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2405+
if (online.accelerometer)
2406+
{
2407+
printTextCenter("Rover", 12 * 0, QW_FONT_8X16, 1, false);
2408+
printTextCenter("Bubble", 12 * 1, QW_FONT_8X16, 1, false);
2409+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2410+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2411+
}
2412+
else
2413+
{
2414+
printTextCenter("Mark", 12 * 0, QW_FONT_8X16, 1, false);
2415+
printTextCenter("Rover", 12 * 1, QW_FONT_8X16, 1, false);
2416+
printTextCenter("Config", 12 * 2, QW_FONT_8X16, 1, false);
2417+
printTextCenter("E-Pair", 12 * 3, QW_FONT_8X16, 1, true);
2418+
}
23072419
}
23082420
else if (setupState == STATE_PROFILE)
23092421
paintDisplaySetupProfile("Rover");

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void handleGNSSDataTask(void *e)
411411
if (USE_MMC_MICROSD)
412412
ubxFile->flush();
413413
fileSize = ubxFile->fileSize(); //Update file size
414-
414+
415415
sdFreeSpace -= sliceToRecord; //Update remaining space on SD
416416

417417
//Force file sync every 60s
@@ -689,12 +689,22 @@ void ButtonCheckTask(void *e)
689689
case STATE_ROVER_NOT_STARTED:
690690
//If F9R, skip base state
691691
if (zedModuleType == PLATFORM_F9R)
692-
setupState = STATE_BUBBLE_LEVEL;
692+
{
693+
//If accel offline, skip bubble
694+
if (online.accelerometer == true)
695+
setupState = STATE_BUBBLE_LEVEL;
696+
else
697+
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
698+
}
693699
else
694700
setupState = STATE_BASE_NOT_STARTED;
695701
break;
696702
case STATE_BASE_NOT_STARTED:
697-
setupState = STATE_BUBBLE_LEVEL;
703+
//If accel offline, skip bubble
704+
if (online.accelerometer == true)
705+
setupState = STATE_BUBBLE_LEVEL;
706+
else
707+
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
698708
break;
699709
case STATE_BUBBLE_LEVEL:
700710
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
@@ -811,12 +821,22 @@ void ButtonCheckTask(void *e)
811821
case STATE_ROVER_NOT_STARTED:
812822
//If F9R, skip base state
813823
if (zedModuleType == PLATFORM_F9R)
814-
setupState = STATE_BUBBLE_LEVEL;
824+
{
825+
//If accel offline, skip bubble
826+
if (online.accelerometer == true)
827+
setupState = STATE_BUBBLE_LEVEL;
828+
else
829+
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
830+
}
815831
else
816832
setupState = STATE_BASE_NOT_STARTED;
817833
break;
818834
case STATE_BASE_NOT_STARTED:
819-
setupState = STATE_BUBBLE_LEVEL;
835+
//If accel offline, skip bubble
836+
if (online.accelerometer == true)
837+
setupState = STATE_BUBBLE_LEVEL;
838+
else
839+
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
820840
break;
821841
case STATE_BUBBLE_LEVEL:
822842
setupState = STATE_WIFI_CONFIG_NOT_STARTED;
@@ -1125,9 +1145,9 @@ void sdSizeCheckTask(void *e)
11251145
//uint64_t sdUsedSpace = sdCardSize - sdFreeSpace; //Don't think of it as used, think of it as unusable
11261146

11271147
systemPrintf("SD card size: %s / Free space: %s\r\n",
1128-
stringHumanReadableSize(sdCardSize),
1129-
stringHumanReadableSize(sdFreeSpace)
1130-
);
1148+
stringHumanReadableSize(sdCardSize),
1149+
stringHumanReadableSize(sdFreeSpace)
1150+
);
11311151

11321152
outOfSDSpace = false;
11331153

0 commit comments

Comments
 (0)