/****************************************************************************** * Function Name: HardwareSetup * Description : This function does initial setting for CPG port pins used in * : the Demo including the MII pins of the Ethernet PHY connection. * Arguments : none * Return Value : none ******************************************************************************/ void HardwareSetup(void) { /* Gain access to the System control registers */ /* Refer to section 13 of the Hardware User Manual for further details */ SYSTEM.PRCR.WORD = 0xA503; /* Gain access to the Port Function Select Registers */ /* Refer to section 21 of the Hardware User Manual for further details */ MPC.PWPR.BIT.B0WI = 0; MPC.PWPR.BIT.PFSWE = 1; /* CPG setting */ /* User defined values for XTAL, Clock Divders etc are set in cgc.h */ InitCGC(); /* Setup the port pins */ ConfigurePortPins(); /* Enables peripherals */ EnablePeripheralModules(); #if INCLUDE_LCD == 1 /* Initialize display */ InitialiseDisplay(); #endif }
/****************************************************************************** * Function Name: HardwareSetup * Description : This function does initial setting for CPG port pins used in * : the Demo including the MII pins of the Ethernet PHY connection. * Arguments : none * Return Value : none ******************************************************************************/ void HardwareSetup(void) { /* CPG setting */ io_set_cpg(); /* Setup the port pins */ ConfigurePortPins(); /* Enables peripherals */ EnablePeripheralModules(); #if INCLUDE_LCD == 1 /* Initialize display */ InitialiseDisplay(); #endif }
bool UIDirect3D9Window::Initialise(void) { // register for raw input RAWINPUTDEVICE rid[2]; // media centre buttons (DVD, Music, Pictures, TV) rid[0].usUsagePage = 0xFFBC; rid[0].usUsage = 0x88; rid[0].dwFlags = RIDEV_INPUTSINK; rid[0].hwndTarget = winId(); // consumer controls (Guide, Details) // but may also double up various buttons via WM_INPUT and WM_APPCOMMAND rid[1].usUsagePage = 0x0C; rid[1].usUsage = 0x01; rid[1].dwFlags = RIDEV_INPUTSINK; rid[1].hwndTarget = winId(); if (!RegisterRawInputDevices(rid, 2, sizeof(rid[0]))) LOG(VB_GENERAL, LOG_ERR, "Failed to register raw input devices."); setObjectName("MainWindow"); TorcReferenceCounter::EventLoopEnding(false); gLocalContext->SetUIObject(this); gLocalContext->AddObserver(this); show(); InitialiseDisplay(); setGeometry(0, 0, m_pixelSize.width(), m_pixelSize.height()); setFixedSize(m_pixelSize); raise(); setCursor(Qt::BlankCursor); grabKeyboard(); SetRefreshRate(m_refreshRate); m_mainTimer = startTimer(0); return InitialiseDirect3D9(); }
void vStartButtonAndLCDDemo( void ) { prvSetupButtonIOAndInterrupts(); InitialiseDisplay(); /* Create the mutex used to guard the LCD. */ xLCDMutex = xSemaphoreCreateMutex(); configASSERT( xLCDMutex ); /* Create the queue used to pass commands from the IRQ interrupts to the prvLCDTaskLine2() task. */ xButtonCommandQueue = xQueueCreate( lcdCOMMAND_QUEUE_LENGTH, sizeof( unsigned char ) ); configASSERT( xButtonCommandQueue ); /* Start the two tasks as described at the top of this file. */ xTaskCreate( prvLCDTaskLine1, "LCD1", configMINIMAL_STACK_SIZE * 3, ( void * ) &xLCDLine1, tskIDLE_PRIORITY + 1, NULL ); xTaskCreate( prvLCDTaskLine2, "LCD2", configMINIMAL_STACK_SIZE * 3, ( void * ) &xLCDLine2, tskIDLE_PRIORITY + 2, NULL ); }
Framework::Framework() { #ifdef WRITE_LOG printf( "Framework: Startup\n" ); #endif // Init Allegro if( !al_init() ) { return; } al_init_font_addon(); if( !al_install_keyboard() || !al_install_mouse() || !al_init_primitives_addon() || !al_init_ttf_addon() || !al_init_image_addon() ) { return; } if( al_install_joystick() ) { al_reconfigure_joysticks(); } audioInitialised = false; InitialiseAudioSystem(); std::string selectedLanguage; quitProgram = false; ProgramStages = new StageStack(); framesToProcess = 0; Settings = new ConfigFile( "settings.cfg" ); eventQueue = al_create_event_queue(); InitialiseDisplay(); al_register_event_source( eventQueue, al_get_keyboard_event_source() ); al_register_event_source( eventQueue, al_get_mouse_event_source() ); fpsTimer = al_create_timer( 1.0 / (float)FRAMES_PER_SECOND ); al_register_event_source( eventQueue, al_get_timer_event_source( fpsTimer ) ); al_start_timer( fpsTimer ); al_hide_mouse_cursor( displaySurface ); imageMgr = new ImageManager( this ); fontMgr = new FontManager( this ); audioMgr = new AudioManager( this ); int maxDownloads = 4; if( Settings->KeyExists( "Downloads.MaxConcurrentDownloads" ) ) { Settings->GetIntegerValue( "Downloads.MaxConcurrentDownloads", &maxDownloads ); } downloadMgr = new DownloadManager( this, maxDownloads ); networkMgr = new NetworkManager( this ); languageMgr = new LanguageManager(); if( Settings->KeyExists( "Application.Language" ) ) { Settings->GetStringValue( "Application.Language", &selectedLanguage ); languageMgr->SetActiveLanguage( selectedLanguage ); } NativePlatform = new Platform(); SystemFramework = this; extraEventsMutex = al_create_mutex(); }