diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-09-04 20:51:36 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-09-04 20:51:36 +0200 |
commit | 16d2bc9cc097da10dcadd2fb7425e20da4834a3a (patch) | |
tree | 5f652d595dd5f2180468b1a639e9c1b743505f79 | |
parent | eef5b5504018cfef386dab7e088c12b619039413 (diff) |
power driver fix
-rw-r--r-- | fw/fe310/eos/net/pwr.c | 8 | ||||
-rw-r--r-- | fw/fe310/eos/soc/pwr.c | 13 | ||||
-rw-r--r-- | fw/fe310/eos/soc/pwr.h | 2 |
3 files changed, 9 insertions, 14 deletions
diff --git a/fw/fe310/eos/net/pwr.c b/fw/fe310/eos/net/pwr.c index 89f1817..308a05a 100644 --- a/fw/fe310/eos/net/pwr.c +++ b/fw/fe310/eos/net/pwr.c @@ -8,8 +8,10 @@ #include "soc/pwr.h" #include "soc/spi.h" #include "dev/spi.h" +#include "dev/net.h" #include "dev/lcd.h" #include "eve/eve.h" +#include "dev/flash.h" #include "pwr.h" @@ -51,7 +53,11 @@ static void pwr_handle_btn(unsigned char type, unsigned char *buffer, uint16_t l eos_spi_deselect(); } - rv = eos_pwr_sleep(); + rv = eos_net_sleep(1000); + + eos_flash_norm(); + + eos_pwr_sleep(); } void eos_pwr_net_init(void) { diff --git a/fw/fe310/eos/soc/pwr.c b/fw/fe310/eos/soc/pwr.c index 970db8b..db9f273 100644 --- a/fw/fe310/eos/soc/pwr.c +++ b/fw/fe310/eos/soc/pwr.c @@ -6,8 +6,6 @@ #include "eos.h" #include "timer.h" -#include "dev/flash.h" -#include "dev/net.h" #include "pwr.h" @@ -34,18 +32,9 @@ uint8_t eos_pwr_reset_cause(void) { return (AON_REG(AON_PMUCAUSE) >> 8) & 0xff; } -int eos_pwr_sleep(void) { - int rv; - - rv = eos_net_sleep(1000); - if (rv) return rv; - - eos_flash_norm(); - +void eos_pwr_sleep(void) { AON_REG(AON_PMUKEY) = 0x51F15E; AON_REG(AON_PMUSLEEP) = 1; - - return EOS_OK; } void eos_pwr_wake_at(uint32_t msec) { diff --git a/fw/fe310/eos/soc/pwr.h b/fw/fe310/eos/soc/pwr.h index 1a0d17a..0af4c1b 100644 --- a/fw/fe310/eos/soc/pwr.h +++ b/fw/fe310/eos/soc/pwr.h @@ -11,6 +11,6 @@ int eos_pwr_init(uint8_t wakeup_cause); uint8_t eos_pwr_wakeup_cause(void); uint8_t eos_pwr_reset_cause(void); -int eos_pwr_sleep(void); +void eos_pwr_sleep(void); void eos_pwr_wake_at(uint32_t msec); void eos_pwr_wake_disable(void); |