Formattage du code
This commit is contained in:
parent
7639207df4
commit
e117dbd01b
1 changed files with 109 additions and 130 deletions
|
@ -224,7 +224,8 @@ int main(void)
|
|||
/* We should never get here as control is now taken by the scheduler */
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1) {
|
||||
while (1)
|
||||
{
|
||||
/* Code de base */
|
||||
HAL_GPIO_WritePin(LED13_GPIO_Port, LED13_Pin,
|
||||
HAL_GPIO_ReadPin(BP1_GPIO_Port, BP1_Pin));
|
||||
|
@ -264,7 +265,8 @@ int main(void)
|
|||
BSP_LCD_DisplayStringAtLine(9, (uint8_t *)text);
|
||||
|
||||
BSP_TS_GetState(&TS_State);
|
||||
if (TS_State.touchDetected) {
|
||||
if (TS_State.touchDetected)
|
||||
{
|
||||
BSP_LCD_FillCircle(TS_State.touchX[0], TS_State.touchY[0], 4);
|
||||
}
|
||||
BSP_LCD_DisplyString(0, "coucou");
|
||||
|
@ -272,7 +274,6 @@ int main(void)
|
|||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
@ -318,8 +319,7 @@ void SystemClock_Config(void)
|
|||
}
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
|
@ -329,10 +329,7 @@ void SystemClock_Config(void)
|
|||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC|RCC_PERIPHCLK_RTC
|
||||
|RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_USART6
|
||||
|RCC_PERIPHCLK_UART7|RCC_PERIPHCLK_I2C1
|
||||
|RCC_PERIPHCLK_I2C3;
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC | RCC_PERIPHCLK_RTC | RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART6 | RCC_PERIPHCLK_UART7 | RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C3;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIN = 384;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIR = 5;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2;
|
||||
|
@ -398,7 +395,6 @@ static void MX_ADC1_Init(void)
|
|||
/* USER CODE BEGIN ADC1_Init 2 */
|
||||
|
||||
/* USER CODE END ADC1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -448,7 +444,6 @@ static void MX_ADC3_Init(void)
|
|||
/* USER CODE BEGIN ADC3_Init 2 */
|
||||
|
||||
/* USER CODE END ADC3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -486,7 +481,6 @@ static void MX_DAC_Init(void)
|
|||
/* USER CODE BEGIN DAC_Init 2 */
|
||||
|
||||
/* USER CODE END DAC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -523,7 +517,6 @@ static void MX_DMA2D_Init(void)
|
|||
/* USER CODE BEGIN DMA2D_Init 2 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -569,7 +562,6 @@ static void MX_I2C1_Init(void)
|
|||
/* USER CODE BEGIN I2C1_Init 2 */
|
||||
|
||||
/* USER CODE END I2C1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -615,7 +607,6 @@ static void MX_I2C3_Init(void)
|
|||
/* USER CODE BEGIN I2C3_Init 2 */
|
||||
|
||||
/* USER CODE END I2C3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -677,7 +668,6 @@ static void MX_LTDC_Init(void)
|
|||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -769,7 +759,6 @@ static void MX_RTC_Init(void)
|
|||
/* USER CODE BEGIN RTC_Init 2 */
|
||||
|
||||
/* USER CODE END RTC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -809,7 +798,6 @@ static void MX_SPI2_Init(void)
|
|||
/* USER CODE BEGIN SPI2_Init 2 */
|
||||
|
||||
/* USER CODE END SPI2_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -856,7 +844,6 @@ static void MX_TIM1_Init(void)
|
|||
/* USER CODE BEGIN TIM1_Init 2 */
|
||||
|
||||
/* USER CODE END TIM1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -901,7 +888,6 @@ static void MX_TIM2_Init(void)
|
|||
/* USER CODE BEGIN TIM2_Init 2 */
|
||||
|
||||
/* USER CODE END TIM2_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -967,7 +953,6 @@ static void MX_TIM3_Init(void)
|
|||
|
||||
/* USER CODE END TIM3_Init 2 */
|
||||
HAL_TIM_MspPostInit(&htim3);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1012,7 +997,6 @@ static void MX_TIM5_Init(void)
|
|||
/* USER CODE BEGIN TIM5_Init 2 */
|
||||
|
||||
/* USER CODE END TIM5_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1091,7 +1075,6 @@ static void MX_TIM8_Init(void)
|
|||
|
||||
/* USER CODE END TIM8_Init 2 */
|
||||
HAL_TIM_MspPostInit(&htim8);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1126,7 +1109,6 @@ static void MX_UART7_Init(void)
|
|||
/* USER CODE BEGIN UART7_Init 2 */
|
||||
|
||||
/* USER CODE END UART7_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1161,7 +1143,6 @@ static void MX_USART1_UART_Init(void)
|
|||
/* USER CODE BEGIN USART1_Init 2 */
|
||||
|
||||
/* USER CODE END USART1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1196,7 +1177,6 @@ static void MX_USART6_UART_Init(void)
|
|||
/* USER CODE BEGIN USART6_Init 2 */
|
||||
|
||||
/* USER CODE END USART6_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/* FMC initialization function */
|
||||
|
@ -1287,8 +1267,7 @@ static void MX_GPIO_Init(void)
|
|||
HAL_GPIO_WritePin(LCD_DISP_GPIO_Port, LCD_DISP_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOH, LED13_Pin|LED17_Pin|LED11_Pin|LED12_Pin
|
||||
|LED2_Pin|LED18_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOH, LED13_Pin | LED17_Pin | LED11_Pin | LED12_Pin | LED2_Pin | LED18_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(EXT_RST_GPIO_Port, EXT_RST_Pin, GPIO_PIN_RESET);
|
||||
|
@ -1301,8 +1280,7 @@ static void MX_GPIO_Init(void)
|
|||
|
||||
/*Configure GPIO pins : ULPI_D7_Pin ULPI_D6_Pin ULPI_D5_Pin ULPI_D2_Pin
|
||||
ULPI_D1_Pin ULPI_D4_Pin */
|
||||
GPIO_InitStruct.Pin = ULPI_D7_Pin|ULPI_D6_Pin|ULPI_D5_Pin|ULPI_D2_Pin
|
||||
|ULPI_D1_Pin|ULPI_D4_Pin;
|
||||
GPIO_InitStruct.Pin = ULPI_D7_Pin | ULPI_D6_Pin | ULPI_D5_Pin | ULPI_D2_Pin | ULPI_D1_Pin | ULPI_D4_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
|
@ -1375,8 +1353,7 @@ static void MX_GPIO_Init(void)
|
|||
|
||||
/*Configure GPIO pins : LED13_Pin LED17_Pin LED11_Pin LED12_Pin
|
||||
LED2_Pin LED18_Pin */
|
||||
GPIO_InitStruct.Pin = LED13_Pin|LED17_Pin|LED11_Pin|LED12_Pin
|
||||
|LED2_Pin|LED18_Pin;
|
||||
GPIO_InitStruct.Pin = LED13_Pin | LED17_Pin | LED11_Pin | LED12_Pin | LED2_Pin | LED18_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
@ -1424,7 +1401,6 @@ static void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
@ -1444,7 +1420,8 @@ void f_GameMaster(void const * argument)
|
|||
TickType_t xLastWakeTime;
|
||||
const TickType_t xPeriodeTache = 10;
|
||||
/* Infinite loop */
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
vTaskDelayUntil(&xLastWakeTime, xPeriodeTache);
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
|
@ -1523,7 +1500,8 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
|||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6) {
|
||||
if (htim->Instance == TIM6)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
@ -1540,7 +1518,8 @@ void Error_Handler(void)
|
|||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1) {
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue