@@ -58,6 +58,9 @@ void setup()
58
58
{
59
59
preferences.clear ();
60
60
queueLedEffect (LED_EFFECT_WIFI_ERASE_SETTINGS);
61
+ nvs_flash_erase ();
62
+ delay (1000 );
63
+
61
64
ESP.restart ();
62
65
}
63
66
}
@@ -229,6 +232,9 @@ void setupWifi()
229
232
// esp_task_wdt_deinit();
230
233
// esp_task_wdt_reset();
231
234
}
235
+
236
+
237
+
232
238
setFgColor (preferences.getUInt (" fgColor" , isWhiteVersion () ? GxEPD_BLACK : GxEPD_WHITE));
233
239
setBgColor (preferences.getUInt (" bgColor" , isWhiteVersion () ? GxEPD_WHITE : GxEPD_BLACK));
234
240
}
@@ -274,6 +280,16 @@ void setupPreferences()
274
280
else
275
281
setCurrentCurrency (CURRENCY_USD);
276
282
283
+ if (!preferences.isKey (" flDisable" )) {
284
+ preferences.putBool (" flDisable" , isWhiteVersion () ? false : true );
285
+ }
286
+
287
+ if (!preferences.isKey (" fgColor" )) {
288
+ preferences.putUInt (" fgColor" , isWhiteVersion () ? GxEPD_BLACK : GxEPD_WHITE);
289
+ preferences.putUInt (" bgColor" , isWhiteVersion () ? GxEPD_WHITE : GxEPD_BLACK);
290
+ }
291
+
292
+
277
293
addScreenMapping (SCREEN_BLOCK_HEIGHT, " Block Height" );
278
294
279
295
addScreenMapping (SCREEN_TIME, " Time" );
@@ -455,6 +471,10 @@ void setupHardware()
455
471
Serial.println (F (" An Error has occurred while mounting LittleFS" ));
456
472
}
457
473
474
+ if (HW_REV == " REV_B_EPD_2_13" && !isWhiteVersion ()) {
475
+ Serial.println (F (" Black Rev B" ));
476
+ }
477
+
458
478
if (!LittleFS.open (" /index.html.gz" , " r" ))
459
479
{
460
480
Serial.println (F (" Error loading WebUI" ));
@@ -509,7 +529,7 @@ void setupHardware()
509
529
}
510
530
511
531
#ifdef IS_HW_REV_B
512
- pinMode (39 , INPUT_PULLUP );
532
+ pinMode (39 , INPUT_PULLDOWN );
513
533
514
534
#endif
515
535
@@ -690,6 +710,7 @@ String getHwRev()
690
710
bool isWhiteVersion ()
691
711
{
692
712
#ifdef IS_HW_REV_B
713
+ pinMode (39 , INPUT_PULLDOWN);
693
714
return digitalRead (39 );
694
715
#else
695
716
return false ;
0 commit comments