Abstract out showing bootlogo

To improve support on PinecilV2
This commit is contained in:
Ben V. Brown
2023-08-01 21:18:27 +10:00
parent a7df1cc5be
commit 80c4b58976
7 changed files with 30 additions and 7 deletions

View File

@@ -101,6 +101,9 @@ void setBuzzer(bool on);
// For example, on the MHP30 this is used to figure out the resistance of the hotplate // For example, on the MHP30 this is used to figure out the resistance of the hotplate
uint8_t preStartChecks(); uint8_t preStartChecks();
uint8_t preStartChecksDone(); uint8_t preStartChecksDone();
// Show the boot logo
void showBootLogo(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -1,6 +1,7 @@
// BSP mapping functions // BSP mapping functions
#include "BSP.h" #include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "Pins.h" #include "Pins.h"
#include "Setup.h" #include "Setup.h"
@@ -473,3 +474,5 @@ uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; } uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,6 +1,7 @@
// BSP mapping functions // BSP mapping functions
#include "BSP.h" #include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "Pins.h" #include "Pins.h"
#include "Setup.h" #include "Setup.h"
@@ -408,3 +409,5 @@ uint8_t getTipInertia() {
return TIP_THERMAL_MASS; return TIP_THERMAL_MASS;
#endif #endif
} }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,6 +1,7 @@
// BSP mapping functions // BSP mapping functions
#include "BSP.h" #include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "IRQ.h" #include "IRQ.h"
#include "Pins.h" #include "Pins.h"
@@ -98,3 +99,5 @@ uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; } uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; } uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,6 +1,7 @@
// BSP mapping functions // BSP mapping functions
#include "BSP.h" #include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "IRQ.h" #include "IRQ.h"
#include "Pins.h" #include "Pins.h"
@@ -10,6 +11,7 @@
#include "Utils.h" #include "Utils.h"
#include "configuration.h" #include "configuration.h"
#include "crc32.h" #include "crc32.h"
#include "hal_flash.h"
#include "history.hpp" #include "history.hpp"
#include "main.hpp" #include "main.hpp"
@@ -279,3 +281,10 @@ uint8_t getDeviceValidationStatus() {
uint32_t computedHash = gethash(); uint32_t computedHash = gethash();
return programmedHash == computedHash ? 0 : 1; return programmedHash == computedHash ? 0 : 1;
} }
void showBootLogo(void) {
uint8_t scratch[1024];
flash_read(FLASH_LOGOADDR - 0x23000000, scratch, 1024);
BootLogo::handleShowingLogo(scratch);
}

View File

@@ -1,6 +1,7 @@
// BSP mapping functions // BSP mapping functions
#include "BSP.h" #include "BSP.h"
#include "BootLogo.h"
#include "HUB238.hpp" #include "HUB238.hpp"
#include "I2C_Wrapper.hpp" #include "I2C_Wrapper.hpp"
#include "Pins.h" #include "Pins.h"
@@ -237,3 +238,5 @@ uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_INERTIA; } uint8_t getTipInertia() { return TIP_THERMAL_INERTIA; }
void setBuzzer(bool on) {} void setBuzzer(bool on) {}
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -76,8 +76,7 @@ void startGUITask(void const *argument) {
currentTempTargetDegC = min(sleepTempDegC, 75); currentTempTargetDegC = min(sleepTempDegC, 75);
} }
BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); showBootLogo();
showWarnings(); showWarnings();
if (getSettingValue(SettingsOptions::AutoStartMode)) { if (getSettingValue(SettingsOptions::AutoStartMode)) {
// jump directly to the autostart mode // jump directly to the autostart mode