* Moved config mode check to the DriverManager Removed ConfigManager as this idiom never took off and we have better ones in place Modified NetDriver to run rndis making it the controller of web Moved Storage -> config Mode to Driver -> config Mode Fixed no-save issue with web config calls * Move our reboot translations back to WEB -> SYSTEM * Added rebootMode to event trigger handling in gp2040
27 lines
747 B
C++
27 lines
747 B
C++
#ifndef _DRIVERMANAGER_H
|
|
#define _DRIVERMANAGER_H
|
|
|
|
#include "enums.pb.h"
|
|
#include "gpdriver.h"
|
|
|
|
class GPDriver;
|
|
|
|
class DriverManager {
|
|
public:
|
|
DriverManager(DriverManager const&) = delete;
|
|
void operator=(DriverManager const&) = delete;
|
|
static DriverManager& getInstance() {// Thread-safe storage ensures cross-thread talk
|
|
static DriverManager instance; // Guaranteed to be destroyed. // Instantiated on first use.
|
|
return instance;
|
|
}
|
|
GPDriver * getDriver() { return driver; }
|
|
void setup(InputMode);
|
|
InputMode getInputMode(){ return inputMode; }
|
|
bool isConfigMode(){ return (inputMode == INPUT_MODE_CONFIG); }
|
|
private:
|
|
DriverManager() {}
|
|
GPDriver * driver;
|
|
InputMode inputMode;
|
|
};
|
|
|
|
#endif |