Skip to content

Commit 7f6bef3

Browse files
committed
Remove debug prints
1 parent 0874963 commit 7f6bef3

File tree

2 files changed

+15
-45
lines changed

2 files changed

+15
-45
lines changed

ports/esp32s2/supervisor/internal_flash.c

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@
3939

4040
#include "esp-idf/components/spi_flash/include/esp_partition.h"
4141

42-
#include "esp_log.h"
43-
44-
45-
static const char* TAG = "CircuitPython Internal Flash";
46-
4742
#include "supervisor/usb.h"
4843

4944
STATIC const esp_partition_t * _partition;
@@ -52,8 +47,6 @@ void supervisor_flash_init(void) {
5247
_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA,
5348
ESP_PARTITION_SUBTYPE_DATA_FAT,
5449
NULL);
55-
56-
ESP_EARLY_LOGW(TAG, "fatfs partition %p", _partition);
5750
}
5851

5952
uint32_t supervisor_flash_get_block_size(void) {
@@ -74,11 +67,10 @@ STATIC uint8_t _cache[SECTOR_SIZE];
7467
STATIC uint32_t _cache_lba;
7568

7669
mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) {
77-
esp_err_t ok = esp_partition_read(_partition,
78-
block * FILESYSTEM_BLOCK_SIZE,
79-
dest,
80-
num_blocks * FILESYSTEM_BLOCK_SIZE);
81-
ESP_EARLY_LOGW(TAG, "read %d", ok);
70+
esp_partition_read(_partition,
71+
block * FILESYSTEM_BLOCK_SIZE,
72+
dest,
73+
num_blocks * FILESYSTEM_BLOCK_SIZE);
8274
return 0;
8375
}
8476

@@ -90,13 +82,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32
9082
uint32_t sector_offset = block_address / blocks_per_sector * SECTOR_SIZE;
9183
uint8_t block_offset = block_address % blocks_per_sector;
9284

93-
esp_err_t result;
9485
if (_cache_lba != block_address) {
95-
result = esp_partition_read(_partition,
96-
sector_offset,
97-
_cache,
98-
SECTOR_SIZE);
99-
ESP_EARLY_LOGW(TAG, "flash read before write %d", result);
86+
esp_partition_read(_partition,
87+
sector_offset,
88+
_cache,
89+
SECTOR_SIZE);
10090
_cache_lba = sector_offset;
10191
}
10292
for (uint8_t b = block_offset; b < blocks_per_sector; b++) {
@@ -109,11 +99,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32
10999
FILESYSTEM_BLOCK_SIZE);
110100
block++;
111101
}
112-
result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE);
113-
result = esp_partition_write(_partition,
114-
sector_offset,
115-
_cache,
116-
SECTOR_SIZE);
102+
esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE);
103+
esp_partition_write(_partition,
104+
sector_offset,
105+
_cache,
106+
SECTOR_SIZE);
117107
}
118108

119109
return 0; // success

ports/esp32s2/supervisor/port.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
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-
4844
STATIC esp_timer_handle_t _tick_timer;
4945

5046
void 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) {
109101
supervisor_allocation _fixed_stack;
110102

111103
supervisor_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.
141129
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);
146131
}
147132

148133
// Disable 1/1024 second tick.
@@ -153,14 +138,12 @@ void port_disable_tick(void) {
153138
TickType_t sleep_time_set;
154139
TickType_t sleep_time_duration;
155140
void 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

162146
void 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.
175158
extern void main(void);
176159
void 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

Comments
 (0)