-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_mesg.h
33 lines (30 loc) · 1.53 KB
/
page_mesg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------
static bool mesg_page_action_handler__enter (void) {
display_content_clear (corners_screen);
display_content_mesg (cond_value__mesg [0] != '\0' ? cond_value__mesg : "no message", "");
return true;
}
static bool mesg_page_action_handler__leave (void) {
if (cond_value__warn)
console_send (command__ack_warn);
return display_content_clear (corners_screen);
}
static uint32_t __mesg_exceeded = 0;
static bool mesg_page_action_handler__timer (uint32_t interval) {
if (__exceeded (&__mesg_exceeded, MESG_PAGE_TIMEOUT, interval))
return page_change (&page_definition_home);
return false;
}
static bool mesg_page_button_handler__close (void) {
return page_change (&page_definition_home);
}
static const page_definition_t page_definition_mesg = {
"mesg", false,
{ { NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL } },
mesg_page_action_handler__enter, mesg_page_action_handler__leave, mesg_page_button_handler__close, mesg_page_action_handler__timer,
NULL
};
// ------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------