From 7b6bdc4c2b0b260a05c4f2dfcf67fe19eccd51a8 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Tue, 3 Jan 2017 21:15:53 +0100 Subject: [PATCH] nrf5: Adding sleep_us to modutime.c and exposing mp_hal_delay_us in hal/hal_time.h --- nrf5/hal/hal_time.h | 2 ++ nrf5/modutime.c | 1 + 2 files changed, 3 insertions(+) diff --git a/nrf5/hal/hal_time.h b/nrf5/hal/hal_time.h index 1cef8b9521..79b643acc7 100644 --- a/nrf5/hal/hal_time.h +++ b/nrf5/hal/hal_time.h @@ -29,4 +29,6 @@ void mp_hal_delay_ms(mp_uint_t ms); +void mp_hal_delay_us(mp_uint_t us); + #endif // HAL_TIME_H__ diff --git a/nrf5/modutime.c b/nrf5/modutime.c index a0e4f904c4..bb3f6a401a 100644 --- a/nrf5/modutime.c +++ b/nrf5/modutime.c @@ -42,6 +42,7 @@ STATIC const mp_rom_map_elem_t time_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_utime) }, { MP_ROM_QSTR(MP_QSTR_sleep_ms), MP_ROM_PTR(&mp_utime_sleep_ms_obj) }, + { MP_ROM_QSTR(MP_QSTR_sleep_us), MP_ROM_PTR(&mp_utime_sleep_us_obj) }, }; STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);