Karg Posted August 4, 2019 Report Share Posted August 4, 2019 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 :) Cheers, Karg Quote Link to comment Share on other sites More sharing options...
Hawkeye Posted August 6, 2019 Report Share Posted August 6, 2019 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 Quote Link to comment Share on other sites More sharing options...
Karg Posted August 11, 2019 Author Report Share Posted August 11, 2019 Thanks Peter, I got is working :) Quote Link to comment Share on other sites More sharing options...
Hawkeye Posted August 12, 2019 Report Share Posted August 12, 2019 Congrats! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.