mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-24 11:14:26 +03:00
GUI: osWaitForeverfor in queue put, simplify osMessageQueueGet.
This commit is contained in:
parent
d80e22a6c6
commit
d715767cef
@ -19,7 +19,7 @@ void gui_event_input_events_callback(const void* value, size_t size, void* ctx)
|
|||||||
message.type = GuiMessageTypeInput;
|
message.type = GuiMessageTypeInput;
|
||||||
message.input = *(InputEvent*)value;
|
message.input = *(InputEvent*)value;
|
||||||
|
|
||||||
osMessageQueuePut(gui_event->mqueue, &message, 0, 0);
|
osMessageQueuePut(gui_event->mqueue, &message, 0, osWaitForever);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiEvent* gui_event_alloc() {
|
GuiEvent* gui_event_alloc() {
|
||||||
@ -67,8 +67,7 @@ GuiMessage gui_event_message_next(GuiEvent* gui_event) {
|
|||||||
assert(gui_event);
|
assert(gui_event);
|
||||||
GuiMessage message;
|
GuiMessage message;
|
||||||
gui_event_unlock(gui_event);
|
gui_event_unlock(gui_event);
|
||||||
while(osMessageQueueGet(gui_event->mqueue, &message, NULL, osWaitForever) != osOK) {
|
assert(osMessageQueueGet(gui_event->mqueue, &message, NULL, osWaitForever) == osOK);
|
||||||
};
|
|
||||||
gui_event_lock(gui_event);
|
gui_event_lock(gui_event);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user