scheduler.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. Generated with CMSIS-DSP SDF Scripts.
  3. The generated code is not covered by CMSIS-DSP license.
  4. The support classes and code is covered by CMSIS-DSP license.
  5. */
  6. #include "arm_math.h"
  7. #include "custom.h"
  8. #include "GenericNodes.h"
  9. #include "AppNodes.h"
  10. #include "scheduler.h"
  11. /***********
  12. FIFO buffers
  13. ************/
  14. #define FIFOSIZE0 11
  15. #define FIFOSIZE1 5
  16. #define BUFFERSIZE0 11
  17. float32_t buf0[BUFFERSIZE0]={0};
  18. #define BUFFERSIZE1 5
  19. float32_t buf1[BUFFERSIZE1]={0};
  20. uint32_t scheduler(int *error,int someVariable)
  21. {
  22. int sdfError=0;
  23. uint32_t nbSchedule=0;
  24. int32_t debugCounter=1;
  25. /*
  26. Create FIFOs objects
  27. */
  28. FIFO<float32_t,FIFOSIZE0,0> fifo0(buf0);
  29. FIFO<float32_t,FIFOSIZE1,1> fifo1(buf1);
  30. /*
  31. Create node objects
  32. */
  33. ProcessingNode<float32_t,7,float32_t,5> filter(fifo0,fifo1,4,"Test",someVariable);
  34. Sink<float32_t,5> sink(fifo1);
  35. Source<float32_t,5> source(fifo0);
  36. /* Run several schedule iterations */
  37. while((sdfError==0) && (debugCounter > 0))
  38. {
  39. /* Run a schedule iteration */
  40. sdfError = source.run();
  41. CHECKERROR;
  42. sdfError = source.run();
  43. CHECKERROR;
  44. sdfError = filter.run();
  45. CHECKERROR;
  46. sdfError = sink.run();
  47. CHECKERROR;
  48. sdfError = source.run();
  49. CHECKERROR;
  50. sdfError = filter.run();
  51. CHECKERROR;
  52. sdfError = sink.run();
  53. CHECKERROR;
  54. sdfError = source.run();
  55. CHECKERROR;
  56. sdfError = source.run();
  57. CHECKERROR;
  58. sdfError = filter.run();
  59. CHECKERROR;
  60. sdfError = sink.run();
  61. CHECKERROR;
  62. sdfError = source.run();
  63. CHECKERROR;
  64. sdfError = filter.run();
  65. CHECKERROR;
  66. sdfError = sink.run();
  67. CHECKERROR;
  68. sdfError = source.run();
  69. CHECKERROR;
  70. sdfError = filter.run();
  71. CHECKERROR;
  72. sdfError = sink.run();
  73. CHECKERROR;
  74. debugCounter--;
  75. nbSchedule++;
  76. }
  77. *error=sdfError;
  78. return(nbSchedule);
  79. }