From ebd9f550e8e0916e1b6b86720044e402201b5a69 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 29 Oct 2015 13:03:44 +0300 Subject: [PATCH] esp8266: Switch to standard mp_hal_delay_ms() MPHAL function. --- esp8266/esp_mphal.c | 4 ++-- esp8266/esp_mphal.h | 2 +- esp8266/modpyb.c | 2 +- esp8266/modutime.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index 5252e9ce84..44ccea42be 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -86,8 +86,8 @@ uint32_t HAL_GetTick(void) { return system_get_time() / 1000; } -void HAL_Delay(uint32_t Delay) { - mp_hal_delay_us(Delay * 1000); +void mp_hal_delay_ms(uint32_t delay) { + mp_hal_delay_us(delay * 1000); } void mp_hal_set_interrupt_char(int c) { diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h index 3d64293fd6..7ef02bc2a5 100644 --- a/esp8266/esp_mphal.h +++ b/esp8266/esp_mphal.h @@ -38,7 +38,7 @@ void mp_hal_stdout_tx_strn(const char *str, uint32_t len); void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len); uint32_t HAL_GetTick(void); -void HAL_Delay(uint32_t Delay); +void mp_hal_delay_ms(uint32_t delay); void mp_hal_delay_us(uint32_t); void mp_hal_set_interrupt_char(int c); uint32_t mp_hal_get_cpu_freq(void); diff --git a/esp8266/modpyb.c b/esp8266/modpyb.c index 45096f8cba..8d3e98c996 100644 --- a/esp8266/modpyb.c +++ b/esp8266/modpyb.c @@ -128,7 +128,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_micros_obj, pyb_elapsed_micros); STATIC mp_obj_t pyb_delay(mp_obj_t ms_in) { mp_int_t ms = mp_obj_get_int(ms_in); if (ms >= 0) { - HAL_Delay(ms); + mp_hal_delay_ms(ms); } return mp_const_none; } diff --git a/esp8266/modutime.c b/esp8266/modutime.c index e5f84e965e..241d3ccf7d 100644 --- a/esp8266/modutime.c +++ b/esp8266/modutime.c @@ -101,7 +101,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime); /// \function sleep(seconds) /// Sleep for the given number of seconds. STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) { - HAL_Delay(1000 * mp_obj_get_int(seconds_o)); + mp_hal_delay_ms(1000 * mp_obj_get_int(seconds_o)); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);