| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- /*
- Generated with CMSIS-DSP Compute Graph Scripts.
- The generated code is not covered by CMSIS-DSP license.
- The support classes and code is covered by CMSIS-DSP license.
- */
- #include "custom.h"
- #include "GenericNodes.h"
- #include "AppNodes.h"
- #include "scheduler.h"
- #if !defined(CHECKERROR)
- #define CHECKERROR if (cgStaticError < 0) \
- {\
- goto errorHandling;\
- }
- #endif
- #if !defined(CG_BEFORE_ITERATION)
- #define CG_BEFORE_ITERATION
- #endif
- #if !defined(CG_AFTER_ITERATION)
- #define CG_AFTER_ITERATION
- #endif
- #if !defined(CG_BEFORE_SCHEDULE)
- #define CG_BEFORE_SCHEDULE
- #endif
- #if !defined(CG_AFTER_SCHEDULE)
- #define CG_AFTER_SCHEDULE
- #endif
- #if !defined(CG_BEFORE_BUFFER)
- #define CG_BEFORE_BUFFER
- #endif
- #if !defined(CG_BEFORE_FIFO_BUFFERS)
- #define CG_BEFORE_FIFO_BUFFERS
- #endif
- #if !defined(CG_BEFORE_FIFO_INIT)
- #define CG_BEFORE_FIFO_INIT
- #endif
- #if !defined(CG_BEFORE_NODE_INIT)
- #define CG_BEFORE_NODE_INIT
- #endif
- #if !defined(CG_AFTER_INCLUDES)
- #define CG_AFTER_INCLUDES
- #endif
- #if !defined(CG_BEFORE_SCHEDULER_FUNCTION)
- #define CG_BEFORE_SCHEDULER_FUNCTION
- #endif
- #if !defined(CG_BEFORE_NODE_EXECUTION)
- #define CG_BEFORE_NODE_EXECUTION
- #endif
- #if !defined(CG_AFTER_NODE_EXECUTION)
- #define CG_AFTER_NODE_EXECUTION
- #endif
- CG_AFTER_INCLUDES
- /*
- Description of the scheduling.
- */
- static unsigned int schedule[19]=
- {
- 2,2,0,1,2,0,1,2,2,0,1,1,2,0,1,2,0,1,1,
- };
- CG_BEFORE_FIFO_BUFFERS
- /***********
- FIFO buffers
- ************/
- #define FIFOSIZE0 11
- #define FIFOSIZE1 11
- #define BUFFERSIZE1 11
- CG_BEFORE_BUFFER
- float32_t buf1[BUFFERSIZE1]={0};
- #define BUFFERSIZE2 11
- CG_BEFORE_BUFFER
- float32_t buf2[BUFFERSIZE2]={0};
- CG_BEFORE_SCHEDULER_FUNCTION
- uint32_t scheduler(int *error)
- {
- int cgStaticError=0;
- uint32_t nbSchedule=0;
- int32_t debugCounter=1;
- CG_BEFORE_FIFO_INIT;
- /*
- Create FIFOs objects
- */
- FIFO<float32_t,FIFOSIZE0,0,0> fifo0(buf1);
- FIFO<float32_t,FIFOSIZE1,0,0> fifo1(buf2);
- CG_BEFORE_NODE_INIT;
- /*
- Create node objects
- */
- ProcessingNode<float32_t,7,float32_t,7> processing(fifo0,fifo1);
- Sink<float32_t,5> sink(fifo1);
- Source<float32_t,5> source(fifo0);
- /* Run several schedule iterations */
- CG_BEFORE_SCHEDULE;
- while((cgStaticError==0) && (debugCounter > 0))
- {
- /* Run a schedule iteration */
- CG_BEFORE_ITERATION;
- for(unsigned long id=0 ; id < 19; id++)
- {
- CG_BEFORE_NODE_EXECUTION;
- switch(schedule[id])
- {
- case 0:
- {
- cgStaticError = processing.run();
- }
- break;
- case 1:
- {
- cgStaticError = sink.run();
- }
- break;
- case 2:
- {
- cgStaticError = source.run();
- }
- break;
- default:
- break;
- }
- CG_AFTER_NODE_EXECUTION;
- CHECKERROR;
- }
- debugCounter--;
- CG_AFTER_ITERATION;
- nbSchedule++;
- }
- errorHandling:
- CG_AFTER_SCHEDULE;
- *error=cgStaticError;
- return(nbSchedule);
- }
|