parent
149a116ef7
commit
2eefdf6325
@ -0,0 +1,21 @@ |
||||
/**
|
||||
* TODO file description |
||||
*/ |
||||
|
||||
#include "app_config.h" |
||||
|
||||
// TODO sensible defaults, loading and saving to/from EE
|
||||
struct AppConfig app_config = { |
||||
.circuit_base_time_s = 10, // for a test
|
||||
.circuit_time_percent = {30, 60, 90, 100}, // for a test
|
||||
.schedules = { |
||||
{6, 45}, |
||||
{255, 0}, |
||||
{255, 0}, |
||||
{255, 0} |
||||
}, |
||||
.moisture_enable = true, |
||||
.moisture_dry = 2800, |
||||
.moisture_wet = 1600, |
||||
.moisture_threshold_percent = 70, |
||||
}; |
@ -0,0 +1,33 @@ |
||||
/**
|
||||
* TODO file description |
||||
*/ |
||||
|
||||
#ifndef ZAVLAHA_APP_CONFIG_H |
||||
#define ZAVLAHA_APP_CONFIG_H |
||||
|
||||
#include <stdint.h> |
||||
#include <stdbool.h> |
||||
|
||||
#define CIRCUIT_COUNT 4 |
||||
#define SCHEDULE_COUNT 4 |
||||
|
||||
#define UNUSED_SCHEDULE_HOUR 0xFF |
||||
|
||||
struct ScheduleTime { |
||||
uint8_t h; |
||||
uint8_t m; |
||||
}; |
||||
|
||||
struct AppConfig { |
||||
uint16_t circuit_base_time_s; |
||||
uint8_t circuit_time_percent[CIRCUIT_COUNT]; // 0% can be used to disable a branch
|
||||
struct ScheduleTime schedules[SCHEDULE_COUNT]; // 0xFF hour is used to disable the slot
|
||||
bool moisture_enable; |
||||
uint16_t moisture_dry; |
||||
uint16_t moisture_wet; |
||||
uint8_t moisture_threshold_percent; |
||||
}; |
||||
|
||||
extern struct AppConfig app_config; |
||||
|
||||
#endif //ZAVLAHA_APP_CONFIG_H
|
@ -0,0 +1,37 @@ |
||||
/**
|
||||
* Zavlahovy cuklus |
||||
*/ |
||||
//
|
||||
// Created by MightyPork on 2023/04/09.
|
||||
//
|
||||
|
||||
#include <stdio.h> |
||||
#include <string.h> |
||||
#include "app_gui.h" |
||||
#include "gui_event.h" |
||||
#include "ds_rtc.h" |
||||
#include "app_io.h" |
||||
|
||||
|
||||
void screen_cyklus(GuiEvent event) |
||||
{ |
||||
uint32_t now = timestamp(); |
||||
|
||||
switch (event) { |
||||
case GUI_EVENT_SCREEN_INIT: |
||||
case GUI_EVENT_SCREEN_TICK: |
||||
//
|
||||
break; |
||||
|
||||
case GUI_EVENT_PAINT: |
||||
LcdBuffer_Write(&lcd, 0, 0, "==ZÁVLAHOVÝ CYKLUS=="); |
||||
LcdBuffer_Write(&lcd, 1, 0, "Okruh 2/4 30/200s"); |
||||
LcdBuffer_Write(&lcd, 2, 0, "█████████▌"); |
||||
LcdBuffer_Write(&lcd, 3, 0, "🅳 Přerušit"); |
||||
break; |
||||
|
||||
case GUI_EVENT_KEY_D: |
||||
switch_screen(screen_home, true); |
||||
return; |
||||
} |
||||
} |
Loading…
Reference in new issue