summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/power.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-02-24 19:50:20 +0100
committerUros Majstorovic <majstor@majstor.org>2021-02-24 19:50:20 +0100
commit3050565531af2b3a09f2213893f10c64cf9fe43f (patch)
tree689d10ca064dba4480a85b6ec14a4eb8305d5c89 /fw/fe310/eos/power.c
parentd0a0fee0571be63f023f8f6a49a0b76b89871e56 (diff)
added test app with voice, wifi/cellular data connectivity examples
Diffstat (limited to 'fw/fe310/eos/power.c')
-rw-r--r--fw/fe310/eos/power.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fw/fe310/eos/power.c b/fw/fe310/eos/power.c
index 2b13c9f..8717553 100644
--- a/fw/fe310/eos/power.c
+++ b/fw/fe310/eos/power.c
@@ -18,7 +18,7 @@
static eos_evt_handler_t evt_handler[EOS_PWR_MAX_MTYPE];
static unsigned char power_btn_down;
-static void power_handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) {
+static void power_handle_msg(unsigned char type, unsigned char *buffer, uint16_t len) {
unsigned char mtype;
if ((buffer == NULL) || (len < 1)) {
@@ -53,7 +53,7 @@ void eos_power_init(void) {
for (i=0; i<EOS_PWR_MAX_MTYPE; i++) {
evt_handler[i] = NULL;
}
- eos_net_set_handler(EOS_NET_MTYPE_POWER, power_handle_evt);
+ eos_net_set_handler(EOS_NET_MTYPE_POWER, power_handle_msg);
eos_power_set_handler(EOS_PWR_MTYPE_BUTTON, power_handle_btn);
AON_REG(AON_PMUKEY) = 0x51F15E;
@@ -110,3 +110,8 @@ void eos_power_wake_disable(void) {
void eos_power_set_handler(unsigned char mtype, eos_evt_handler_t handler) {
if (mtype < EOS_PWR_MAX_MTYPE) evt_handler[mtype] = handler;
}
+
+eos_evt_handler_t eos_power_get_handler(unsigned char mtype) {
+ if (mtype < EOS_PWR_MAX_MTYPE) return evt_handler[mtype];
+ return NULL;
+}