42 lines
844 B
C
42 lines
844 B
C
|
|
#ifndef BLINKY_FUNCTION_BITMAP_STATE_EVENT_H_
|
||
|
|
#define BLINKY_FUNCTION_BITMAP_STATE_EVENT_H_
|
||
|
|
|
||
|
|
#include <errno.h>
|
||
|
|
#include <string.h>
|
||
|
|
|
||
|
|
#include <app_event_manager.h>
|
||
|
|
#include <app_event_manager_profiler_tracer.h>
|
||
|
|
|
||
|
|
#include "keyboard_core.h"
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
struct function_bitmap_state_event {
|
||
|
|
struct app_event_header header;
|
||
|
|
uint8_t bitmap[KEYBOARD_PROTOCOL_BITMAP_BYTES];
|
||
|
|
};
|
||
|
|
|
||
|
|
APP_EVENT_TYPE_DECLARE(function_bitmap_state_event);
|
||
|
|
|
||
|
|
static inline int submit_function_bitmap_state_event(const uint8_t *bitmap)
|
||
|
|
{
|
||
|
|
struct function_bitmap_state_event *event;
|
||
|
|
|
||
|
|
if (bitmap == NULL) {
|
||
|
|
return -EINVAL;
|
||
|
|
}
|
||
|
|
|
||
|
|
event = new_function_bitmap_state_event();
|
||
|
|
memcpy(event->bitmap, bitmap, sizeof(event->bitmap));
|
||
|
|
APP_EVENT_SUBMIT(event);
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif /* BLINKY_FUNCTION_BITMAP_STATE_EVENT_H_ */
|