Add wait support for tests

This commit is contained in:
Fred Sundvik 2017-07-02 01:06:39 +03:00 committed by Jack Humbert
parent fc4bfbe580
commit 4087d6da0d
2 changed files with 9 additions and 3 deletions

View file

@ -29,3 +29,7 @@ uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), l
void set_time(uint32_t t) { current_time = t; }
void advance_time(uint32_t ms) { current_time += ms; }
void wait_ms(uint32_t ms) {
advance_time(ms);
}

View file

@ -1,6 +1,8 @@
#ifndef WAIT_H
#define WAIT_H
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -16,8 +18,8 @@ extern "C" {
#elif defined(__arm__)
# include "wait_api.h"
#else // Unit tests
#define wait_ms(ms)
#define wait_us(us)
void wait_ms(uint32_t ms);
#define wait_us(us) wait_ms(us / 1000)
#endif
#ifdef __cplusplus