Removed Pins

This commit is contained in:
Gregor Wüst 2021-02-19 11:51:30 +01:00
parent 861f73a5c6
commit 28707e084e
2 changed files with 25 additions and 22 deletions

View File

@ -70,14 +70,14 @@ void Error_Handler(void);
#define USART_TX_GPIO_Port GPIOA #define USART_TX_GPIO_Port GPIOA
#define USART_RX_Pin GPIO_PIN_3 #define USART_RX_Pin GPIO_PIN_3
#define USART_RX_GPIO_Port GPIOA #define USART_RX_GPIO_Port GPIOA
#define LD2_Pin GPIO_PIN_5 //#define LD2_Pin GPIO_PIN_5
#define LD2_GPIO_Port GPIOA //#define LD2_GPIO_Port GPIOA
#define TMS_Pin GPIO_PIN_13 #define TMS_Pin GPIO_PIN_13
#define TMS_GPIO_Port GPIOA #define TMS_GPIO_Port GPIOA
#define TCK_Pin GPIO_PIN_14 #define TCK_Pin GPIO_PIN_14
#define TCK_GPIO_Port GPIOA #define TCK_GPIO_Port GPIOA
#define SWO_Pin GPIO_PIN_3 //#define SWO_Pin GPIO_PIN_3
#define SWO_GPIO_Port GPIOB //#define SWO_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */ /* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */ /* USER CODE END Private defines */

View File

@ -424,20 +424,7 @@ int main(void)
HAL_Init(); HAL_Init();
/* USER CODE BEGIN Init */ /* USER CODE BEGIN Init */
//----- Init of the Motor control library
/* Set the L6208 library to use 1 device */
BSP_MotorControl_SetNbDevices(BSP_MOTOR_CONTROL_BOARD_ID_L6208, 1);
BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_L6208, NULL);
/* Attach the function MyFlagInterruptHandler (defined below) to the flag interrupt */
BSP_MotorControl_AttachFlagInterrupt(MyFlagInterruptHandler);
/* Attach the function MyErrorHandler (defined below) to the error Handler*/
BSP_MotorControl_AttachErrorHandler(Error_Handler);
/* Set Systick Interrupt priority highest to ensure no lock by using HAL_Delay */
HAL_NVIC_SetPriority(SysTick_IRQn, 0x0, 0x0);
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Disable the power bridges after initialization */
BSP_MotorControl_CmdDisable(0);
/* USER CODE END Init */ /* USER CODE END Init */
/* Configure the system clock */ /* Configure the system clock */
@ -453,6 +440,21 @@ int main(void)
MX_RTC_Init(); MX_RTC_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
//----- Init of the Motor control library
/* Set the L6208 library to use 1 device */
BSP_MotorControl_SetNbDevices(BSP_MOTOR_CONTROL_BOARD_ID_L6208, 1);
BSP_MotorControl_Init(BSP_MOTOR_CONTROL_BOARD_ID_L6208, NULL);
/* Attach the function MyFlagInterruptHandler (defined below) to the flag interrupt */
BSP_MotorControl_AttachFlagInterrupt(MyFlagInterruptHandler);
/* Attach the function MyErrorHandler (defined below) to the error Handler*/
BSP_MotorControl_AttachErrorHandler(Error_Handler);
/* Set Systick Interrupt priority highest to ensure no lock by using HAL_Delay */
HAL_NVIC_SetPriority(SysTick_IRQn, 0x0, 0x0);
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Disable the power bridges after initialization */
BSP_MotorControl_CmdDisable(0);
timeAndDate sunrise, sunset, wakeUpTimeForStep, tomorrowsDate, initialDate; timeAndDate sunrise, sunset, wakeUpTimeForStep, tomorrowsDate, initialDate;
sunrise = sunset = wakeUpTimeForStep = tomorrowsDate = initialDate = (timeAndDate) {\ sunrise = sunset = wakeUpTimeForStep = tomorrowsDate = initialDate = (timeAndDate) {\
0, 0,
@ -566,7 +568,8 @@ void SystemClock_Config(void)
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; //RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
@ -738,7 +741,7 @@ static void MX_GPIO_Init(void)
__HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET); //HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin : B1_Pin */ /*Configure GPIO pin : B1_Pin */
GPIO_InitStruct.Pin = B1_Pin; GPIO_InitStruct.Pin = B1_Pin;
@ -747,11 +750,11 @@ static void MX_GPIO_Init(void)
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : LD2_Pin */ /*Configure GPIO pin : LD2_Pin */
GPIO_InitStruct.Pin = LD2_Pin; //GPIO_InitStruct.Pin = LD2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct); //HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
} }