Events: Complete UI events implementation

replace/6c34aa8dbb4bb0e37ff7de5b1740a9c282295bb3
Federico Amedeo Izzo 2020-12-06 08:46:12 +01:00
rodzic 014262f4df
commit 0fb3493bef
3 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -43,7 +43,7 @@ void create_threads();
/**
* Stack size for state update task, in bytes.
*/
#define STATE_TASK_STKSIZE 128*4
#define STATE_TASK_STKSIZE 256*4
/**
* Stack size for baseband control task, in bytes.

Wyświetl plik

@ -101,6 +101,11 @@ static void ui_task(void *arg)
state_t last_state = state;
OSMutexPost(&state_mutex, OS_OPT_POST_NONE, &os_err);
// Initial GUI draw
ui_updateGUI(last_state);
gfx_render();
while(gfx_renderingInProgress());
while(1)
{
// Read from the keyboard queue (returns 0 if no message is present)
@ -175,6 +180,7 @@ static void state_task(void *arg)
while(1)
{
// Lock mutex and update internal state
OSMutexPend(&state_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
state.time = rtc_getTime();
@ -182,6 +188,13 @@ static void state_task(void *arg)
OSMutexPost(&state_mutex, OS_OPT_POST_NONE, &os_err);
// Signal state update to UI thread
event_t dev_msg;
dev_msg.type = EVENT_STATUS;
dev_msg.payload = 0;
OSQPost(&ui_queue, (void *)dev_msg.value, sizeof(event_t),
OS_OPT_POST_FIFO + OS_OPT_POST_NO_SCHED, &os_err);
// Execute state update thread every 1s
OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &os_err);
}

Wyświetl plik

@ -296,7 +296,7 @@ void ui_updateFSM(state_t last_state, event_t event)
(void) last_state;
// Process pressed keys
if(event.type = EVENT_KBD)
if(event.type == EVENT_KBD)
{
keyboard_t keys = event.payload;
// Temporary VFO controls