From e62f59217bb1cbf2fd22ee942b284a4de3cc51ea Mon Sep 17 00:00:00 2001 From: Siarhei Farbotka Date: Tue, 11 Sep 2018 14:42:17 +0300 Subject: [PATCH] esp32: Fix int overflow in machine.sleep/deepsleep functions. --- ports/esp32/modmachine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32/modmachine.c b/ports/esp32/modmachine.c index 2d59e137ef..2b98376c4a 100644 --- a/ports/esp32/modmachine.c +++ b/ports/esp32/modmachine.c @@ -89,7 +89,7 @@ STATIC mp_obj_t machine_sleep_helper(wake_type_t wake_type, size_t n_args, const mp_int_t expiry = args[ARG_sleep_ms].u_int; if (expiry != 0) { - esp_sleep_enable_timer_wakeup(expiry * 1000); + esp_sleep_enable_timer_wakeup(((uint64_t)expiry) * 1000); } if (machine_rtc_config.ext0_pin != -1 && (machine_rtc_config.ext0_wake_types & wake_type)) {