kopia lustrzana https://github.com/OpenRTX/OpenRTX
Events: Complete UI events implementation
rodzic
014262f4df
commit
0fb3493bef
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue