Continue boot on bad PSRAM (#1558)

* add sensor status, show special index/setup page in case of a critical error

* continue booting on PSRAM error

* Update main.cpp

added log messages

* init PSRAM and add more log messages

* cleanup of init checks

* .

* .

* .

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2022-12-12 16:57:14 +01:00
committed by GitHub
parent 6863e637aa
commit 24f10b4683
6 changed files with 133 additions and 29 deletions

View File

@@ -63,6 +63,27 @@ string getSDCardCapacity();
string getSDCardSectorSize();
string getMac(void);
/* Error bit fields
One bit per error
Make sure it matches https://github.com/jomjol/AI-on-the-edge-device/wiki/Error-Codes */
enum SystemStatusFlag_t { // One bit per error
// First Byte
SYSTEM_STATUS_PSRAM_BAD = 1 << 0, // 4, Critical Error
SYSTEM_STATUS_HEAP_TOO_SMALL = 1 << 1, // 8, Critical Error
SYSTEM_STATUS_CAM_BAD = 1 << 2, // 1, Critical Error
// Second Byte
SYSTEM_STATUS_CAM_FB_BAD = 1 << (0+8), // 2, Flow still might work
SYSTEM_STATUS_NTP_BAD = 1 << (1+8), // 16, Flow will work but time will be wrong
};
void setSystemStatusFlag(SystemStatusFlag_t flag);
void clearSystemStatusFlag(SystemStatusFlag_t flag);
int getSystemStatus(void);
bool isSetSystemStatusFlag(SystemStatusFlag_t flag);
string getResetReason(void);
std::string getFormatedUptime(bool compact);