2026-04-10 19:28:20 +08:00
|
|
|
#ifndef BLINKY_BAT_STATE_EVENT_H_
|
|
|
|
|
#define BLINKY_BAT_STATE_EVENT_H_
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include <app_event_manager.h>
|
|
|
|
|
#include <app_event_manager_profiler_tracer.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct bat_state_event {
|
|
|
|
|
struct app_event_header header;
|
|
|
|
|
uint8_t soc;
|
|
|
|
|
bool charging;
|
|
|
|
|
bool full;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
APP_EVENT_TYPE_DECLARE(bat_state_event);
|
|
|
|
|
|
2026-04-14 16:42:04 +08:00
|
|
|
static inline void submit_bat_state_event(uint8_t soc, bool charging, bool full)
|
|
|
|
|
{
|
|
|
|
|
struct bat_state_event *event = new_bat_state_event();
|
|
|
|
|
|
|
|
|
|
event->soc = soc;
|
|
|
|
|
event->charging = charging;
|
|
|
|
|
event->full = full;
|
|
|
|
|
APP_EVENT_SUBMIT(event);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-10 19:28:20 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* BLINKY_BAT_STATE_EVENT_H_ */
|