Subversion Repositories svn.mios32

Compare Revisions

Ignore whitespace Rev 1297 → Rev 1298

/trunk/apps/examples/speech_synth/app.c
309,11 → 309,16
DEBUG_MSG("SD Card disconnected\n");
// invalidate all file infos
SYNTH_FILE_UnloadAllFiles();
 
// change status
SYNTH_FILE_StatusMsgSet("No SD Card");
} else if( status == 3 ) {
if( !FILE_SDCardAvailable() ) {
DEBUG_MSG("SD Card not found\n");
SYNTH_FILE_StatusMsgSet("No SD Card");
} else if( !FILE_VolumeAvailable() ) {
DEBUG_MSG("ERROR: SD Card contains invalid FAT!\n");
SYNTH_FILE_StatusMsgSet("No FAT");
} else {
int bank;
for(bank=0; bank<SYNTH_FILE_B_NUM_BANKS; ++bank) {
347,6 → 352,10
}
}
}
 
// disable status message and print patch
SYNTH_FILE_StatusMsgSet(NULL);
 
status = SYNTH_FILE_UnloadAllFiles();
status = SYNTH_FILE_LoadAllFiles(1);
if( status < 0 ) {
/trunk/apps/examples/speech_synth/synth_file.c
21,6 → 21,7
/////////////////////////////////////////////////////////////////////////////
 
#include <mios32.h>
#include <string.h>
 
#include "file.h"
#include "synth_file.h"
50,7 → 51,9
// Local variables
/////////////////////////////////////////////////////////////////////////////
 
static char sd_card_msg[13];
 
 
/////////////////////////////////////////////////////////////////////////////
// Initialisation
/////////////////////////////////////////////////////////////////////////////
58,6 → 61,8
{
s32 status = 0;
 
strcpy(sd_card_msg, "SD Card?"); // 12 chars maximum
 
status |= FILE_Init(0);
status |= SYNTH_FILE_B_Init(0);
 
91,3 → 96,31
status |= SYNTH_FILE_B_UnloadAllBanks();
return status;
}
 
 
/////////////////////////////////////////////////////////////////////////////
// sets the SD Card status
// 12 characters max.
// if msg == NULL: ok, no special status, print filename
/////////////////////////////////////////////////////////////////////////////
s32 SYNTH_FILE_StatusMsgSet(char *msg)
{
if( msg == NULL ) {
sd_card_msg[0] = 0;
} else {
memcpy(sd_card_msg, msg, 13);
sd_card_msg[12] = 0; // ensure that terminator set
}
 
return 0;
}
 
/////////////////////////////////////////////////////////////////////////////
// returns the current SD Card status
// if NULL: ok, no special status, print filename
/////////////////////////////////////////////////////////////////////////////
char *SYNTH_FILE_StatusMsgGet(void)
{
return sd_card_msg[0] ? sd_card_msg : NULL;
}
 
/trunk/apps/examples/speech_synth/synth_file.h
50,7 → 50,10
extern s32 SYNTH_FILE_LoadAllFiles(u8 including_hw);
extern s32 SYNTH_FILE_UnloadAllFiles(void);
 
extern s32 SYNTH_FILE_StatusMsgSet(char *msg);
extern char *SYNTH_FILE_StatusMsgGet(void);
 
 
/////////////////////////////////////////////////////////////////////////////
// Export global variables
/////////////////////////////////////////////////////////////////////////////
/trunk/apps/examples/speech_synth/scs_config.c
195,7 → 195,11
sprintf(line2, "Msg1 Msg2 Msg3 Msg4 ");
return 1;
} else if( SCS_MenuStateGet() == SCS_MENU_STATE_MAINPAGE ) {
getPatchString(line1);
// print SD Card status message or patch
if( SYNTH_FILE_StatusMsgGet() )
sprintf(line1, SYNTH_FILE_StatusMsgGet());
else
getPatchString(line1);
sprintf(line2, "Press soft button");
return 1;
} else if( SCS_MenuStateGet() == SCS_MENU_STATE_SELECT_PAGE ) {