1
1
/*
2
- * core .c
2
+ * os .c
3
3
*
4
4
* Created on: 2018-03-04 20:07
5
5
* Author: Jack Chen <[email protected] >
12
12
#include "freertos/event_groups.h"
13
13
#include "freertos/task.h"
14
14
15
- #include "os/core.h"
16
- #include "os/firmware.h"
15
+ #include "core/os.h"
17
16
#include "user/audio_mp3.h"
18
17
19
- #define OS_CORE_TAG "os_core"
20
- #define OS_POWER_TAG "os_power"
18
+ #define TAG "os"
21
19
22
20
EventGroupHandle_t user_event_group ;
23
21
24
22
#ifdef CONFIG_ENABLE_WAKEUP_KEY
25
23
void os_enter_sleep_mode (void )
26
24
{
27
- ESP_LOGI (OS_POWER_TAG , "entering sleep mode" );
25
+ ESP_LOGI (TAG , "entering sleep mode" );
28
26
29
27
#ifdef CONFIG_WAKEUP_KEY_ACTIVE_LOW
30
28
esp_sleep_enable_ext1_wakeup (1ULL << CONFIG_WAKEUP_KEY_PIN , ESP_EXT1_WAKEUP_ALL_LOW );
@@ -36,12 +34,10 @@ void os_enter_sleep_mode(void)
36
34
}
37
35
#endif // CONFIG_ENABLE_WAKEUP_KEY
38
36
39
- void os_core_init (void )
37
+ void os_init (void )
40
38
{
41
- ESP_LOGW (OS_CORE_TAG , "current firmware version is %s" , os_firmware_get_version ());
42
-
43
39
#ifdef CONFIG_ENABLE_WAKEUP_KEY
44
- ESP_LOGI (OS_POWER_TAG , "checking wakeup cause" );
40
+ ESP_LOGI (TAG , "checking wakeup cause" );
45
41
if (esp_sleep_get_wakeup_cause () != ESP_SLEEP_WAKEUP_UNDEFINED ) {
46
42
vTaskDelay (CONFIG_WAKEUP_KEY_EXTRA_HOLD_TIME / portTICK_RATE_MS );
47
43
@@ -50,9 +46,9 @@ void os_core_init(void)
50
46
#else
51
47
if (gpio_get_level (CONFIG_WAKEUP_KEY_PIN ) == 1 ) {
52
48
#endif
53
- ESP_LOGI (OS_POWER_TAG , "resuming from sleep mode" );
49
+ ESP_LOGI (TAG , "resuming from sleep mode" );
54
50
} else {
55
- ESP_LOGI (OS_POWER_TAG , "resume aborted" );
51
+ ESP_LOGI (TAG , "resume aborted" );
56
52
57
53
os_enter_sleep_mode ();
58
54
}
0 commit comments