test_user.h 829 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "Cadence.h"
  2. #include "bikespeed.h"
  3. #ifndef _TEST_USER_H_
  4. #define _TEST_USER_H_
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif // __cplusplus
  8. #define TIMER1 1
  9. #define TIMER_INT_FLAG_UP 0
  10. #define TIMER_INT_FLAG_CH1 1
  11. #define TIMER_INT_FLAG_CH2 2
  12. #define TIMER_INT_FLAG_CH3 3
  13. #define GPIOB 1
  14. #define GPIOC 2
  15. #define TIMER_CH2CV(timex) testCh2CapValue[timex]
  16. #define TIMER_CH3CV(timex) testCh3CapValue[timex]
  17. #define GPIO_ISTAT(gpiox) testGpioBValue[gpiox]
  18. #define abs(x) ((x) >= 0 ? (x) : (-(x)))
  19. extern int testTimerIntFlg[2][4];
  20. extern int testCh2CapValue[2];
  21. extern int testCh3CapValue[2];
  22. extern int testGpioBValue[2];
  23. int timer_interrupt_flag_get(int timer_periph, int interrupt);
  24. void timer_interrupt_flag_clear(int timer_periph, int interrupt);
  25. #ifdef __cplusplus
  26. }
  27. #endif // __cplusplus
  28. #endif