esp8266: Switch to standard mp_hal_ticks_ms() MPHAL function.
This commit is contained in:
parent
04fa999cfe
commit
6a09e7d7ae
@ -82,7 +82,7 @@ void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t HAL_GetTick(void) {
|
||||
uint32_t mp_hal_ticks_ms(void) {
|
||||
return system_get_time() / 1000;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ void mp_hal_stdout_tx_str(const char *str);
|
||||
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);
|
||||
uint32_t mp_hal_ticks_ms(void);
|
||||
void mp_hal_delay_ms(uint32_t delay);
|
||||
void mp_hal_delay_us(uint32_t);
|
||||
void mp_hal_set_interrupt_char(int c);
|
||||
|
@ -102,13 +102,13 @@ STATIC mp_obj_t pyb_sync(void) {
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_sync_obj, pyb_sync);
|
||||
|
||||
STATIC mp_obj_t pyb_millis(void) {
|
||||
return MP_OBJ_NEW_SMALL_INT(HAL_GetTick());
|
||||
return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_ms());
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_millis_obj, pyb_millis);
|
||||
|
||||
STATIC mp_obj_t pyb_elapsed_millis(mp_obj_t start) {
|
||||
uint32_t startMillis = mp_obj_get_int(start);
|
||||
uint32_t currMillis = HAL_GetTick();
|
||||
uint32_t currMillis = mp_hal_ticks_ms();
|
||||
return MP_OBJ_NEW_SMALL_INT((currMillis - startMillis) & 0x3fffffff);
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_elapsed_millis_obj, pyb_elapsed_millis);
|
||||
|
Loading…
Reference in New Issue
Block a user