test_user.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include "test_user.h"
  2. int testAdcInjectData0[2];
  3. int testAdcInjectData1[2];
  4. int testAdcInjectData2[2];
  5. int testAdcIntFlg[2][2];
  6. int testTimerIntFlg[2][4];
  7. int testCh2CapValue[2];
  8. int testCh3CapValue[2];
  9. int testGpioBValue[2];
  10. /* Variables and Functions mock */
  11. LPF_OUT scm_stMotoPwrInLpf;
  12. LPF_OUT scm_stIqLoadLpf;
  13. UWORD scm_uwSpdFbkLpfAbsPu;
  14. UWORD hw_uwADC0[8];
  15. MC_UpperPCInfo_Struct_t MC_UpcInfo;
  16. UWORD adc_uwRdsonUReg;
  17. UWORD adc_uwRdsonVReg;
  18. UWORD adc_uwRdsonWReg;
  19. UWORD adc_uwADDMAPhase1;
  20. int timer_interrupt_flag_get(int timer_periph, int interrupt)
  21. {
  22. return testTimerIntFlg[timer_periph][interrupt];
  23. }
  24. void timer_interrupt_flag_clear(int timer_periph, int interrupt)
  25. {
  26. testTimerIntFlg[timer_periph][interrupt] = 0;
  27. }
  28. void stl_voTbcProc()
  29. {}
  30. void stl_voSystickProc()
  31. {}
  32. void stl_voDoRunTimeChecks()
  33. {}
  34. void NVIC_SystemReset()
  35. {}
  36. /*==== temp ====*/
  37. BOOL hw_blChrgOvrFlg = 1;
  38. BOOL hw_blPWMOnFlg;
  39. void hw_voPWMOn()
  40. {
  41. hw_blPWMOnFlg = 1;
  42. }
  43. void hw_voPWMOff()
  44. {
  45. hw_blPWMOnFlg = 1;
  46. }
  47. void hw_voPWMInit()
  48. {
  49. hw_voPWMOff();
  50. hw_blChrgOvrFlg = 0;
  51. }
  52. void hw_voThrPhsShrt()
  53. {
  54. hw_voPWMOn();
  55. }
  56. void hw_voCharge()
  57. {
  58. hw_blChrgOvrFlg = 1;
  59. }