Exemple #1
0
int main(void)
{
   SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);

   Kentec320x240x16_SSD2119Init();
   GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);
   ClrScreen();

   GrImageDraw(&sContext, g_pui8Image, 0, 0);
   GrFlush(&sContext);

   SysCtlDelay(SysCtlClockGet());
   // Later lab steps go between here

   ClrScreen();

   sRect.i16XMin = 1;
   sRect.i16YMin = 1;
   sRect.i16XMax = 318;
   sRect.i16YMax = 238;
   GrContextForegroundSet(&sContext, ClrRed);
   GrContextFontSet(&sContext, &g_sFontCmss30b);
   GrStringDraw(&sContext, "Texas", -1, 110, 2, 0);
   GrStringDraw(&sContext, "Instruments", -1, 80, 32, 0);
   GrStringDraw(&sContext, "Graphics", -1, 100, 62, 0);
   GrStringDraw(&sContext, "Lab", -1, 135, 92, 0);
   GrContextForegroundSet(&sContext, ClrWhite);
   GrRectDraw(&sContext, &sRect);
   GrFlush(&sContext);

   SysCtlDelay(SysCtlClockGet());

   GrContextForegroundSet(&sContext, ClrYellow);
   GrCircleFill(&sContext, 80, 182, 50);

   sRect.i16XMin = 160;
   sRect.i16YMin = 132;
   sRect.i16XMax = 312;
   sRect.i16YMax = 232;
   GrContextForegroundSet(&sContext, ClrGreen);
   GrRectDraw(&sContext, &sRect);

   SysCtlDelay(SysCtlClockGet());

   // and here
   ClrScreen();
   while(1)
   {
   }
}
Exemple #2
0
void showMenuItem(uchar index,bit selected){
	ClrScreen();

	LCD_PutString(3,1,"设置");
	LCD_PutString(2,2,configMenuStrArr[index]);
	if(selected){
		LCD_PutChar(1,2,26);//输出"->"
	}
} 
Exemple #3
0
void showMenuItem(uchar index,bit selected){
	ClrScreen();
	if(configValueArr[CONFIG_DEBUG]!=0){
		
		LCD_PutString(0,0,"调试");
	}
	LCD_PutString(3,0,"设置");
	LCD_PutString(2,1,configMenuStrArr[index]);
	if(selected){
		LCD_PutChar(1,2,26);//输出"->"
	}
} 
Exemple #4
0
void displayStaffInfo(){
	uchar m,indexi=0,indexj=0,count=0,isChinese=0;

	if(inSetting){
		return;	
	}
	ClrScreen();
		for(m=0;m<FIELD_COUNT;m++){
			LCD_PutString(0,m+1,fieldName[m]);							
			LCD_PutString(3,m+1,staffInfoBuf[m]);
		}
	
}
Exemple #5
0
void S1Term()
{
	char str[64];

	int choice;

	static char *_msg[] = {
	/*  0 */	"~8You beat the hi score !!!","~8Vous battez le record !!!",
	/*  2 */	"Your name : ........","Votre nom : ........",
	/*  4 */	"~7Your personnal message","~7Votre message personnel",
	/*  6 */	"................................","",
	/*  8 */	"~cGame Over","~cGame Over",
	/* 10 */	"~3Play again - ~4Y~3es ~4N~3o ?","~3Jouer … nouveau - ~4O~3ui ~4N~3on ?",
	/* 12 */	"yYnN","oOnN" };


	(*SplOff._proc)();

	SwapReset();

	if ( Joueur[0].points > S1Stats.score ) {

		S1Stats.score = Joueur[0].points;

		ShowStr(7,-1,_msg[0 + Langue],1);
		strcpy(str,_msg[2 + Langue]);
		GetStr(8,-1,str);
		if ( str[0] != 0 )
			strcpy(S1Stats.name,str);

		ShowStr(10,-1,_msg[4 + Langue],1);
		strcpy(str,_msg[6]);
		GetStr(11,-1,str);
		if ( str[0] != 0 )
			strcpy(S1Stats.msg,str);
		}

	if ( JouteStatus == 0 ) {
		ClrScreen();
		ShowStr(9,-1,_msg[8 + Langue],1);
		ShowStr(12,-1,_msg[10 + Langue],1);
		choice = GetChoice(_msg[12 + Langue]);
		if ( choice > 1 )
			JouteStatus = 1;
		}
}
Exemple #6
0
void Ir_work(void)
{
	
	switch (IRcord[2]){
	//600us计时模式下
	case IR_CHANNEL:
	if(setState==SET_STATE_NONE)
	{
		startSetting=1;	
	}
	break;


	case IR_EQ:
	
	if(setState==SET_STATE_INIT){
		setState=SET_STATE_MENU;
		curMenuIndex=0;
		showMenuItem(curMenuIndex,1);
		
	}
	else if(setState==SET_STATE_MENU){
		setState=SET_STATE_MENU_ITEM_SEL;
	
		curSelBit=0;
		
		
		showMenuItem(curMenuIndex,1);
		digiBuf[0]=configValueArr[curMenuIndex]/100;
		digiBuf[1]=(configValueArr[curMenuIndex]%100)/10;
		digiBuf[2]=configValueArr[curMenuIndex]%10;
		dispDigit();
	}
	else if(setState==SET_STATE_MENU_ITEM_SEL){
		setState=SET_STATE_MENU_ITEM_BIT_SEL;
		showMenuItem(curMenuIndex,0);
		LCD_PutChar(2,3,26);//输出"->"
		dispDigit();
		curSelBit=0;
		LCD_PutPosition(3+curSelBit,3);
	}
	else if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		if(curMenuIndex==CONFIG_EXIT){
		//	setState=SET_STATE_NONE;
			
		//	inSetting=0;			
		}
		else{
			configValueArr[curMenuIndex]=digiBuf[0]*100+digiBuf[1]*10+digiBuf[2];
			saveConfig();
			LCD_PutString(2,4,"设置完毕!");
			setState=SET_STATE_MENU_ITEM_FINISHED;
		
		
		}
	}		

		
	break;
	case IR_CHANNEL_MINUS:
	if(setState==SET_STATE_MENU||setState==SET_STATE_INIT){
		setState=SET_STATE_NONE;
		
		clearInfraredFlag();
		ClrScreen();//强行清屏
		inSetting=0;
		
		
	}
	else if(setState==SET_STATE_MENU_ITEM_SEL){
		setState=SET_STATE_MENU;
		showMenuItem(curMenuIndex,1);
	
	}
	else if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		setState=SET_STATE_MENU;
		showMenuItem(curMenuIndex,1);
	}
	else if(setState==SET_STATE_MENU_ITEM_FINISHED){
		setState=SET_STATE_MENU_ITEM_BIT_SEL;
		showMenuItem(curMenuIndex,0);
		LCD_PutChar(2,3,26);//输出"->"
		dispDigit();
		curSelBit=0;

		LCD_PutPosition(3+curSelBit,3);
	}
	break;
	case IR_NEXT:
	if(setState==SET_STATE_MENU){
		
		curMenuIndex=(curMenuIndex+1)%MENU_LEN;
	//	curMenu=curMenuArr[curMenuIndex];
		showMenuItem(curMenuIndex,1);
		
	}
	else if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		curSelBit=(curSelBit+1)%BITS_COUNT; 
		LCD_PutPosition(3+curSelBit,3);

	
		
	}
	break;
	case IR_PREV:
	if(setState==SET_STATE_MENU){
		
		curMenuIndex=(curMenuIndex+MENU_LEN-1)%MENU_LEN;
	//	curMenu=curMenuArr[curMenuIndex];
		showMenuItem(curMenuIndex,1);
		
	}
	else if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		curSelBit=(curSelBit+BITS_COUNT-1)%BITS_COUNT;
		LCD_PutPosition(3+curSelBit,3);
		
		
		
	}
	break;
	case IR_VOL_ADD:
	if(setState==SET_STATE_MENU){
		
		curMenuIndex=(curMenuIndex+1)%MENU_LEN;
	//	curMenu=curMenuArr[curMenuIndex];
		showMenuItem(curMenuIndex,1);
		
	} else 	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		
			digiBuf[curSelBit]=(digiBuf[curSelBit]+1)%10;
		  	dispDigit();
	}
	break;
	case IR_VOL_MINUS:
	if(setState==SET_STATE_MENU){
		
		curMenuIndex=(curMenuIndex+MENU_LEN-1)%MENU_LEN;
	//	curMenu=curMenuArr[curMenuIndex];
		showMenuItem(curMenuIndex,1);
		
	}else 	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
		
			digiBuf[curSelBit]=(digiBuf[curSelBit]+10-1)%10;
			dispDigit();
	}
	break;
	case IR_ZERO:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=0;
			dispDigit();
	}
	break;
	case IR_ONE:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=1;
			dispDigit();
	}
	break;
	case IR_TWO:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=2;
			dispDigit();
	}
	break;
	case IR_THREE:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=3;
			dispDigit();
	}
	break;
	case IR_FOUR:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=4;
			dispDigit();
	}
	break;
	case IR_FIVE:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=5;
			dispDigit();
	}
	break;
	case IR_SIX:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=6;
			dispDigit();
	}
	break;
	case IR_SEVEN:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=7;
			dispDigit();
	}
	break;
	case IR_EIGHT:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=8;
			dispDigit();
	}
	break;
	case IR_NINE:
	if(setState==SET_STATE_MENU_ITEM_BIT_SEL){
			digiBuf[curSelBit]=9;
			dispDigit();
	}
	break;

	default:
	
		break;
	
	}
	
}