Specifications
/* place the number in the string */
while(length>0){
tmp = length - 1;
power = 1;
while( tmp > 0 ){
power *= 10;
tmp--;
}
*string = data/power + '0';
string++;
length--;
data -= (data/power)*power;
}
*string = '.';
/* return the number of places taken in the string */
return space;
}
/* Sends the song name to the ethernut */
void send_song_name (unsigned int song_count, char * song_path){
TCHAR song_name_to_send[50];
TCHAR *song_to_send_ptr;
char dummy;
int pointer_pos = 0;
song_to_send_ptr = &song_name_to_send[0];
/* Add the song number to the start of the song name */
song_to_send_ptr += add_number_song_name(song_count, &song_name_to_send[0]);
dummy = 1;
/* loop until get to '.mp3' */
while(dummy == 1){
/* put the character in the buffer */
*song_to_send_ptr = song_path[pointer_pos];
song_to_send_ptr++;
/* if the character is a back slash */
if(song_path[pointer_pos] == 0x5C){
/* reset the pointer */
song_to_send_ptr = &song_name_to_send[0];
/* Add the song number to the start of the song name */
song_to_send_ptr += add_number_song_name(song_count,
&song_name_to_send[0]);
/* if there is a MP3 separator ' - ' */
} else if((song_path[pointer_pos] == '-') &&
(song_path[pointer_pos - 1] == ' ') && (song_path[pointer_pos + 1] == ' ')){
pointer_pos++;
/* reset the pointer */
song_to_send_ptr = &song_name_to_send[0];
81










