/** * @brief Main program. * @param None * @retval None */ int main(void) { /* 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 have a system clock = 168 Mhz */ SystemClock_Config(); /* Initialize LCD and LEDs */ BSP_Config(); /* Initialize RTC and Backup */ RTC_Init(); /* Init the STemWin GUI Library */ GUI_Init(); GUI_Initialized = 1; /* Activate the use of memory device feature */ WM_SetCreateFlags(WM_CF_MEMDEV); /* Do the calibration if needed */ CALIBRATION_Check(); /* Start Demo */ GUIDEMO_Main(); /* Infinite loop */ for(;;); }
/********************************************************************* * * MainTask */ void MainTask(void) { #if GUI_WINSUPPORT WM_SetCreateFlags(WM_CF_MEMDEV); #endif GUI_Init(); #if GUI_WINSUPPORT WM_MULTIBUF_Enable(1); #endif GUIDEMO_Main(); }
void rt_gui_thread_entry(void* parameter) { RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE); /*设置默认创建标记WM 然后会将 WM_PAINT 消息输出重定向到存储设备中,再复制到显 示器中。如果整个窗口的内存不够,会自动使用分段*/ WM_SetCreateFlags(WM_CF_MEMDEV); touch_config(); Timer5Config(); GUI_Init(); GUI_Initialized = 1; ADC_Config(); LED_Init(); RS485GPIOConfig(); RS485Write(); GUIDEMO_Main(); }
void MainTask(void) { // // Init GUI // WM_SetCreateFlags(WM_CF_MEMDEV); GUI_Init(); #if GUI_SUPPORT_CURSOR GUI_CURSOR_Hide(); // Hide cursor before first page is shown #endif // // Show SEGGER logo // GUI_Clear(); GUI_SetColor(GUI_WHITE); GUI_FillRect(0, 0, LCD_GetXSize(), LCD_GetYSize()); GUI_DrawBitmap(&bmIMAGE_SeggerLogo_300x150_565c, (LCD_GetXSize() - 300) / 2, (LCD_GetYSize() - 150) / 2); GUI_X_Delay(SEGGERDEMO_DELAY); GUI_Clear(); // // Start GUIDEMO samples, GUIDEMO_Main is an endless loop itself. Therefor we can start it as task directly. // GUIDEMO_Main(); }
void MainTask(void) { WM_SetCreateFlags(WM_CF_MEMDEV); GUI_Init(); WM_MULTIBUF_Enable(1); GUIDEMO_Main(); }
/********************************************************************* * * emWin * * Function description: * emWin demo application * */ void emWin(const T_choice *aChoice) { T_uezDevice hLCD; U32 FrameBufferSize; T_uezTask hTouchTask; (void)aChoice; FrameBufferSize = UEZ_LCD_DISPLAY_WIDTH * UEZ_LCD_DISPLAY_HEIGHT * GUI_NUM_VIRTUAL_DISPLAYS * GUI_PIXEL_WIDTH; GUI_pMem = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize); GUI_MemSize = (GUI_VRAM_SIZE - FrameBufferSize); memset((void*)GUI_VRAM_BASE_ADDR, 0, GUI_MemSize);//FrameBufferSize); // // Check that frame buffer memory fits into VRAM memory and we have empty memory left // if (GUI_VRAM_SIZE <= FrameBufferSize) { return; // Error, not enough memory } // // Assign memory left to emWin memory // //GUI_pMem = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize); //GUI_MemSize = (GUI_VRAM_SIZE - FrameBufferSize); // // emWin startup // #if EMWIN_LOAD_ONCE if(G_emWinLoaded == EFalse) { WM_SetCreateFlags(WM_CF_MEMDEV); // Enable memory devices GUI_Init(); G_emWinLoaded = ETrue; } #else WM_SetCreateFlags(WM_CF_MEMDEV); // Enable memory devices GUI_Init(); #endif // // Open the LCD // if (UEZLCDOpen("LCD", &hLCD) == UEZ_ERROR_NONE) { // // Create touch screen queue // if (UEZQueueCreate(1, sizeof(T_uezInputEvent), &_hTSQueue) == UEZ_ERROR_NONE) { // // Open touch screen // if (UEZTSOpen("Touchscreen", &_hTouchScreen, &_hTSQueue) == UEZ_ERROR_NONE) { // // Create touch task // if (UEZTaskCreate((T_uezTaskFunction)_TouchTask, "TouchTask", 1024, 0, UEZ_PRIORITY_VERY_HIGH, &hTouchTask) == UEZ_ERROR_NONE) { // // emWin application // GUIDEMO_Main(); _RequestExit = 1; while (_RequestExit == 1) { UEZTaskDelay(1); // Wait for touch task to terminate } } // // Close touch screen // UEZTSClose(_hTouchScreen, _hTSQueue); } UEZQueueDelete(_hTSQueue); } // // Close the LCD // UEZLCDClose(hLCD); } // // emWin cleanup // #if !EMWIN_LOAD_ONCE GUI_Exit(); #endif }
/** * @brief Main program. * @param None * @retval None */ int main(void) { /* 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 180 Mhz */ SystemClock_Config(); /* Initialize LCD and LEDs */ BSP_Config(); /***********************************************************/ /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */ uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1; /* Set TIMx instance */ TimHandle.Instance = TIM3; /* Initialize TIM3 peripheral as follows: + Period = 500 - 1 + Prescaler = ((SystemCoreClock/2)/10000) - 1 + ClockDivision = 0 + Counter direction = Up */ TimHandle.Init.Period = 500 - 1; TimHandle.Init.Prescaler = uwPrescalerValue; TimHandle.Init.ClockDivision = 0; TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP; if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK) { while(1) { } } /*##-2- Start the TIM Base generation in interrupt mode ####################*/ /* Start Channel1 */ if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK) { while(1) { } } /***********************************************************/ /* Initialize RTC and Backup */ RTC_Init(); /* Init the STemWin GUI Library */ GUI_Init(); GUI_Initialized = 1; /* Activate the use of memory device feature */ WM_SetCreateFlags(WM_CF_MEMDEV); /* Do the calibration if needed */ CALIBRATION_Check(); /* Start Demo */ GUIDEMO_Main(); /* Infinite loop */ for(;;); }
void guidemo(void) { GUIDEMO_Main(); }
void MainTask(void) { WM_SetCreateFlags(WM_CF_MEMDEV); GUI_Init(); GUIDEMO_Main(); }
static void app_delayed_action(void *arg) { GUIDEMO_Main(); LOG("helloworld %s:%d %s\r\n", __func__, __LINE__, aos_task_name()); aos_post_delayed_action(5000, app_delayed_action, NULL); }