Karg

MIOS32 File Browser

4 posts in this topic

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

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

Thanks Peter, I got is working :)

Share this post


Link to post
Share on other sites

Congrats!
:cheers:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now