mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-13 15:11:20 +10:00
More boot animation work
This commit is contained in:
@@ -128,6 +128,8 @@ class GPS : private concurrency::OSThread
|
||||
// Let the GPS hardware save power between updates
|
||||
void down();
|
||||
|
||||
bool initFinished() const { return GPSInitFinished; };
|
||||
|
||||
private:
|
||||
GPS() : concurrency::OSThread("GPS") {}
|
||||
|
||||
|
||||
@@ -889,7 +889,7 @@ int32_t Screen::runOnce()
|
||||
// Show boot screen for first logo_timeout seconds, then switch to normal operation.
|
||||
// serialSinceMsec adjusts for additional serial wait time during nRF52 bootup
|
||||
static bool showingBootScreen = true;
|
||||
if (showingBootScreen && (millis() > (logo_timeout + serialSinceMsec))) {
|
||||
if (showingBootScreen && (!gps || gps->initFinished()) && (millis() > (logo_timeout + serialSinceMsec))) {
|
||||
LOG_INFO("Done with boot screen");
|
||||
stopBootScreen();
|
||||
showingBootScreen = false;
|
||||
|
||||
@@ -1150,7 +1150,22 @@ void UIRenderer::drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLED
|
||||
display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title);
|
||||
display->setFont(FONT_SMALL);
|
||||
if (bootString != nullptr) {
|
||||
display->drawString(x + getStringCenteredX(bootString), y + SCREEN_HEIGHT - 2 * FONT_HEIGHT_MEDIUM, bootString);
|
||||
static uint8_t bootStringStep = 0;
|
||||
char stringCharacter = '.';
|
||||
uint32_t stringWidth = getStringCenteredX(bootString);
|
||||
if (bootStringStep == 0) {
|
||||
stringCharacter = '.';
|
||||
bootStringStep++;
|
||||
} else if (bootStringStep == 1) {
|
||||
stringCharacter = 'o';
|
||||
bootStringStep++;
|
||||
} else if (bootStringStep == 2) {
|
||||
stringCharacter = 'O';
|
||||
bootStringStep = 0;
|
||||
}
|
||||
char tmpBootString[40];
|
||||
snprintf(tmpBootString, sizeof(tmpBootString), "%s %c", bootString, stringCharacter);
|
||||
display->drawString(x + stringWidth, y + SCREEN_HEIGHT - 2 * FONT_HEIGHT_MEDIUM, tmpBootString);
|
||||
}
|
||||
// Draw region in upper left
|
||||
if (upperMsg)
|
||||
|
||||
+2
-1
@@ -83,7 +83,8 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
char *bootString = nullptr; // Pointer to a string that will be drawn on the boot screen, if set (used for GPS probing status)
|
||||
const char *bootString =
|
||||
nullptr; // Pointer to a string that will be drawn on the boot screen, if set (used for GPS probing status)
|
||||
#ifdef ARCH_ESP32
|
||||
#ifdef DEBUG_PARTITION_TABLE
|
||||
#include "esp_partition.h"
|
||||
|
||||
+1
-1
@@ -102,4 +102,4 @@ void scannerToSensorsMap(const std::unique_ptr<ScanI2CTwoWire> &i2cScanner, Scan
|
||||
// We default to 4MHz SPI, SPI mode 0
|
||||
extern SPISettings spiSettings;
|
||||
|
||||
extern char *bootString;
|
||||
extern const char *bootString;
|
||||
|
||||
Reference in New Issue
Block a user