コード例 #1
0
ファイル: brgameapp.cpp プロジェクト: andrekandore/burgerlib
Word BURGER_API Burger::GameApp::SwitchVideo(void)
{
	Word uResult = 10;
	// Is switching allowed?
	if (m_bAllowWindowSwitching) {
		// Is there a display class?
		Display *pDisplay = GetDisplay();
		if (pDisplay) {
#if defined(BURGER_WINDOWS)
			static_cast<WindowsApp *>(this)->KillInputFocus();
#endif
			pDisplay->Init(pDisplay->GetWidth(),pDisplay->GetHeight(),pDisplay->GetDepth(),pDisplay->GetFlags()^Display::FULLSCREEN);
#if defined(BURGER_WINDOWS)
			static_cast<WindowsApp *>(this)->GetInputFocus();
#endif
			uResult = 0;
		}
	}
	return uResult;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: dimtref/NetBurner-Power-Box
void UserMain(void * pd) {
    InitializeStack();
    OSChangePrio(MAIN_PRIO);
    EnableAutoUpdate();
    EnableTaskMonitor();

    #ifndef _DEBUG
    	EnableSmartTraps();
    #endif

    #ifdef _DEBUG
    	InitializeNetworkGDB_and_Wait();
    #endif

//    int fd = OpenSerial(9, 115200, 1, 8, eParityNone); // NetBurner 2.0: jack X5 - UART9, jack X4 - UART8

    PortsInit();

	iprintf("Initialization the LCD...\r\n");
	Display dis;
	dis.Init();

//	Tab *ta = new Tab("A", 170, 0, 22, 17, 8, 5 );
//	Tab *tb = new Tab("B", 170, 16, 22, 17, 8, 5 );
//	Tab *tc = new Tab("C", 170, 32, 22, 17, 7, 4 );
//	Tab *td = new Tab("All", 170, 48, 22, 16, 5, 4 );

		Tab *ta = new Tab("A", 170, 0, 22, 22, 8, 6 );
		Tab *tb = new Tab("B", 170, 21, 22, 22, 8, 6 );
		Tab *tc = new Tab("C", 170, 42, 22, 22, 7, 6 );


	Menu m;
	m.ta = ta;
	m.tb = tb;
	m.tc = tc;
//	m.td = td;
	m.disp = &dis;


	// Initialization Queues
	OSQInit( &BuzzerQueue, Buzzer_queue_data, BUZZER_QUEUE_SIZE );
	OSQInit( &DisplayQueue, Display_queue_data, DISPLAY_QUEUE_SIZE );

	// Initialization Tasks
	if( OSTaskCreate(PollKeyboardTask,
//					(void *) &fd,
					(void *) &m,
					(void *) &PollKeyboardTaskStack[USER_TASK_STK_SIZE],
					(void *) PollKeyboardTaskStack,
					MAIN_PRIO - 2 ) != OS_NO_ERR)
	{
		iprintf( "*** Error creating PollKeyboardTask\r\n" );
	}

	if( OSTaskCreate(DisplayingLCDTask,
					(void *) &m,
					(void *) &DisplayingLCDTaskStack[USER_TASK_STK_SIZE],
					(void *) DisplayingLCDTaskStack,
					MAIN_PRIO - 1 ) != OS_NO_ERR)
	{
		iprintf( "*** Error creating DisplayingLCDTask\r\n" );
	}

	if( OSTaskCreate(BuzzerTask,
					 NULL,
					(void *) &BuzzerTaskStack[USER_TASK_STK_SIZE],
					(void *) BuzzerTaskStack,
					MAIN_PRIO - 3 ) != OS_NO_ERR)
	{
		iprintf( "*** Error creating BuzzerTask\r\n" );
	}

    iprintf("Application started\n");
    while (1) {
        OSTimeDly(20);
    }
}