32 #include <LLUI_INPUT_impl.h>
35 #include "microui_event_decoder.h"
37 #ifdef MICROUIEVENTDECODER_ENABLED
46 #define QUEUE_LOG_MAX_SIZE 100
55 static MICROUI_EVENT_DECODER_decode_event_data fct_decode_data;
60 static uint8_t queue_log[QUEUE_LOG_MAX_SIZE];
65 static bool queue_is_first_element;
70 static uint32_t dump_current_event;
76 void LLUI_INPUT_IMPL_log_queue_init(uint32_t length) {
77 assert(length <= (uint32_t)QUEUE_LOG_MAX_SIZE);
78 (void)memset((
void *)queue_log, 0, length);
79 queue_is_first_element =
true;
82 void LLUI_INPUT_IMPL_log_queue_full(uint32_t data) {
87 void LLUI_INPUT_IMPL_log_queue_add(uint32_t data, uint32_t index, uint32_t remaining_elements, uint32_t queue_length) {
91 if (queue_is_first_element) {
93 queue_log[index] = (uint8_t)(remaining_elements + (uint32_t)1);
100 queue_is_first_element = remaining_elements == (uint32_t)0;
103 void LLUI_INPUT_IMPL_log_queue_replace(uint32_t old, uint32_t data, uint32_t index, uint32_t queue_length) {
111 void LLUI_INPUT_IMPL_log_queue_read(uint32_t data, uint32_t index) {
117 void LLUI_INPUT_IMPL_log_dump(
bool log_type, uint32_t log, uint32_t index) {
121 if ((uint32_t)0 != queue_log[index]) {
123 dump_current_event = log;
126 fct_decode_data = NULL;
129 MICROUI_EVENT_DECODER_decode_event(log, index, &fct_decode_data);
130 }
else if (NULL != fct_decode_data) {
132 fct_decode_data(dump_current_event, log, index);
135 MICROUI_EVENT_DECODER_drop_data(log, index);
143 MICROUI_EVENT_DECODER_describe_dump_start();
144 MICROUI_EVENT_DECODER_describe_dump_past();
147 fct_decode_data = NULL;
152 MICROUI_EVENT_DECODER_describe_dump_future();
157 MICROUI_EVENT_DECODER_describe_dump_events_objects();
163 MICROUI_EVENT_DECODER_describe_dump_end();