mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
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>
This commit is contained in:
committed by
Damien George
parent
521b2f86be
commit
604cda5d54
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user