示例#1
0
void KeypadUpdate(void)
	{
	UBYTE i;
//    if(AcqSuspendFlag==CMD_OFF) /*Modified by Kevin Meng  2003.03.07*/
//        OSTimeDly(2);
	GL_DrawBitmap(Keypad,61,67);
//	GL_DrawBitmap(Keypad, 42, 50);
    
	DrawKeySelPtr();
	GUI_SetFont(Upper_Font); 
	KeypadRedrawFlag|=KEYPAD_STR_UPDATA;//Update String
	if(KeypadRedrawFlag&KEYPAD_NEW_FOLDER)
		{
		KeypadRedrawFlag&=~KEYPAD_NEW_FOLDER;
		ShowString("New Folder:",73,76,GUI_TA_LEFT);
		KeypadSTRPtr=7;
		KeyCursorPos=13;
		for(i=0 ; i<8 ; i++)	
			KeypadSTR[i] = KeyinTmp_NFOL[i];
		for(i=8 ; i<13 ; i++)	
			KeypadSTR[i] = 0x00;
		for(i=0 ; i<4 ; i++)	
			KeypadSubSTR[i] = 0x00;
		}
	else
		ShowString("Rename:",73,76,GUI_TA_LEFT);
	}
示例#2
0
文件: Text1.c 项目: super-1943/MCU
void main(void)
{
	_RD = 1;
	P0=0xf0;
	_RES = 1;
	Delay(10);
	_RES = 0;
	Delay(50);
	_RES = 1;
	Delay(10);
	SPFD5420A_CPT30W_Initial();
	Clear();
	juxing(0,0,239,40,0x07e0);
	Blue(1,238,1,39);
	ShowString(1,1,"Hello ,world!!!");
	ShowString(1,17,"My name is KKK!!!");
	Delay(10000);
	Clear();
	juxing(0,0,239,20,0x07e0);
	Blue(1,238,1,19);
	ShowString(1,1,"Now let's have a look!");
	Delay(10000);
	while(1)
	{
		blue_dark_zong();
		Delay(1000);
		red_dark_heng();
		Delay(1000);
		green_dark_zong();
		Delay(1000);
		blue_dark_heng();
		Delay(1000);
		red_dark_zong();
		Delay(1000);
		green_dark_heng();
		Delay(10000);		
		Clear();
		drawline(0,0x00ef,0,0x018f,0xffff);
		Delay(1000);
		drawline(0,0x00ef,0,0x018f,0xffff);
		Delay(1000);
		drawline(0,0,0,399,0xffff);
		drawline(239,239,0,399,0xffff);
		drawline(0,239,0,0,0xffff);
		drawline(0,239,399,399,0xffff);
		Delay(10000);
		Clear();
		sin();
		Delay(1000);
		Clear();
//		show_pic(gImage_1,0,0,49,49);

//		show_pic(gImage_1,40,40,60,40);
	}
}
示例#3
0
void MainInnerLayer::onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader)
{
    std::string text = ShowString("sun");

    this->mlblName->setString(text.c_str());
    this->mlblHealth->setZOrder(20);
    this->mlblPower->setZOrder(10);

    hpBar = MDProgressBar::create("x1.png","x2.png","x3.png",84,0.5);
    hpBar->setPosition(ccp(43, 361));
    this->addChild(hpBar);

    expBar = MDProgressBar::create("t1.png","t2.png","t3.png",84,1.0);
    expBar->setPosition(ccp(201, 361));
    this->addChild(expBar);

    CCDictionary *userInfo = GlobalData::getUserinfo();
	if (userInfo!=NULL)
	{    
		CCNumber* fraction = (CCNumber*)userInfo->objectForKey("fraction");
        if(fraction->getIntValue()==FACTION_FAIRY)
        {
            m_sPlayerContainer->setDisplayFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(SPRITE_FACTION_FAIRY_CONTAINER));
        }
        else if (fraction->getIntValue()==FACTION_BUDDHA)
        {
            m_sPlayerContainer->setDisplayFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(SPRITE_FACTION_BUDDHA_CONTAINER));
        }
        else if (fraction->getIntValue()==FACTION_DEMON)
        {
            m_sPlayerContainer->setDisplayFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(SPRITE_FACTION_DEMON_CONTAINER));
        }
	}

	mTableView->setDirection(kCCScrollViewDirectionHorizontal);
	mTableView->setVerticalFillOrder(kCCTableViewFillTopDown);
	mTableView->setDataSource(this);
	mTableView->setViewSize(CCSizeMake(266, 65));
	mTableView->isPagingEnableX = true;
	mTableView->setBounceable(false);
	mTableView->setDelegate(this);
    
    mTableView->reloadData();

//    if (m_sCharacter==NULL) {
//        m_sCharacter = CCSprite::createWithSpriteFrameName("character_sunwukong.png");
//        m_sCharacter->setPosition(ccp(150,144));
//        this->addChild(m_sCharacter);
//
//        CCSize sSize = m_sCharacter->getContentSize();
//
//        this->glowEffect(ccp(sSize.width * 0.5,sSize.height * 0.5), CCSizeMake(5.0, 5.0f), ccc3(255, 230, 0), 1.0f, m_sCharacter);
//    }
}
/*******************************************************************************
* 函 数 名: main
* 函数功能: 主函数
* 输    入: 无
* 输    出: 无
*******************************************************************************/
void main()
{
	DULA = 1;
	P0 = 0xff;
	DULA = 0;
	WELA = 1;
	P0 = 0xff;
	WELA = 0;
	
	LcdInit();
	CLeanFullScreen(0xff,0xff);//清屏
	
	while (1)
	{
		ShowString(20,100,"欢迎使用航太电子单片机",BLUE,WHITE);
		ShowString(20,150,"Welcome To 51MCU World!",RED,WHITE);
//		ShowString(20,100,"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ",BLACK,WHITE);//显示所有字符
//		ShowString(20,200,"kdfgdsklbgd航太电子skdncs航太电子",BLACK,WHITE);
		while(1);
	}
}
/*******************************************************************************
* 函 数 名: main
* 函数功能: 主函数
* 输    入: 无
* 输    出: 无
*******************************************************************************/
void main()
{
	//彩屏实验时最好关闭数码管的锁存器,避免数码管乱闪
	DULA = 1;
	P0 = 0xff;
	DULA = 0;
	WELA = 1;
	P0 = 0xff;
	WELA = 0;
	
	LcdInit();
	
	CLeanFullScreen(0xff,0xff);//清屏
	
	ShowString(0,0,"LCD init OK",RED,WHITE);
	
	if(!SdInit())
	{
		ShowString(0,20,"SD Init Fail",RED,WHITE);
		while(1);
	}
	
	if(!SdReadBlock(DATA,TXTADD,512))
	{
		ShowString(0,20,"SD Read Fail",RED,WHITE);
		while(1);
	}
	
	ShowString(0,20,DATA,RED,WHITE);//显示TXT文本内容
	Delayms(1000);
	while (1)
	{
		ShowFullSDPic(PIC1ADD);
		Delayms(2000);
		ShowFullSDPic(PIC2ADD);
		Delayms(2000);
		

	}
}
void Menu::Show(int n){
	if(!int(items)) return;
	if(int(RedrawBackground))(*RedrawBackground)();
	for(int i=0;i<NItems;i++){
		LPCSTR s=GetNstr(i);
		int x=Zone[i].x;
		int y=Zone[i].y;
		lpRLCFont ff=font;
		if(i==n){
			if(MakeShift){x+=2;y+=2;}
			if(ChangeFont)ff=font1;
		};
		ShowString(x,y,s,ff);
	};
};
示例#7
0
文件: eeprom.c 项目: 0xBADCA7/lk
/**
 * @brief	main routine for EEPROM example
 * @return	Always returns 0
 */
int main(void)
{
	uint8_t *ptr = (uint8_t *) buffer;
	uint8_t ret_code;

	/* Generic Initialization */
	SystemCoreClockUpdate();
	Board_Init();

	/* Enable SysTick Timer */
	SysTick_Config(SystemCoreClock / TICKRATE_HZ);

	/* Enable EEPROM clock and reset EEPROM controller */
	Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_EEPROM);
	Chip_SYSCTL_PeriphReset(RESET_EEPROM);

	/* Data to be read from EEPROM */
	ret_code = Chip_EEPROM_Read(EEPROM_ADDRESS, ptr, IAP_NUM_BYTES_TO_READ_WRITE);

	/* Error checking */
	if (ret_code != IAP_CMD_SUCCESS) {
		DEBUGOUT("Command failed to execute, return code is: %x\r\n", ret_code);
	}

	/* Check and display string if it exists */
	ShowString((char *) ptr);

	/* Get a string to save */
	MakeString(ptr);

	/* Data to be written to EEPROM */
	ret_code = Chip_EEPROM_Write(EEPROM_ADDRESS, ptr, IAP_NUM_BYTES_TO_READ_WRITE);

	/* Error checking */
	if (ret_code == IAP_CMD_SUCCESS) {
		DEBUGSTR("EEPROM write passed\r\n");
	}
	else {
		DEBUGOUT("EEPROM write failed, return code is: %x\r\n", ret_code);
	}

	return 0;
}
示例#8
0
void DoExpose() {

   int i;
   _desc *curseur;

   for (i = NB_LINE; i; i--){
            XCopyArea(dpy, XPM, win, gc, 2, 22, 53, 9, X_PROC + 1, Y_PROC + ((i - 1) * 10));
            XCopyArea(dpy, XPM, iconWin, gc, 2, 22, 53, 9, X_PROC + 1, Y_PROC + ((i - 1) * 10));
   }

   if (gNbProc < NB_LINE) {
      int y;
      i = gNbProc;
      for (y = NB_LINE; y != gNbProc; y--) tabNoProc[y - 1] = -1;
   }
   else i = NB_LINE;

   for (curseur = posProc; i; curseur = curseur -> next, i--)
     {
	ShowString(X_PROC + 1, Y_PROC + (i - 1) * 10, curseur -> name);
	tabNoProc[i - 1] = curseur -> pid;
     }
}
示例#9
0
/**
 * @brief	Main routine for example_nandflash
 * @return	Nothing
 */
int main(void)
{
	K9F1G_ID_T nandId;
	const lpc_nandflash_size_t *flashInfo;
	uint32_t stSize, useBlock = BLOCK_INDEX;
	volatile int loop = 1, idx;	/* For debug message only */

	SystemCoreClockUpdate();
	Board_Init();
	Board_NANDFLash_Init();
	lpc_nandflash_init();

	/* Read flash information */
	flashInfo = lpc_nandflash_get_size();
	lpc_nandflash_get_id((uint8_t*)&nandId);
	DEBUGOUT(" Flash Information: \r\n");
	DEBUGOUT("      Manufacturer ID: 0x%02x\r\n", nandId.MarkerCode);
	DEBUGOUT("      Device ID: 0x%02x\r\n", nandId.DeviceCode);
	DEBUGOUT("      Page Size: %dB\r\n", flashInfo->page_size);
	DEBUGOUT("      Spare Size: %dB\r\n", flashInfo->spare_size);
	DEBUGOUT("      Block Size: %dKB\r\n", flashInfo->pages_per_block*flashInfo->page_size/1024);
	DEBUGOUT("      Block count: %d\r\n", flashInfo->block_cnt);

	/* Show bad block list */
	DEBUGOUT("Checking bad blocks...\r\n");
	for (idx = 0; idx < flashInfo->block_cnt; idx++) {
		if (checkBadBlock(idx)) {
			DEBUGOUT("      Bad block at %d\r\n", idx);
			if (useBlock == idx) {
				/* Skip to next block for the example if this one is bad */
				useBlock++;
			}
		}
	}

	/* Read data */
	lpc_nandflash_read_start(useBlock, PAGE_INDEX, 0);
	waitForReady();
	lpc_nandflash_read_data((uint8_t *) buffer, BUFFER_SIZE);

	/* Check and display string if it exists */
	ShowString((char *) buffer);

	/* Get a string to save */
	stSize = MakeString((uint8_t *) buffer);

	/* Erase flash */
	lpc_nandflash_erase_block(useBlock);
	waitForReady();

	/* Check the result of erasing */
	if(lpc_nandflash_read_status() & NANDFLASH_STATUS_BLOCK_ERASE_FAIL) {
		DEBUGSTR("Erase failed!!!\r\n");
		while(1){}
	}

	/* Write header + size + data to page */
	DEBUGSTR("\r\nWrite to flash...\r\n");
	lpc_nandflash_write_page(useBlock, PAGE_INDEX,(uint8_t *) buffer, (4 + stSize));
	waitForReady();
	
	/* Check the result of writting */
	if(lpc_nandflash_read_status() & NANDFLASH_STATUS_PAGE_PROG_FAIL) {
		DEBUGSTR("Writing failed!!!\r\n");
		while(1){}
	}

	DEBUGSTR("Reading back string...\r\n");

	/* Read all data from flash */
	lpc_nandflash_read_start(useBlock, PAGE_INDEX, 0);
	waitForReady();
	lpc_nandflash_read_data((uint8_t *) buffer, BUFFER_SIZE);

	/* Check and display string if it exists */
	ShowString((char *) buffer);

	/* Wait forever */
	while (loop) {}

	return 0;
}
示例#10
0
void CChannelN::ShowCode(double time /*seconds*/, ULONG code)
{
	char buf[256];
	sprintf(buf,"%d", code);
	ShowString(time, buf);
}
void ShowHint(){
	//ResFon(HintX,HintY,HintLx,HintLy);
	if(HintTime)ShowString(HintX,HintY,HintStr,&rlf_s);
	if(HintTime1)ShowString(HintX,HintY-20,HintStr1,&rlf_s);
	//ScrCopy(HintX,HintY,HintLx,HintLy);
};