/** * @brief Start task * @param argument: pointer that is passed to the thread function as start argument. * @retval None */ static void GUIThread(void const * argument) { /* Set General Graphical proprieties */ k_SetGuiProfile(); if(k_CalibrationIsDone() == 0) { GUI_SelectLayer(1); k_CalibrationInit(); GUI_SelectLayer(0); } /* Show the main menu */ k_InitMenu(); /* Gui background Task */ while(1) { GUI_Exec(); osDelay(30); } }
/** * @brief Start task * @param argument: pointer that is passed to the thread function as start argument. * @retval None */ static void GUIThread(void const * argument) { /* Initialize Storage Units */ k_StorageInit(); /* Set General Graphical proprieties */ k_SetGuiProfile(); #ifdef INCLUDE_THIRD_PARTY_MODULE if(*(__IO uint32_t *)(0x40024000) == GFX_DEMO_SIGNATURE_B) { *(__IO uint32_t *)(0x40024000) = 0; } else { /* Demo Startup */ k_StartUp(); } #else k_StartUp(); #endif /* Create Touch screen Timer */ osTimerDef(TS_Timer, TimerCallback); lcd_timer = osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, (void *)0); /* Start the TS Timer */ osTimerStart(lcd_timer, 30); /* Show the main menu */ k_InitMenu(); /* Gui background Task */ while(1) { GUI_Exec(); /* Do the background work ... Update windows etc.) */ osDelay(10); /* Nothing left to do for the moment ... Idle processing */ } }
/** * @brief Main program * @param None * @retval int */ int main(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; uint32_t FLatency; SystemSettingsTypeDef setting; osTimerId lcd_timer; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - Configure the Systick to generate an interrupt each 1 msec - Set NVIC Group Priority to 4 - Global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock to 168 MHz */ SystemClock_Config(); /* Initialize Joystick, Touch screen and LEDs */ k_BspInit(); k_LogInit(); /* Initialize memory pools */ k_MemInit(); /* Initialize audio Interface */ k_BspAudioInit(); /* Initialize RTC */ k_CalendarBkupInit(); /* Add Modules */ k_ModuleInit(); /* Create GUI task */ osThreadDef(GUI_Thread, GUIThread, osPriorityHigh, 0, 2048); osThreadCreate (osThread(GUI_Thread), NULL); k_ModuleAdd(&video_player); k_ModuleOpenLink(&video_player, "emf"); k_ModuleOpenLink(&video_player, "EMF"); k_ModuleAdd(&image_browser); k_ModuleOpenLink(&image_browser, "jpg"); k_ModuleOpenLink(&image_browser, "JPG"); k_ModuleOpenLink(&image_browser, "bmp"); k_ModuleOpenLink(&image_browser, "BMP"); k_ModuleAdd(&audio_player); k_ModuleOpenLink(&audio_player, "wav"); k_ModuleOpenLink(&audio_player, "WAV"); k_ModuleAdd(&camera_capture); k_ModuleAdd(&system_info); k_ModuleAdd(&file_browser); k_ModuleAdd(&cpu_bench); k_ModuleAdd(&game_board); k_ModuleAdd(&usb_device); /* Initialize GUI */ GUI_Init(); WM_MULTIBUF_Enable(1); /* Set General Graphical proprieties */ k_SetGuiProfile(); /* Get General settings */ setting.d32 = k_BkupRestoreParameter(CALIBRATION_GENERAL_SETTINGS_BKP); if(setting.b.use_180Mhz) { HAL_RCC_GetClockConfig(&RCC_ClkInitStruct, &FLatency); /* Select HSE as system clock source */ RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1); HAL_RCC_GetOscConfig(&RCC_OscInitStruct); RCC_OscInitStruct.PLL.PLLM = 25; RCC_OscInitStruct.PLL.PLLN = 360; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; HAL_RCC_OscConfig(&RCC_OscInitStruct); HAL_PWREx_EnableOverDrive(); /* Select PLL as system clock source */ RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); } /* Create Touch screen Timer */ osTimerDef(TS_Timer, TimerCallback); lcd_timer = osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, (void *)0); /* Start the TS Timer */ osTimerStart(lcd_timer, 55); GUI_X_InitOS(); /* Start scheduler */ osKernelStart(); /* We should never get here as control is now taken by the scheduler */ for( ;; ); }
/** * @brief Main program * @param None * @retval int */ int main(void) { osTimerId lcd_timer; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - Configure the Systick to generate an interrupt each 1 msec - Set NVIC Group Priority to 4 - Global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock to 168 MHz */ SystemClock_Config(); /* Initialize Joystick, Touch screen and Leds */ k_BspInit(); k_LogInit(); /* Initializes backup domain */ k_CalendarBkupInit(); /* Create GUI task */ osThreadDef(GUI_Thread, GUIThread, osPriorityHigh, 0, 1024); osThreadCreate (osThread(GUI_Thread), NULL); /*Initialize memory pools */ k_MemInit(); /* Add Modules*/ k_ModuleInit(); k_ModuleAdd(&video_player); k_ModuleOpenLink(&video_player, "emf"); k_ModuleOpenLink(&video_player, "EMF"); k_ModuleAdd(&image_browser); k_ModuleOpenLink(&image_browser, "jpg"); k_ModuleOpenLink(&image_browser, "JPG"); k_ModuleOpenLink(&image_browser, "bmp"); k_ModuleOpenLink(&image_browser, "BMP"); k_ModuleAdd(&audio_player); k_ModuleOpenLink(&audio_player, "wav"); k_ModuleOpenLink(&audio_player, "WAV"); k_ModuleAdd(&camera_capture); k_ModuleAdd(&system_info); k_ModuleAdd(&file_browser); k_ModuleAdd(&cpu_bench); k_ModuleAdd(&game_board); k_ModuleAdd(&usb_device); /* Initialize GUI */ GUI_Init(); /* Enable memory devices */ WM_SetCreateFlags(WM_CF_MEMDEV); /* Set General Graphical proprieties */ k_SetGuiProfile(); /* Create Touch screen Timer */ osTimerDef(TS_Timer, TimerCallback); lcd_timer = osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, (void *)0); /* Start the TS Timer */ osTimerStart(lcd_timer, 40); GUI_X_InitOS(); /* Start scheduler */ osKernelStart(); /* We should never get here as control is now taken by the scheduler */ for( ;; ); }
/** * @brief Main program * @param None * @retval int */ int main(void) { /* Configure the MPU attributes as Write Through */ MPU_Config(); /* Enable the CPU Cache */ CPU_CACHE_Enable(); /* STM32F7xx HAL library initialization: - Configure the Flash ART accelerator on ITCM interface - Configure the Systick to generate an interrupt each 1 msec - Set NVIC Group Priority to 4 - Global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock @ 200 Mhz */ SystemClock_Config(); k_BspInit(); /* Initialize RTC */ k_CalendarBkupInit(); /* Create GUI task */ osThreadDef(GUI_Thread, GUIThread, osPriorityNormal, 0, 2048); osThreadCreate (osThread(GUI_Thread), NULL); /* Add Modules*/ k_ModuleInit(); /* Link modules */ k_ModuleAdd(&audio_player_board); k_ModuleAdd(&video_player_board); k_ModuleAdd(&games_board); k_ModuleAdd(&audio_recorder_board); k_ModuleAdd(&gardening_control_board); k_ModuleAdd(&home_alarm_board); k_ModuleAdd(&vnc_server); k_ModuleAdd(&settings_board); /* Initialize GUI */ GUI_Init(); WM_MULTIBUF_Enable(1); GUI_SetLayerVisEx (1, 0); GUI_SelectLayer(0); GUI_SetBkColor(GUI_WHITE); GUI_Clear(); /* Set General Graphical proprieties */ k_SetGuiProfile(); /* Create Touch screen Timer */ osTimerDef(TS_Timer, TimerCallback); lcd_timer = osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, (void *)0); /* Start the TS Timer */ osTimerStart(lcd_timer, 100); /* Start scheduler */ osKernelStart (); /* We should never get here as control is now taken by the scheduler */ for( ;; ); }