You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
zavlaha-kzk/src/screens/screen_home.c

54 lines
1.3 KiB

/**
* TODO file description
*/
//
// Created by MightyPork on 2023/04/09.
//
#include <stdio.h>
#include <string.h>
#include "app_gui.h"
#include "gui_event.h"
#include "app_io.h"
#include "app_config.h"
static uint16_t moisture_pt = 0;
void screen_home(GuiEvent event)
{
switch (event) {
case GUI_EVENT_SCREEN_INIT:
// pass
case GUI_EVENT_SCREEN_TICK_100MS:
moisture_pt = moisture_convert(moisture_read());
request_paint();
break;
case GUI_EVENT_PAINT:
sprintf(sbuf, " %2d:%02d:%02d %3d%% 🌢 ",
s_app.rtc_time.hour,
s_app.rtc_time.minute,
s_app.rtc_time.second,
moisture_pt);
LcdBuffer_Write(&lcd, 0, 0, sbuf);
LcdBuffer_Write(&lcd, 1, 0, "Plán. závlaha 7:15");
LcdBuffer_Write(&lcd, 2, 0, "❶Spustit ❷Přeskočit");
LcdBuffer_Write(&lcd, 3, 0, "🅰Nastavení");
break;
case GUI_EVENT_KEY_1:
// TODO
switch_screen(screen_cyklus, true); // fake cycle
break;
case GUI_EVENT_KEY_2:
// TODO
break;
case GUI_EVENT_KEY_A:
switch_screen(screen_settings, true);
break;
}
}