From 2bf044442eae7dbdaff91051d2c135b4aa51f1b2 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Sat, 23 Aug 2014 12:21:12 -0700 Subject: Add support for pyb.micros() by using the systick timer. I also removed trailing spaces from modpyb.c which affected a couple of lines technically not part of this patch. Tested using: https://github.com/dhylands/upy-examples/blob/master/micros_test.py which eventually fails due to wraparound issues (I could fix the test to compensate but didn't bother) --- stmhal/systick.h | 1 + 1 file changed, 1 insertion(+) (limited to 'stmhal/systick.h') diff --git a/stmhal/systick.h b/stmhal/systick.h index 1e7f62335..98045d16c 100644 --- a/stmhal/systick.h +++ b/stmhal/systick.h @@ -26,3 +26,4 @@ void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms); bool sys_tick_has_passed(uint32_t stc, uint32_t delay_ms); +uint32_t sys_tick_get_microseconds(void); -- cgit v1.2.3