Skip to content

Commit

Permalink
Adding in remnants to make build build
Browse files Browse the repository at this point in the history
  • Loading branch information
nwdepatie committed Nov 23, 2023
1 parent 725da63 commit cbc4b36
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 8 deletions.
88 changes: 80 additions & 8 deletions Core/Src/stm32f4xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
__HAL_RCC_GPIOA_CLK_ENABLE();
/**ADC1 GPIO Configuration
PA0-WKUP ------> ADC1_IN0
PA1 ------> ADC1_IN1
PA2 ------> ADC1_IN2
PA3 ------> ADC1_IN3
*/
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3;
GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Expand All @@ -111,6 +108,49 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)

/* USER CODE END ADC1_MspInit 1 */
}
else if(hadc->Instance==ADC2)
{
/* USER CODE BEGIN ADC2_MspInit 0 */

/* USER CODE END ADC2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_ADC2_CLK_ENABLE();

__HAL_RCC_GPIOA_CLK_ENABLE();
/**ADC2 GPIO Configuration
PA1 ------> ADC2_IN1
*/
GPIO_InitStruct.Pin = GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

/* USER CODE BEGIN ADC2_MspInit 1 */

/* USER CODE END ADC2_MspInit 1 */
}
else if(hadc->Instance==ADC3)
{
/* USER CODE BEGIN ADC3_MspInit 0 */

/* USER CODE END ADC3_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_ADC3_CLK_ENABLE();

__HAL_RCC_GPIOA_CLK_ENABLE();
/**ADC3 GPIO Configuration
PA2 ------> ADC3_IN2
PA3 ------> ADC3_IN3
*/
GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

/* USER CODE BEGIN ADC3_MspInit 1 */

/* USER CODE END ADC3_MspInit 1 */
}

}

Expand All @@ -132,16 +172,48 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)

/**ADC1 GPIO Configuration
PA0-WKUP ------> ADC1_IN0
PA1 ------> ADC1_IN1
PA2 ------> ADC1_IN2
PA3 ------> ADC1_IN3
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0);

/* USER CODE BEGIN ADC1_MspDeInit 1 */

/* USER CODE END ADC1_MspDeInit 1 */
}
else if(hadc->Instance==ADC2)
{
/* USER CODE BEGIN ADC2_MspDeInit 0 */

/* USER CODE END ADC2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC2_CLK_DISABLE();

/**ADC2 GPIO Configuration
PA1 ------> ADC2_IN1
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1);

/* USER CODE BEGIN ADC2_MspDeInit 1 */

/* USER CODE END ADC2_MspDeInit 1 */
}
else if(hadc->Instance==ADC3)
{
/* USER CODE BEGIN ADC3_MspDeInit 0 */

/* USER CODE END ADC3_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC3_CLK_DISABLE();

/**ADC3 GPIO Configuration
PA2 ------> ADC3_IN2
PA3 ------> ADC3_IN3
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);

/* USER CODE BEGIN ADC3_MspDeInit 1 */

/* USER CODE END ADC3_MspDeInit 1 */
}

}

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Drivers/Embedded-Base/general/src/lsm6dso.c \
Drivers/Embedded-Base/general/src/sht30.c \
Drivers/Embedded-Base/platforms/stm32f405/src/can.c \
Drivers/Embedded-Base/general/src/pi4ioe.c \
Drivers/Embedded-Base/middleware/src/timer.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \
Expand Down Expand Up @@ -150,6 +151,7 @@ C_INCLUDES = \
-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
-IDrivers/Embedded-Base/general/include \
-IDrivers/Embedded-Base/platforms/stm32f405/include \
-IDrivers/Embedded-Base/middleware/include \
-IMiddlewares/Third_Party/FreeRTOS/Source/include \
-IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 \
-IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \
Expand Down

0 comments on commit cbc4b36

Please sign in to comment.