Skip to content
Snippets Groups Projects
Commit 6a09e7d7 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

esp8266: Switch to standard mp_hal_ticks_ms() MPHAL function.

parent 04fa999c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment