mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
move sleep init at the very end of boot (all must be initialized)
This commit is contained in:
@@ -173,7 +173,7 @@ static void sleep_battery(float level, int cells) {
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void sleep_init(void) {
|
void services_sleep_init(void) {
|
||||||
char *config = config_alloc_get(NVS_TYPE_STR, "sleep_config");
|
char *config = config_alloc_get(NVS_TYPE_STR, "sleep_config");
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@@ -416,5 +416,4 @@ void services_init(void) {
|
|||||||
led_svc_init();
|
led_svc_init();
|
||||||
battery_svc_init();
|
battery_svc_init();
|
||||||
monitor_svc_init();
|
monitor_svc_init();
|
||||||
sleep_init();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ typedef enum { SLEEP_ONTIMER, SLEEP_ONKEY, SLEEP_ONGPIO, SLEEP_ONIR, SLEEP_ONBAT
|
|||||||
void services_sleep_activate(sleep_cause_e cause);
|
void services_sleep_activate(sleep_cause_e cause);
|
||||||
void services_sleep_setsuspend(void (*hook)(void));
|
void services_sleep_setsuspend(void (*hook)(void));
|
||||||
void services_sleep_setsleeper(uint32_t (*sleeper)(void));
|
void services_sleep_setsleeper(uint32_t (*sleeper)(void));
|
||||||
|
void services_sleep_init(void);
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ static bool bNetworkConnected=false;
|
|||||||
|
|
||||||
// as an exception _init function don't need include
|
// as an exception _init function don't need include
|
||||||
extern void services_init(void);
|
extern void services_init(void);
|
||||||
|
extern void services_sleep_init(void);
|
||||||
extern void display_init(char *welcome);
|
extern void display_init(char *welcome);
|
||||||
extern void led_vu_init(void);
|
extern void led_vu_init(void);
|
||||||
extern void target_init(char *target);
|
extern void target_init(char *target);
|
||||||
@@ -463,5 +464,6 @@ void app_main()
|
|||||||
}
|
}
|
||||||
free(fwurl);
|
free(fwurl);
|
||||||
}
|
}
|
||||||
|
services_sleep_init();
|
||||||
messaging_post_message(MESSAGING_INFO,MESSAGING_CLASS_SYSTEM,"System started");
|
messaging_post_message(MESSAGING_INFO,MESSAGING_CLASS_SYSTEM,"System started");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user