diff options
| author | Angus Gratton <angus@redyak.com.au> | 2025-11-21 16:28:11 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-30 23:18:57 +1100 |
| commit | 604cda5d545564523c4deaedb2e93a464e3dcf8f (patch) | |
| tree | 41a2a459b44a45e351db21e06fa7e10fe3e9f7ff /ports/esp32/main.c | |
| parent | 521b2f86bede90f5f30b6c9ce6a75e987a5f021d (diff) | |
esp32: Support building with network and/or bluetooth disabled.
(and a smaller binary size as a result)
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'ports/esp32/main.c')
| -rw-r--r-- | ports/esp32/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ports/esp32/main.c b/ports/esp32/main.c index 41eea29b0..7460bf359 100644 --- a/ports/esp32/main.c +++ b/ports/esp32/main.c @@ -90,7 +90,8 @@ int vprintf_null(const char *format, va_list ap) { return 0; } -time_t platform_mbedtls_time(time_t *timer) { +#if MICROPY_SSL_MBEDTLS +static time_t platform_mbedtls_time(time_t *timer) { // mbedtls_time requires time in seconds from EPOCH 1970 struct timeval tv; @@ -98,6 +99,7 @@ time_t platform_mbedtls_time(time_t *timer) { return tv.tv_sec + TIMEUTILS_SECONDS_1970_TO_2000; } +#endif void mp_task(void *pvParameter) { volatile uint32_t sp = (uint32_t)esp_cpu_get_sp(); @@ -114,8 +116,10 @@ void mp_task(void *pvParameter) { #endif machine_init(); + #if MICROPY_SSL_MBEDTLS // Configure time function, for mbedtls certificate time validation. mbedtls_platform_set_time(platform_mbedtls_time); + #endif esp_err_t err = esp_event_loop_create_default(); if (err != ESP_OK) { |
