Author |
Message |
arpeggio
Joined: Jan 05, 2010 Posts: 24 Location: the Netherlands
|
Posted: Tue Oct 20, 2015 5:48 am Post subject:
|
|
|
Hello, got the code to proces without the errors i mentioned,
it got to do with the PLACE where i putted the MidiSetRcvAlarm
Thanks, Dian |
|
Back to top
|
|
|
arpeggio
Joined: Jan 05, 2010 Posts: 24 Location: the Netherlands
|
Posted: Fri Oct 23, 2015 3:51 am Post subject:
|
|
|
Hello, the initialize_midi is a function to start/use midi in the code.
So it is used in the main loop, so it is initialized every time to loop loops.
In Arduino code there is a setup where one does that, initialise things is it nesesary to initialise the midi handdle thing every once the loop occurs or can it be don once here in the Chameleon software
Thanks, Dian |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Oct 23, 2015 7:07 am Post subject:
|
|
|
The initialize_midi() function should be called only once when the program starts. I.e. calling it from rtems_main() is the typical thing to do. It should not be called repeatedly from a loop. |
|
Back to top
|
|
|
arpeggio
Joined: Jan 05, 2010 Posts: 24 Location: the Netherlands
|
Posted: Sat Oct 24, 2015 4:59 am Post subject:
|
|
|
Hello, for my own clarity of coding things, is the rtems_main called once, or does it run further on (while) loops, for the panel and dsp tasks,
Couse you put the initialize inside the rtems_main loop, i asume this is a loop,
isn't it.
When you get a grasp of every programming detail, and understand i fully,
then you can program everything.
Thanks again, Dian |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Sat Oct 24, 2015 12:50 pm Post subject:
|
|
|
Yes, rtems_main() is called automatically one single time when the program starts. It's the entry point to your program. In plain C/C++ the entry point is just called main(). Since the RTEMS operating system in the Chameleon is in charge of things, it does a few internal things at startup, then it calls rtems_main() to start your program.
In this program, rtems_main() starts the DSP, initializes MidiShare and then it starts the two task we're using. Finally it deletes the initial thread that it (rtems_main()) runs in, since this is no longer needed. The two threads we created (the panel task and the level meter task) continue to run. As you know, those two threads runs concurrently, and this is where we have the loops that drive things along. |
|
Back to top
|
|
|
|