esp32-timed-switch/scheduler.h

96 lines
1.4 KiB
C
Raw Permalink Normal View History

2024-04-04 16:58:37 +00:00
#include <sys/_stdint.h>
2023-10-28 15:53:13 +00:00
#define A00 0b000000000000
#define A60 0b111111111111
#define HALF_HOUR 0b000000111111
#define EVERY_2 0b010101010101
#define EVERY_2_INV 0b101010101010
#define HOUR_DEFAULT 16
#define MINUTE_DEFAULT 41
#define EVENT_INC_MINUTE 5
// our scheduler loop every 24 hour.
// one hour is represented by 1 unsigned int
// each bit of the hour represent one BI_MINUTE.
// the output of the scheduler is ON if one bit is set, OFF otherwise.
2024-04-04 16:58:37 +00:00
uint16_t scheduler_1_default[24] = {
2023-10-28 15:53:13 +00:00
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
};
2024-04-04 16:58:37 +00:00
uint16_t scheduler_default_deactivate[24] = {
2024-01-27 18:15:53 +00:00
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
A00,
};
2024-04-04 16:58:37 +00:00
uint16_t scheduler_2_default[24] = {
2023-10-28 15:53:13 +00:00
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
EVERY_2,
EVERY_2_INV,
};