build: clean up the mess of ifdefs from platform into a scons-configured hal
This commit is contained in:
30
src/Hal.h
Normal file
30
src/Hal.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
struct BootOptions;
|
||||
|
||||
typedef enum {
|
||||
HAL_UNKNOWN,
|
||||
HAL_ESP32,
|
||||
HAL_ESP8266
|
||||
} HalBackend;
|
||||
|
||||
constexpr HalBackend DefaultBackend = HAL_ESP8266;
|
||||
|
||||
template<HalBackend Backend = DefaultBackend>
|
||||
class PlatformImpl {
|
||||
public:
|
||||
static const char* name();
|
||||
static const char* version();
|
||||
static int freeRam();
|
||||
static void startWatchdog();
|
||||
static void startNTP();
|
||||
static bool getLocalTime(struct tm* timedata, int timezone);
|
||||
static void loop();
|
||||
static const char* deviceID();
|
||||
__attribute__((noreturn)) static void restart();
|
||||
static void bootSplash();
|
||||
static void printCrashInfo();
|
||||
|
||||
static void initBootOptions(BootOptions& opts);
|
||||
static void forceSafeMode();
|
||||
};
|
Reference in New Issue
Block a user