54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
#ifndef WORDCLOCK_ESP8266_H
|
|
#define WORDCLOCK_ESP8266_H
|
|
|
|
#include <Arduino.h>
|
|
#include <ESP8266WebServer.h>
|
|
#include "led_matrix.h"
|
|
#include "udp_logger.h"
|
|
|
|
extern UDPLogger logger;
|
|
extern LEDMatrix led_matrix;
|
|
extern ESP8266WebServer webserver;
|
|
|
|
typedef struct
|
|
{
|
|
int start_hour;
|
|
int start_min;
|
|
int end_hour;
|
|
int end_min;
|
|
} NightModeTimes_st;
|
|
|
|
typedef enum
|
|
{
|
|
ST_CLOCK,
|
|
ST_DICLOCK,
|
|
ST_SPIRAL,
|
|
ST_TETRIS,
|
|
ST_SNAKE,
|
|
ST_PINGPONG,
|
|
ST_HEARTS,
|
|
NUM_STATES
|
|
} ClockState_en;
|
|
|
|
int EEPROM_read_address(int address);
|
|
String leading_zero2digit(int value);
|
|
void check_night_mode(void);
|
|
void check_wifi_status(void);
|
|
void EEPROM_write_to_address(int address, int value);
|
|
void handle_button(void);
|
|
void handle_command(void);
|
|
void handle_current_state(void);
|
|
void handle_data_request(void);
|
|
void handle_led_direct(void);
|
|
void load_main_color(void);
|
|
void ntp_time_update(uint32 *last_ntp_update_us);
|
|
void on_state_entry(uint8_t state);
|
|
void send_heartbeat(void);
|
|
void set_main_color(uint8_t red, uint8_t green, uint8_t blue);
|
|
void set_night_mode(bool on);
|
|
void state_change(uint8_t newState);
|
|
void update_matrix(void);
|
|
void update_state_machine(void);
|
|
|
|
#endif /* WORDCLOCK_ESP8266_H */
|