2026-04-10 10:40:28 +08:00
|
|
|
#ifndef BLINKY_ENCODER_EVENT_H_
|
|
|
|
|
#define BLINKY_ENCODER_EVENT_H_
|
|
|
|
|
|
|
|
|
|
#include <app_event_manager.h>
|
|
|
|
|
#include <app_event_manager_profiler_tracer.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct encoder_event {
|
|
|
|
|
struct app_event_header header;
|
|
|
|
|
int8_t detents;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
APP_EVENT_TYPE_DECLARE(encoder_event);
|
|
|
|
|
|
2026-04-14 16:42:04 +08:00
|
|
|
static inline void submit_encoder_event(int8_t detents)
|
|
|
|
|
{
|
|
|
|
|
struct encoder_event *event = new_encoder_event();
|
|
|
|
|
|
|
|
|
|
event->detents = detents;
|
|
|
|
|
APP_EVENT_SUBMIT(event);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-10 10:40:28 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* BLINKY_ENCODER_EVENT_H_ */
|