26 #if defined(UI_FEATURE_EVENT_DECODER)
36 #include <LLUI_INPUT_impl.h>
39 #include "microui_event_decoder.h"
48 #define QUEUE_LOG_MAX_SIZE 100
57 static MICROUI_EVENT_DECODER_decode_event_data fct_decode_data;
62 static uint8_t queue_log[QUEUE_LOG_MAX_SIZE];
67 static bool queue_is_first_element;
72 static uint32_t dump_current_event;
78 void LLUI_INPUT_IMPL_log_queue_init(uint32_t length) {
79 assert(length <= (uint32_t)QUEUE_LOG_MAX_SIZE);
80 (void)memset((
void *)queue_log, 0, length);
81 queue_is_first_element =
true;
84 void LLUI_INPUT_IMPL_log_queue_full(uint32_t data) {
89 void LLUI_INPUT_IMPL_log_queue_add(uint32_t data, uint32_t index, uint32_t remaining_elements, uint32_t queue_length) {
93 if (queue_is_first_element) {
95 queue_log[index] = (uint8_t)(remaining_elements + (uint32_t)1);
102 queue_is_first_element = remaining_elements == (uint32_t)0;
105 void LLUI_INPUT_IMPL_log_queue_replace(uint32_t old, uint32_t data, uint32_t index, uint32_t queue_length) {
113 void LLUI_INPUT_IMPL_log_queue_read(uint32_t data, uint32_t index) {
119 void LLUI_INPUT_IMPL_log_dump(
bool log_type, uint32_t log, uint32_t index) {
123 if ((uint32_t)0 != queue_log[index]) {
125 dump_current_event = log;
128 fct_decode_data = NULL;
131 MICROUI_EVENT_DECODER_decode_event(log, index, &fct_decode_data);
132 }
else if (NULL != fct_decode_data) {
134 fct_decode_data(dump_current_event, log, index);
137 MICROUI_EVENT_DECODER_drop_data(log, index);
145 MICROUI_EVENT_DECODER_describe_dump_start();
146 MICROUI_EVENT_DECODER_describe_dump_past();
149 fct_decode_data = NULL;
154 MICROUI_EVENT_DECODER_describe_dump_future();
159 MICROUI_EVENT_DECODER_describe_dump_events_objects();
165 MICROUI_EVENT_DECODER_describe_dump_end();
MicroEJ MicroUI library low level API: enable some features according to the hardware capabilities.