Esempio n. 1
0
int main()
{
    char c;    
    int note=0; // current Notes
    int printFlag=0; // if set to 0 it prints the notes when they change
 
    CyGlobalIntEnable; /* Enable global interrupts. */
    CySysTickStart();
    
    Music_Start(0);
 
    UART_Start();
   
    sprintf(buff,"Started\n");
    UART_UartPutString(buff);

    for(;;)
    {
        c = UART_UartGetChar();
        switch(c)
        {
            case 's':
                UART_UartPutString("Start\n");
                Music_PlaySong(0);
            break;
            case 'S':
                UART_UartPutString("Stop\n");
                Music_Stop();
            break;
            case 'p':
                printFlag=0;
                break;
            case 'P':
                printFlag = 1;
            break;
            case 't': // put it back to the default
                Music_SetBPM(0);
            break;
            case 'T':
                Music_SetBPM(60);
            break;
                
            case '1':
                Music_PlaySong(0);
            break;
            case '2':
                Music_PlaySong(1);
            break;
        }
        
        if(note != Music_GetNote() && printFlag)
        {
            note = Music_GetNote();
            sprintf(buff,"Note = %d\n",note);
            UART_UartPutString(buff);
        }
    }
}
Esempio n. 2
0
void Menu_Loop(void)
{
	// enable the console if starting with console mode
	if (CFG.gui != CFG_GUI_START) {
		if (!(CFG.direct_launch && !CFG.intro)) {
			Gui_Console_Enable();
		}
	}

	// Direct Launch?
	Direct_Launch();

	// Start Music
	Music_Start();

	// Clear console
	// (so that it doesn't show when switching back from gui)
	Con_Clear();
	__console_scroll = 0;

	// Init Favorites
	Switch_Favorites(CFG.start_favorites);

	// Start GUI
	if (CFG.gui == CFG_GUI_START) goto skip_list;

	/* Menu loop */
	for (;;) {
		/* Clear console */
		Con_Clear();

		/* Show gamelist */
		__Menu_ShowList();

		/* Show cover */
		__Menu_ShowCover();

		//memstat();

		skip_list:
		/* Controls */
		__Menu_Controls();
	}
}
Esempio n. 3
0
int main()
{
    char c;    
    int note=0; // current note
    int printFlag=0; // if set to 0 it prints the notes when they change
 
    CyGlobalIntEnable;
    CySysTickStart();
    Music_Start(0);
    UART_Start();
    UART_UartPutString("Started\n");

    Music_AddSong(1,&scale);
    
    for(;;)
    {
        c = UART_UartGetChar();
        switch(c)
        {
            #ifdef Music_TWOCHANNELS
            case 'b': Music_BuzzOn(300,0);    break; // turn on the buzzer 1
            case 'B': Music_BuzzOff();        break; // turn off the buzzer 1
            case 'n': Music_BuzzOn(200,500);  break; // turn on the buzzer for 500ms
            #endif
            case 'p': printFlag=0;            break; // turn off the note printer
            case 'P': printFlag = 1;          break; // turn on the note printer
            case 't': Music_SetBPM(0);        break; // Put the song back to the default
            case 'T': Music_SetBPM(60);       break; // Put the current song to 60BPM
            case '1': Music_PlaySong(0,0);    break; // Play the 1st Song
            case '2': Music_PlaySong(1,0);    break; // Play the 2nd Song
            case 's':
                UART_UartPutString("Stop\n");
                Music_Stop();
            break;
        }
        
        if(note != Music_GetNote() && printFlag)
        {
            note = Music_GetNote();
            sprintf(buff,"Note = %d\n",note);
            UART_UartPutString(buff);
        }
    }
}