MIOS32 File Browser

Hello,

I would like to give my application MIOS32 File Browser capabilities. Having not found much information about this, I just started playing around a bit:

Reading other peoples source codes, my impression is that the corresponding code is in terminal.c (LoopA and Seq4 code - is my impression correct?). Thus, I have begun by adding

 TERMINAL\_Init(0);

into my APP_Init routine. Further, I added several programming models to my Makefile:

################################################################################ # Include source modules via additional makefiles ################################################################################ # sources of programming model include $(MIOS32\_PATH)/programming\_models/traditional/programming\_model.mk # application specific LCD driver (selected via makefile variable) include $(MIOS32\_PATH)/modules/app\_lcd/$(LCD)/app\_lcd.mk # MIDI Router (and port handling) include $(MIOS32\_PATH)/modules/midi\_router/midi\_router.mk # MIDImon include $(MIOS32\_PATH)/modules/midimon/midimon.mk # UIP driver include $(MIOS32\_PATH)/modules/uip/uip.mk # UIP Standard Task (with DHCPC + OSC server and client) include $(MIOS32\_PATH)/modules/uip\_task\_standard/uip\_task\_standard.mk # generic sequencer modules #include $(MIOS32\_PATH)/modules/sequencer/sequencer.mk # MIDI file Player #include $(MIOS32\_PATH)/modules/midifile/midifile.mk # FATFS Driver include $(MIOS32\_PATH)/modules/fatfs/fatfs.mk # FILE Access Layer include $(MIOS32\_PATH)/modules/file/file.mk # USB Mass Storage Device Driver include $(MIOS32\_PATH)/modules/msd/msd.mk # common make rules # Please keep this include statement at the end of this Makefile. Add new modules above. include $(MIOS32\_PATH)/include/makefile/common.mk

and also put the MUTEX routines into mios32_config.h:

// map MIDI mutex to UIP task // located in app.c to access MIDI IN/OUT mutex from external extern void APP\_MUTEX\_MIDIOUT\_Take(void); extern void APP\_MUTEX\_MIDIOUT\_Give(void); extern void APP\_MUTEX\_MIDIIN\_Take(void); extern void APP\_MUTEX\_MIDIIN\_Give(void); #define UIP\_TASK\_MUTEX\_MIDIOUT\_TAKE { APP\_MUTEX\_MIDIOUT\_Take(); } #define UIP\_TASK\_MUTEX\_MIDIOUT\_GIVE { APP\_MUTEX\_MIDIOUT\_Give(); } #define UIP\_TASK\_MUTEX\_MIDIIN\_TAKE { APP\_MUTEX\_MIDIIN\_Take(); } #define UIP\_TASK\_MUTEX\_MIDIIN\_GIVE { APP\_MUTEX\_MIDIIN\_Give(); }

Similarly, I have the following in my app.c:

///////////////////////////////////////////////////////////////////////////// //! functions to access MIDI IN/Out Mutex //! see also mios32\_config.h ///////////////////////////////////////////////////////////////////////////// void APP\_MUTEX\_MIDIOUT\_Take(void) { MUTEX\_MIDIOUT\_TAKE; } void APP\_MUTEX\_MIDIOUT\_Give(void) { MUTEX\_MIDIOUT\_GIVE; } void APP\_MUTEX\_MIDIIN\_Take(void) { MUTEX\_MIDIIN\_TAKE; } void APP\_MUTEX\_MIDIIN\_Give(void) { MUTEX\_MIDIIN\_GIVE; }

Yet, I still get the following error messages, and have not found a solution yet.

Quote

app.c:339:37: error: ‘MUTEX_MIDIOUT_TAKE’ undeclared (first use in this function)
app.c:339:37: note: each undeclared identifier is reported only once for each function it appears in
app.c: In function ‘APP_MUTEX_MIDIOUT_Give’:
app.c:340:37: error: ‘MUTEX_MIDIOUT_GIVE’ undeclared (first use in this function)
app.c: In function ‘APP_MUTEX_MIDIIN_Take’:
app.c:341:36: error: ‘MUTEX_MIDIIN_TAKE’ undeclared (first use in this function)
app.c: In function ‘APP_MUTEX_MIDIIN_Give’:
app.c:342:36: error: ‘MUTEX_MIDIIN_GIVE’ undeclared (first use in this function)

I hope I am not on the completely wrong path for the MIOS32 File Browser implementation :slight_smile:

 

Cheers,

Karg

Hi Karg,

could you try and copy in tasks.h and include it where needed (e.g. include from app.c)?
This header contains the missing macros providing the necessary mutexes.
(These mutexes are required, so that a terminal communication, e.g. debug logging does not interrupt another MIDI data transfer over the same USB line, thus mixing up things and producing garbage).

I think they should be preprocessor macros instead of functions:
#define MUTEX_MIDIIN_TAKE { while( xSemaphoreTakeRecursive(xMIDIINSemaphore, (portTickType)1) != pdTRUE ); }

Many greets, have fun and good luck!
Peter

 

Thanks Peter, I got is working :slight_smile:

Congrats!