41
41
#include "supervisor/memory.h"
42
42
#include "supervisor/shared/tick.h"
43
43
44
- #include "esp_log.h"
45
-
46
- static const char * TAG = "CircuitPython" ;
47
-
48
44
STATIC esp_timer_handle_t _tick_timer ;
49
45
50
46
void tick_timer_cb (void * arg ) {
@@ -57,12 +53,8 @@ safe_mode_t port_init(void) {
57
53
args .arg = NULL ;
58
54
args .dispatch_method = ESP_TIMER_TASK ;
59
55
args .name = "CircuitPython Tick" ;
60
- esp_err_t result = esp_timer_create (& args , & _tick_timer );
61
- if (result != ESP_OK ) {
62
- ESP_EARLY_LOGE (TAG , "Unable to create tick timer." );
63
- }
56
+ esp_timer_create (& args , & _tick_timer );
64
57
never_reset_module_internal_pins ();
65
- ESP_EARLY_LOGW (TAG , "port init done" );
66
58
return NO_SAFE_MODE ;
67
59
}
68
60
@@ -109,12 +101,8 @@ uint32_t *port_stack_get_top(void) {
109
101
supervisor_allocation _fixed_stack ;
110
102
111
103
supervisor_allocation * port_fixed_stack (void ) {
112
-
113
- ESP_EARLY_LOGW (TAG , "port fixed stack" );
114
104
_fixed_stack .ptr = port_stack_get_limit ();
115
- ESP_EARLY_LOGW (TAG , "got limit %p" , _fixed_stack .ptr );
116
105
_fixed_stack .length = (port_stack_get_top () - port_stack_get_limit ()) * sizeof (uint32_t );
117
- ESP_EARLY_LOGW (TAG , "got length %d" , _fixed_stack .length );
118
106
return & _fixed_stack ;
119
107
}
120
108
@@ -139,10 +127,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) {
139
127
140
128
// Enable 1/1024 second tick.
141
129
void port_enable_tick (void ) {
142
- esp_err_t result = esp_timer_start_periodic (_tick_timer , 1000000 / 1024 );
143
- if (result != ESP_OK ) {
144
- ESP_EARLY_LOGE (TAG , "Unable to start tick timer." );
145
- }
130
+ esp_timer_start_periodic (_tick_timer , 1000000 / 1024 );
146
131
}
147
132
148
133
// Disable 1/1024 second tick.
@@ -153,14 +138,12 @@ void port_disable_tick(void) {
153
138
TickType_t sleep_time_set ;
154
139
TickType_t sleep_time_duration ;
155
140
void port_interrupt_after_ticks (uint32_t ticks ) {
156
- // ESP_EARLY_LOGW(TAG, "after ticks");
157
141
sleep_time_set = xTaskGetTickCount ();
158
142
sleep_time_duration = ticks / portTICK_PERIOD_MS ;
159
143
// esp_sleep_enable_timer_wakeup(uint64_t time_in_us)
160
144
}
161
145
162
146
void port_sleep_until_interrupt (void ) {
163
- // ESP_EARLY_LOGW(TAG, "sleep until");
164
147
// FreeRTOS delay here maybe.
165
148
// Light sleep shuts down BLE and wifi.
166
149
// esp_light_sleep_start()
@@ -174,8 +157,5 @@ void port_sleep_until_interrupt(void) {
174
157
// Wrap main in app_main that the IDF expects.
175
158
extern void main (void );
176
159
void app_main (void ) {
177
- ESP_EARLY_LOGW (TAG , "Hello from CircuitPython" );
178
- // ESP_LOGW(TAG, "Hello from CircuitPython");
179
-
180
160
main ();
181
161
}
0 commit comments