33 #include "LLUI_INPUT_impl.h" 36 #include "microui_event_decoder.h" 42 #ifdef MICROUIEVENTDECODER_ENABLED 51 #define QUEUE_LOG_MAX_SIZE 100 60 static MICROUI_EVENT_DECODER_decode_event_data fct_decode_data;
65 static uint8_t queue_log[QUEUE_LOG_MAX_SIZE];
70 static bool queue_is_first_element;
75 static uint32_t dump_current_event;
81 void LLUI_INPUT_IMPL_log_queue_init(uint32_t length) {
82 assert(length <= (uint32_t)QUEUE_LOG_MAX_SIZE);
83 (void)memset((
void*)queue_log, 0, length);
84 queue_is_first_element =
true;
87 void LLUI_INPUT_IMPL_log_queue_full(uint32_t data) {
92 void LLUI_INPUT_IMPL_log_queue_add(uint32_t data, uint32_t index, uint32_t remaining_elements, uint32_t queue_length) {
96 if (queue_is_first_element) {
98 queue_log[index] = (uint8_t)(remaining_elements + (uint32_t)1);
102 queue_log[index] = 0;
106 queue_is_first_element = remaining_elements == (uint32_t)0;
109 void LLUI_INPUT_IMPL_log_queue_replace(uint32_t old, uint32_t data, uint32_t index, uint32_t queue_length) {
117 void LLUI_INPUT_IMPL_log_queue_read(uint32_t data, uint32_t index) {
123 void LLUI_INPUT_IMPL_log_dump(
bool log_type, uint32_t log, uint32_t index) {
127 if ((uint32_t)0 != queue_log[index]) {
129 dump_current_event = log;
132 fct_decode_data = NULL;
135 MICROUI_EVENT_DECODER_decode_event(log, index, &fct_decode_data);
137 else if (NULL != fct_decode_data) {
139 fct_decode_data(dump_current_event, log, index);
143 MICROUI_EVENT_DECODER_drop_data(log, index);
153 MICROUI_EVENT_DECODER_describe_dump_start();
154 MICROUI_EVENT_DECODER_describe_dump_past();
157 fct_decode_data = NULL;
162 MICROUI_EVENT_DECODER_describe_dump_future();
167 MICROUI_EVENT_DECODER_describe_dump_events_objects();
173 MICROUI_EVENT_DECODER_describe_dump_end();
179 #endif // MICROUIEVENTDECODER_ENABLED