move criticalerror defs into .proto for cross platform support

This commit is contained in:
Kevin Hester
2020-12-27 11:22:08 +08:00
parent 15833e1e53
commit 0c74303e9d
11 changed files with 101 additions and 63 deletions

View File

@@ -2,32 +2,7 @@
#include <Arduino.h>
/** Error codes for critical errors
*
* The device might report these fault codes on the screen. If you encounter a fault code, please
* post on the meshtastic.discourse.group and we'll try to help.
*/
enum CriticalErrorCode {
NoError = 0,
/// A software bug was detected while trying to send lora packets
ErrTxWatchdog = 1,
/// A software bug was detected on entry to sleep
ErrSleepEnterWait = 2,
/// No Lora radio hardware could be found
ErrNoRadio = 3,
/// Not normally used
ErrUnspecified = 4,
/// We failed while configuring a UBlox GPS
ErrUBloxInitFailed = 5,
/// This board was expected to have a power management chip and it is missing or broken
ErrNoAXP192 = 6
};
#include "mesh/mesh.pb.h" // For CriticalErrorCode
/// Record an error that should be reported via analytics
void recordCriticalError(CriticalErrorCode code, uint32_t address = 0);
void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_Unspecified, uint32_t address = 0);