This commit is contained in:
kraus
2021-09-01 22:01:29 +02:00
parent 6eb5b91a7d
commit 9047ffabf0
5 changed files with 59 additions and 20 deletions
@@ -305,8 +305,7 @@ uint8_t number_input = 2; // variable where the user can input a number be
uint8_t exit_code = 0; // return value from the menu system
extern "C" uint8_t mui_style_helv_r_08(mui_t *ui, uint8_t msg)
{
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
switch(msg)
{
@@ -412,8 +411,7 @@ long milliseconds = 0;
void loop(void) {
/* check whether the menu is active */
if ( mui.isFormActive() )
{
if ( mui.isFormActive() ) {
/* if so, then draw the menu */
if ( is_redraw ) {
@@ -444,19 +442,14 @@ void loop(void) {
if ( mui.isFormActive() )
milliseconds = ((long)number_input) * 1000;
}
else
{
} else {
/* menu not active: show countdown */
if ( milliseconds <= 0 )
{
if ( milliseconds <= 0 ) {
/* countdown reached 0: activate menu again */
mui.gotoForm(/* form_id= */ 1, /* initial_cursor_position= */ 0);
}
else
{
} else {
/* execute countdown */
u8g2.setFont(U8G2_FONT);
u8g2.firstPage();
@@ -467,9 +460,7 @@ void loop(void) {
milliseconds -= 100;
delay(100);
}
}
}
+14 -4
View File
@@ -58,6 +58,7 @@ uint8_t my_value3 = 0;
uint8_t color_input = 0;
uint8_t checkbox_input = 0;
uint8_t direction_input = 0;
uint8_t exit_code = 0;
/*
@@ -113,8 +114,11 @@ muif_t muif_list[] = {
MUIF(".L",0,0,mui_label_u8g2),
/* button for the minimal example */
MUIF("BN", MUIF_CFLAG_IS_CURSOR_SELECTABLE, 0, mui_leave_menu_frame_button_invers_select_u8g2)
MUIF("BN", MUIF_CFLAG_IS_CURSOR_SELECTABLE, 0, mui_leave_menu_frame_button_invers_select_u8g2),
/* Leave the menu system */
MUIF("LV",MUIF_CFLAG_IS_CURSOR_SELECTABLE,&exit_code,mui_leave_menu_frame_button_invers_select_u8g2)
};
/*
@@ -218,6 +222,13 @@ MUI_FORM(200)
MUI_STYLE(0)
MUI_XYT("BN",64, 30, " Select Me ")
MUI_FORM(201)
MUI_STYLE(0)
MUI_LABEL(5,12, "Countdown Time")
MUI_LABEL(5,30, "Seconds:")
MUI_XY("IN",60, 30)
MUI_XYT("LV",64, 59, " OK ")
;
int screenshot_n = 0;
@@ -252,11 +263,10 @@ int main(void)
u8x8_ConnectBitmapToU8x8(u8g2_GetU8x8(&u8g2)); /* connect to bitmap */
mui_Init(&ui, &u8g2, fds, muif_list, sizeof(muif_list)/sizeof(muif_t));
mui_GotoForm(&ui, 200, 0);
mui_GotoForm(&ui, 201, 0);
//puts(fds);
x = 4; // use as height for the box
y = 0;
+20 -1
View File
@@ -172,8 +172,27 @@ STARTCHAR 054
ENCODING 54
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
BBX 8 19 0 0
BITMAP
3C
FF
81
81
81
89
89
99
99
BD
BD
99
99
91
91
81
81
81
FF
ENDCHAR
STARTCHAR 055
ENCODING 55
Binary file not shown.
+20 -1
View File
@@ -172,8 +172,27 @@ STARTCHAR 054
ENCODING 54
SWIDTH 648 0
DWIDTH 9 0
BBX 0 0 0 0
BBX 8 19 0 0
BITMAP
3C
FF
81
81
81
89
89
99
99
BD
BD
99
99
91
91
81
81
81
FF
ENDCHAR
STARTCHAR 055
ENCODING 55