Replace base64 files with library. Major refactoring.
This commit is contained in:
@@ -12,13 +12,9 @@
|
||||
|
||||
#define EEPROM_SIZE (sizeof(EepromLayout_st) / sizeof(uint8_t))
|
||||
|
||||
#define BUILD_YEAR (__DATE__ + 7) /* Will expand to current year at compile time as string. */
|
||||
#define NTP_MININUM_RX_YEAR (atoi(BUILD_YEAR) - 1) /* Will expand to current year at compile time minus one. */
|
||||
#define NTP_MININUM_YEAR (1900) // NTP minimum year is 1900
|
||||
#define NTP_MAX_UPDATE_TIME_US (500000) // 500ms max update time
|
||||
#define NTP_NEXT_UPDATE_DELAY_US (10000000) // 10s delay time between updates
|
||||
#define NTP_WATCHDOG_COUNTER_INIT (30) // Watchdog value, count of retries before restart
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
// TYPEDEFS
|
||||
// ----------------------------------------------------------------------------------
|
||||
typedef struct
|
||||
{
|
||||
int start_hour;
|
||||
@@ -32,7 +28,7 @@ typedef struct
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
uint8_t alpha;
|
||||
uint8_t alpha; // note: unused
|
||||
} Color_st;
|
||||
|
||||
typedef struct
|
||||
@@ -62,12 +58,16 @@ typedef enum
|
||||
NUM_STATES
|
||||
} ClockState_en;
|
||||
|
||||
bool get_ntp_time(uint32 usec);
|
||||
// ----------------------------------------------------------------------------------
|
||||
// FUNCTIONS DECLARATIONS
|
||||
// ----------------------------------------------------------------------------------
|
||||
bool get_ntp_time(uint32 timeout);
|
||||
String leading_zero2digit(int value);
|
||||
uint8_t calculate_dynamic_brightness(uint8_t min_brightness, uint8_t max_brightness, int hours, int minutes, bool summertime);
|
||||
uint8_t update_brightness(void);
|
||||
void check_night_mode(void);
|
||||
void check_wifi_status(void);
|
||||
void cold_start_setup(void);
|
||||
void draw_main_color(void);
|
||||
void handle_button(void);
|
||||
void handle_command(void);
|
||||
@@ -75,6 +75,7 @@ void handle_current_state(void);
|
||||
void handle_data_request(void);
|
||||
void handle_led_direct(void);
|
||||
void limit_value_ranges(void);
|
||||
void log_data(void);
|
||||
void log_time(tm local_time);
|
||||
void ntp_time_update(uint32 max_update_time);
|
||||
void on_state_entry(uint8_t state);
|
||||
|
||||
Reference in New Issue
Block a user