esp8266: Switch to standard mp_hal_ticks_ms() MPHAL function.
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c
index 44ccea4..471b1fe 100644
--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -82,7 +82,7 @@
}
}
-uint32_t HAL_GetTick(void) {
+uint32_t mp_hal_ticks_ms(void) {
return system_get_time() / 1000;
}
diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h
index 7ef02bc..e3ba0c4 100644
--- a/esp8266/esp_mphal.h
+++ b/esp8266/esp_mphal.h
@@ -37,7 +37,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);
+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);
diff --git a/esp8266/modpyb.c b/esp8266/modpyb.c
index 8d3e98c..c5c24c0 100644
--- a/esp8266/modpyb.c
+++ b/esp8266/modpyb.c
@@ -102,13 +102,13 @@
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);