mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 02:10:00 +01:00
Add version detection
This commit is contained in:
parent
ba0594959e
commit
88615ce248
@ -18,8 +18,9 @@ uint lastTimeSync;
|
||||
|
||||
void setup()
|
||||
{
|
||||
setupPreferences();
|
||||
setupHardware();
|
||||
|
||||
setupPreferences();
|
||||
setupDisplays();
|
||||
if (preferences.getBool("ledTestOnPower", true))
|
||||
{
|
||||
@ -196,8 +197,8 @@ void tryImprovSetup()
|
||||
// esp_task_wdt_deinit();
|
||||
// esp_task_wdt_reset();
|
||||
}
|
||||
setFgColor(preferences.getUInt("fgColor", DEFAULT_FG_COLOR));
|
||||
setBgColor(preferences.getUInt("bgColor", DEFAULT_BG_COLOR));
|
||||
setFgColor(preferences.getUInt("fgColor", isWhiteVersion() ? GxEPD_BLACK : GxEPD_WHITE));
|
||||
setBgColor(preferences.getUInt("bgColor", isWhiteVersion() ? GxEPD_WHITE : GxEPD_BLACK));
|
||||
}
|
||||
// else
|
||||
// {
|
||||
@ -370,6 +371,11 @@ void setupHardware()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef IS_HW_REV_B
|
||||
pinMode(39, INPUT_PULLUP);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef IS_BTCLOCK_S3
|
||||
if (!mcp2.begin_I2C(0x21))
|
||||
{
|
||||
@ -724,4 +730,12 @@ String getHwRev() {
|
||||
#else
|
||||
return HW_REV;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool isWhiteVersion() {
|
||||
#ifdef IS_HW_REV_B
|
||||
return digitalRead(39);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
@ -63,4 +63,5 @@ void improv_send_response(std::vector<uint8_t> &response);
|
||||
void improv_set_error(improv::Error error);
|
||||
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
String getHwRev();
|
||||
String getHwRev();
|
||||
bool isWhiteVersion();
|
Loading…
Reference in New Issue
Block a user