Skip to content

Commit ebd9f55

Browse files
committed
esp8266: Switch to standard mp_hal_delay_ms() MPHAL function.
1 parent 5699fc9 commit ebd9f55

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

esp8266/esp_mphal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ uint32_t HAL_GetTick(void) {
8686
return system_get_time() / 1000;
8787
}
8888

89-
void HAL_Delay(uint32_t Delay) {
90-
mp_hal_delay_us(Delay * 1000);
89+
void mp_hal_delay_ms(uint32_t delay) {
90+
mp_hal_delay_us(delay * 1000);
9191
}
9292

9393
void mp_hal_set_interrupt_char(int c) {

esp8266/esp_mphal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void mp_hal_stdout_tx_strn(const char *str, uint32_t len);
3838
void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len);
3939

4040
uint32_t HAL_GetTick(void);
41-
void HAL_Delay(uint32_t Delay);
41+
void mp_hal_delay_ms(uint32_t delay);
4242
void mp_hal_delay_us(uint32_t);
4343
void mp_hal_set_interrupt_char(int c);
4444
uint32_t mp_hal_get_cpu_freq(void);

esp8266/modpyb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_micros_obj, pyb_elapsed_micros);
128128
STATIC mp_obj_t pyb_delay(mp_obj_t ms_in) {
129129
mp_int_t ms = mp_obj_get_int(ms_in);
130130
if (ms >= 0) {
131-
HAL_Delay(ms);
131+
mp_hal_delay_ms(ms);
132132
}
133133
return mp_const_none;
134134
}

esp8266/modutime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_mktime_obj, time_mktime);
101101
/// \function sleep(seconds)
102102
/// Sleep for the given number of seconds.
103103
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
104-
HAL_Delay(1000 * mp_obj_get_int(seconds_o));
104+
mp_hal_delay_ms(1000 * mp_obj_get_int(seconds_o));
105105
return mp_const_none;
106106
}
107107
MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);

0 commit comments

Comments
 (0)