- 添加KBD_LED_REPORT_WITH_ID_SIZE宏定义以支持带ID的LED报告 - 实现keyboard_handle_led_report函数来处理不同长度的LED报告 - 在keyboard_set_report中添加对HID_REPORT_TYPE_OUTPUT类型的支持 - 优化keyboard_output_report函数以复用LED报告处理逻辑 - 移除datetime_event中的INIT_LOG_ENABLE标志 支持处理长度为1字节或2字节(包含report ID)的键盘LED报告, 并提供适当的错误日志记录功能。
27 lines
644 B
C
27 lines
644 B
C
#include "datetime_event.h"
|
|
|
|
static void log_datetime_event(const struct app_event_header *aeh)
|
|
{
|
|
const struct datetime_event *event = cast_datetime_event(aeh);
|
|
|
|
APP_EVENT_MANAGER_LOG(aeh, "date:%s time:%s",
|
|
event->date_text, event->time_text);
|
|
}
|
|
|
|
static void profile_datetime_event(struct log_event_buf *buf,
|
|
const struct app_event_header *aeh)
|
|
{
|
|
ARG_UNUSED(buf);
|
|
ARG_UNUSED(aeh);
|
|
}
|
|
|
|
APP_EVENT_INFO_DEFINE(datetime_event,
|
|
ENCODE(),
|
|
ENCODE(),
|
|
profile_datetime_event);
|
|
|
|
APP_EVENT_TYPE_DEFINE(datetime_event,
|
|
log_datetime_event,
|
|
&datetime_event_info,
|
|
APP_EVENT_FLAGS_CREATE());
|