diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-27 23:31:42 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-27 23:31:42 +0300 |
commit | 404dae80a9d5cb6315071fe6206b2a6026be0a09 (patch) | |
tree | 1673c104f54427386044a0e739cc1adf8b6f0569 /unix | |
parent | 9011815d862683711a6d79bb76a553d84b6e4556 (diff) | |
download | micropython-404dae80a9d5cb6315071fe6206b2a6026be0a09.tar.gz micropython-404dae80a9d5cb6315071fe6206b2a6026be0a09.zip |
unix, stmhal: Introduce mp_hal_delay_ms(), mp_hal_ticks_ms().
These MPHAL functions are intended to replace previously used HAL_Delay(),
HAL_GetTick() to provide better naming and MPHAL separation (they are
fully equivalent otherwise).
Also, refactor extmod/modlwip to use them.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/unix_mphal.c | 2 | ||||
-rw-r--r-- | unix/unix_mphal.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c index 0974b6ad21..54a710a3ba 100644 --- a/unix/unix_mphal.c +++ b/unix/unix_mphal.c @@ -119,7 +119,7 @@ void mp_hal_stdout_tx_str(const char *str) { mp_hal_stdout_tx_strn(str, strlen(str)); } -uint32_t HAL_GetTick(void) { +uint32_t mp_hal_ticks_ms(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; diff --git a/unix/unix_mphal.h b/unix/unix_mphal.h index 09d063575f..2e10d48a65 100644 --- a/unix/unix_mphal.h +++ b/unix/unix_mphal.h @@ -38,5 +38,5 @@ void mp_hal_stdout_tx_str(const char *str); void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len); void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len); -#define HAL_Delay(ms) usleep((ms) * 1000) -uint32_t HAL_GetTick(void); +#define mp_hal_delay_ms(ms) usleep((ms) * 1000) +uint32_t mp_hal_ticks_ms(void); |