Projet voilier 4IRA1 Arnaud Vergnet Marino Benassai Bastien Picco Yohan Simard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Scheduler.c 451B

1234567891011121314151617181920212223
  1. #include "Scheduler.h"
  2. #include "Timer.h"
  3. #include "stm32f1xx_ll_utils.h"
  4. void (*it_callback_SysTick)(void);
  5. void SysTick_Handler(void)
  6. {
  7. (*it_callback_SysTick)();
  8. }
  9. void Scheduler_conf(void (*it_callback) (void))
  10. {
  11. it_callback_SysTick = it_callback;
  12. SysTick->CTRL &= ~(SysTick_CTRL_CLKSOURCE_Msk);
  13. SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
  14. SysTick->LOAD = 9000;
  15. }
  16. void Scheduler_start(void)
  17. {
  18. SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
  19. }