From b0d8f22f3492fbb3f6dc0e8026e63c803af59007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 17 Oct 2015 15:40:51 +0200 Subject: Complete commit of current work --- tasks.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tasks.h (limited to 'tasks.h') diff --git a/tasks.h b/tasks.h new file mode 100644 index 0000000..f773e17 --- /dev/null +++ b/tasks.h @@ -0,0 +1,35 @@ +#include +#include +#include +#include + +#include "mcu/mcu_def.h" +#include "timer.h" + +#ifndef _IOE_TASKS_H_ +#define _IOE_TASKS_H_ +#ifdef CONFIG_IOE_TASKS + +#ifndef CONFIG_IOE_TIMERS +#error "To use tasks you must enable timers (CONFIG_IOE_TIMERS)." +#endif + +struct Task { + +}; + +void taskDelay(uint16_t us); +void taskDelayMS(uint16_t ms); +void taskDelayTill(int8_t *boolean); +int8_t taskDelayTillT(int8_t *boolean, uin16_t us); +void taskDelayTillF(int8_t (*fnc)(void)); +void taskDelayTillFT(int8_t (*fnc)(void), uint16_t us); + +#else /* CONFIG_IOE_TASKS */ + +#define taskDelay(US) _delay_us(US) +#define taskDelayTill(BOOL) while(*BOOL == 0) +int8_t taskDelayTillT(int8_t *condition, uint8_t timeout_10us); + +#endif /* CONFIG_IOE_TASKS */ +#endif /* _IOE_TASKS_H_ */ -- cgit v1.2.3