Use AzureRTOS ThreadX
This commit is contained in:
@ -18,11 +18,14 @@
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "app_threadx.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "ft_logo_orange_rgb565.h"
|
||||
#include "ft_logo_rainbow_rgb565.h"
|
||||
#include "hx8357d.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
@ -125,22 +128,17 @@ int main(void) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HX8357D_Init();
|
||||
HX8357D_Mode_RGB666();
|
||||
HAL_Delay(500);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
MX_ThreadX_Init();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1) {
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
uint32_t now = HAL_GetTick();
|
||||
GPIO_PinState status1 = (now / 500) % 2 == 0;
|
||||
GPIO_PinState status2 = (now / 1000) % 2 == 0;
|
||||
HAL_GPIO_WritePin(STATUS1_GPIO_Port, STATUS1_Pin, status1);
|
||||
HAL_GPIO_WritePin(STATUS2_GPIO_Port, STATUS2_Pin, status2);
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
@ -176,7 +174,7 @@ void SystemClock_Config(void) {
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.HSICalibrationValue = 64;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
@ -362,7 +360,7 @@ static void MX_LTDC_Init(void) {
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
||||
pLayerCfg.FBStartAdress = (uint32_t)&image_data_ft_logo_orange_rgb565;
|
||||
pLayerCfg.FBStartAdress = (uint32_t)&image_data_ft_logo_rainbow_rgb565;
|
||||
pLayerCfg.ImageWidth = 320;
|
||||
pLayerCfg.ImageHeight = 480;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
@ -730,6 +728,26 @@ static void MX_GPIO_Init(void) {
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM6 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6) {
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
|
||||
Reference in New Issue
Block a user