esp8266: Switch to standard mp_hal_delay_ms() MPHAL function.
This commit is contained in:
parent
5699fc9d0e
commit
ebd9f550e8
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue