mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 15:47:39 +03:00
style: Apply clang-format to calendar mode files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
7e7c51949e
commit
7ebb3c84c5
@ -95,8 +95,8 @@ class CrossPointSettings {
|
||||
uint8_t longPressChapterSkip = 1;
|
||||
|
||||
// Calendar mode settings
|
||||
uint8_t calendarModeEnabled = 0; // 0 = disabled, 1 = enabled
|
||||
uint8_t calendarRefreshHours = 4; // Refresh interval in hours (1-24)
|
||||
uint8_t calendarModeEnabled = 0; // 0 = disabled, 1 = enabled
|
||||
uint8_t calendarRefreshHours = 4; // Refresh interval in hours (1-24)
|
||||
char calendarServerUrl[256] = ""; // URL to fetch BMP image from
|
||||
|
||||
~CrossPointSettings() = default;
|
||||
|
||||
@ -53,9 +53,7 @@ void CalendarActivity::startWifiConnection() {
|
||||
stateStartTime = millis();
|
||||
}
|
||||
|
||||
bool CalendarActivity::checkWifiConnection() {
|
||||
return WiFi.status() == WL_CONNECTED;
|
||||
}
|
||||
bool CalendarActivity::checkWifiConnection() { return WiFi.status() == WL_CONNECTED; }
|
||||
|
||||
bool CalendarActivity::fetchAndSaveImage() {
|
||||
Serial.printf("[%lu] [CAL] Fetching image from: %s\n", millis(), SETTINGS.calendarServerUrl);
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "../calendar/CalendarActivity.h"
|
||||
#include "CalibreSettingsActivity.h"
|
||||
#include "CrossPointSettings.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "OtaUpdateActivity.h"
|
||||
#include "fontIds.h"
|
||||
#include "../calendar/CalendarActivity.h"
|
||||
|
||||
// Define the static settings list
|
||||
namespace {
|
||||
@ -45,8 +45,7 @@ const SettingInfo settingsList[settingsCount] = {
|
||||
// Calendar mode settings
|
||||
SettingInfo::Toggle("Calendar Mode", &CrossPointSettings::calendarModeEnabled),
|
||||
SettingInfo::Value("Calendar Refresh (hrs)", &CrossPointSettings::calendarRefreshHours, {1, 24, 1}),
|
||||
SettingInfo::Action("Test Calendar Now"),
|
||||
SettingInfo::Action("Calibre Settings"),
|
||||
SettingInfo::Action("Test Calendar Now"), SettingInfo::Action("Calibre Settings"),
|
||||
SettingInfo::Action("Check for updates")};
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
#include <InputManager.h>
|
||||
#include <SDCardManager.h>
|
||||
#include <SPI.h>
|
||||
#include <WiFi.h>
|
||||
#include <builtinFonts/all.h>
|
||||
#include <esp_sleep.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -18,12 +18,12 @@
|
||||
#include "activities/boot_sleep/BootActivity.h"
|
||||
#include "activities/boot_sleep/SleepActivity.h"
|
||||
#include "activities/browser/OpdsBookBrowserActivity.h"
|
||||
#include "activities/calendar/CalendarActivity.h"
|
||||
#include "activities/home/HomeActivity.h"
|
||||
#include "activities/network/CrossPointWebServerActivity.h"
|
||||
#include "activities/reader/ReaderActivity.h"
|
||||
#include "activities/settings/SettingsActivity.h"
|
||||
#include "activities/util/FullScreenMessageActivity.h"
|
||||
#include "activities/calendar/CalendarActivity.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
#define SPI_FQ 40000000
|
||||
@ -335,8 +335,7 @@ void setup() {
|
||||
// Not a timer wake - check if we need a backup fetch
|
||||
time_t now;
|
||||
time(&now);
|
||||
uint32_t elapsed = (now > APP_STATE.lastCalendarFetch) ?
|
||||
(now - APP_STATE.lastCalendarFetch) : UINT32_MAX;
|
||||
uint32_t elapsed = (now > APP_STATE.lastCalendarFetch) ? (now - APP_STATE.lastCalendarFetch) : UINT32_MAX;
|
||||
uint32_t thresholdSec = SETTINGS.calendarRefreshHours * 3600;
|
||||
|
||||
// If time is valid and elapsed > threshold, trigger backup fetch
|
||||
|
||||
Loading…
Reference in New Issue
Block a user