rtos.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /******************************************************************************************
  2. * Based on the task scheduler from the site ChipEnable.ru *
  3. * http://chipenable.ru/index.php/programming-avr/item/110-planirovschik.html *
  4. * *
  5. * Modified Shibanov Vladimir aka KontAr *
  6. * Date: 26.03.2014 *
  7. * *
  8. * Changes: *
  9. * - added single task call *
  10. * - added delete task by name *
  11. * - when a task is added again, its variables are updated *
  12. * - added a pointer to the "tail" of the list *
  13. * - RTOS functions adjusted for the "tail" *
  14. ******************************************************************************************
  15. * shilov, 2015.04.07 *
  16. * combined with the module of millisecond delays on the timer *
  17. ******************************************************************************************/
  18. #pragma once
  19. #ifndef RTOS_H
  20. #define RTOS_H
  21. /**
  22. * @brief Number of tasks
  23. */
  24. #define MAX_TASKS 20
  25. /**
  26. * Function Prototypes
  27. */
  28. void RTOS_Init (void);
  29. void RTOS_SetTask (void (*taskFunc)(void), uint32_t taskDelay, uint32_t taskPeriod);
  30. void RTOS_DeleteTask (void (*taskFunc)(void));
  31. void RTOS_DispatchTask (void);
  32. void RTOS_Timer (void);
  33. void SysTick_Handler(void);
  34. void tdelay_ms(uint32_t msek);
  35. #endif