Compare commits

..

No commits in common. "3149259309255f2c6de2d57fd48983ef10512f60" and "2ac2a62c617ca0469cba1027c70c0ddd9ac3ae76" have entirely different histories.

6 changed files with 4 additions and 20 deletions

2
data

@ -1 +1 @@
Subproject commit f5a9133cabfbab82325275575545c12f7aacf8f2
Subproject commit 8389ed8e36a9a1a7a39ca31f53324a0949aedb1d

View File

@ -40,7 +40,7 @@ lib_deps =
bblanchon/ArduinoJson@^7.4.1
esp32async/ESPAsyncWebServer @ 3.7.7
robtillaart/MCP23017@^0.9.1
adafruit/Adafruit NeoPixel@^1.15.1
adafruit/Adafruit NeoPixel@^1.12.5
https://github.com/dsbaars/universal_pin#feature/mcp23017_rt
https://github.com/dsbaars/GxEPD2#universal_pin
https://github.com/tzapu/WiFiManager.git#v2.0.17

View File

@ -86,7 +86,6 @@
#define DEFAULT_CUSTOM_ENDPOINT "ws-staging.btclock.dev"
#define DEFAULT_CUSTOM_ENDPOINT_DISABLE_SSL false
#define DEFAULT_MOW_MODE false
#define DEFAULT_SCREEN_RESTORE_AFTER_ZAP true
// Define data source types
enum DataSourceType {

View File

@ -10,14 +10,6 @@ boolean nostrIsSubscribing = true;
String subIdZap;
void screenRestoreAfterZapCallback(TimerHandle_t xTimer)
{
Serial.println("Restoring screen after zap");
int screenBeforeZap = (int)(uintptr_t)pvTimerGetTimerID(xTimer);
ScreenHandler::setCurrentScreen(screenBeforeZap);
xTimerDelete(xTimer, 0);
}
void setupNostrNotify(bool asDatasource, bool zapNotify)
{
nostr::esp32::ESP32Platform::initNostr(false);
@ -296,13 +288,12 @@ void handleNostrZapCallback(const String &subId, nostr::SignedNostrEvent *event)
}
uint64_t timerPeriod = 0;
int screenBeforeZap = ScreenHandler::getCurrentScreen();
if (isTimerActive())
{
// store timer periode before making inactive to prevent artifacts
timerPeriod = getTimerSeconds();
esp_timer_stop(screenRotateTimer);
}
}
ScreenHandler::setCurrentScreen(SCREEN_CUSTOM);
EPDManager::getInstance().setContent(textEpdContent);
@ -315,10 +306,6 @@ void handleNostrZapCallback(const String &subId, nostr::SignedNostrEvent *event)
{
esp_timer_start_periodic(screenRotateTimer,
timerPeriod * usPerSecond);
} else if (preferences.getBool("scrnRestoreZap", DEFAULT_SCREEN_RESTORE_AFTER_ZAP)) {
TimerHandle_t screenRestoreAfterZapTimer = xTimerCreate("screenRestoreAfterZap", pdMS_TO_TICKS(getTimerSeconds() * msPerSecond), pdFALSE, (void*)(uintptr_t)screenBeforeZap, screenRestoreAfterZapCallback);
Serial.println("Starting screen restore after zap");
xTimerStart(screenRestoreAfterZapTimer, 0);
}
}

View File

@ -66,7 +66,6 @@ const PROGMEM int screens[SCREEN_COUNT] = {
SCREEN_BLOCK_FEE_RATE};
const int usPerSecond = 1000000;
const int usPerMinute = 60 * usPerSecond;
const int msPerSecond = 1000;
// extern const char *github_root_ca;
// extern const char *isrg_root_x1cert;

View File

@ -18,7 +18,7 @@ static const char *const PROGMEM boolSettings[] = {"ledTestOnPower", "ledFlashOn
"mempoolSecure", "bitaxeEnabled",
"miningPoolStats", "verticalDesc",
"nostrZapNotify", "httpAuthEnabled",
"enableDebugLog", "ceDisableSSL", "dndEnabled", "dndTimeBasedEnabled", "scrnRestoreZap"};
"enableDebugLog", "ceDisableSSL", "dndEnabled", "dndTimeBasedEnabled"};
AsyncWebServer server(80);
AsyncEventSource events("/events");
@ -717,7 +717,6 @@ void onApiSettingsGet(AsyncWebServerRequest *request)
root["nostrZapNotify"] = preferences.getBool("nostrZapNotify", DEFAULT_ZAP_NOTIFY_ENABLED);
root["nostrZapPubkey"] = preferences.getString("nostrZapPubkey", DEFAULT_ZAP_NOTIFY_PUBKEY);
root["ledFlashOnZap"] = preferences.getBool("ledFlashOnZap", DEFAULT_LED_FLASH_ON_ZAP);
root["scrnRestoreZap"] = preferences.getBool("scrnRestoreZap", DEFAULT_SCREEN_RESTORE_AFTER_ZAP);
root["fontName"] = preferences.getString("fontName", DEFAULT_FONT_NAME);
root["availableFonts"] = FontNames::getAvailableFonts();
// Custom endpoint settings (only used for CUSTOM_SOURCE)