4141#include "supervisor/memory.h"
4242#include "supervisor/shared/tick.h"
4343
44- #include "esp_log.h"
45-
46- static const char * TAG = "CircuitPython" ;
47-
4844STATIC esp_timer_handle_t _tick_timer ;
4945
5046void tick_timer_cb (void * arg ) {
@@ -57,12 +53,8 @@ safe_mode_t port_init(void) {
5753 args .arg = NULL ;
5854 args .dispatch_method = ESP_TIMER_TASK ;
5955 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 );
6457 never_reset_module_internal_pins ();
65- ESP_EARLY_LOGW (TAG , "port init done" );
6658 return NO_SAFE_MODE ;
6759}
6860
@@ -109,12 +101,8 @@ uint32_t *port_stack_get_top(void) {
109101supervisor_allocation _fixed_stack ;
110102
111103supervisor_allocation * port_fixed_stack (void ) {
112-
113- ESP_EARLY_LOGW (TAG , "port fixed stack" );
114104 _fixed_stack .ptr = port_stack_get_limit ();
115- ESP_EARLY_LOGW (TAG , "got limit %p" , _fixed_stack .ptr );
116105 _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 );
118106 return & _fixed_stack ;
119107}
120108
@@ -139,10 +127,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) {
139127
140128// Enable 1/1024 second tick.
141129void 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 );
146131}
147132
148133// Disable 1/1024 second tick.
@@ -153,14 +138,12 @@ void port_disable_tick(void) {
153138TickType_t sleep_time_set ;
154139TickType_t sleep_time_duration ;
155140void port_interrupt_after_ticks (uint32_t ticks ) {
156- // ESP_EARLY_LOGW(TAG, "after ticks");
157141 sleep_time_set = xTaskGetTickCount ();
158142 sleep_time_duration = ticks / portTICK_PERIOD_MS ;
159143 // esp_sleep_enable_timer_wakeup(uint64_t time_in_us)
160144}
161145
162146void port_sleep_until_interrupt (void ) {
163- // ESP_EARLY_LOGW(TAG, "sleep until");
164147 // FreeRTOS delay here maybe.
165148 // Light sleep shuts down BLE and wifi.
166149 // esp_light_sleep_start()
@@ -174,8 +157,5 @@ void port_sleep_until_interrupt(void) {
174157// Wrap main in app_main that the IDF expects.
175158extern void main (void );
176159void app_main (void ) {
177- ESP_EARLY_LOGW (TAG , "Hello from CircuitPython" );
178- // ESP_LOGW(TAG, "Hello from CircuitPython");
179-
180160 main ();
181161}
0 commit comments