Skip to content

Commit

Permalink
Fixed Lich3.ioc to work with STM32CubeMX v6.5 and v6.7, regenerated c…
Browse files Browse the repository at this point in the history
…ode to update ADC4 signal
  • Loading branch information
pingdynasty committed Mar 5, 2023
1 parent f5486ed commit bac5f6c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 572 deletions.
4 changes: 2 additions & 2 deletions Lich3/Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ void Error_Handler(void);
#define CS_SDA_GPIO_Port GPIOE
#define EXTSPI_nCS_Pin GPIO_PIN_15
#define EXTSPI_nCS_GPIO_Port GPIOC
#define ADC4_Pin GPIO_PIN_6
#define ADC4_GPIO_Port GPIOF
#define LED_SW1_Pin GPIO_PIN_7
#define LED_SW1_GPIO_Port GPIOF
#define LED_SW2_Pin GPIO_PIN_8
#define LED_SW2_GPIO_Port GPIOF
#define DISPLAY_G_Pin GPIO_PIN_9
#define DISPLAY_G_GPIO_Port GPIOF
#define ADC4_Pin GPIO_PIN_10
#define ADC4_GPIO_Port GPIOF
#define OSC1_Pin GPIO_PIN_0
#define OSC1_GPIO_Port GPIOH
#define OSC2_Pin GPIO_PIN_1
Expand Down
25 changes: 14 additions & 11 deletions Lich3/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef hadc3;
ADC_HandleTypeDef hadc3;
DMA_HandleTypeDef hdma_adc3;

DAC_HandleTypeDef hdac1;
Expand Down Expand Up @@ -83,7 +83,7 @@ static void MX_USB_OTG_HS_HCD_Init(void);
static void MX_SAI1_Init(void);
static void MX_ADC3_Init(void);
static void MX_DAC1_Init(void);
void StartDefaultTask(void const *argument);
void StartDefaultTask(void const * argument);

/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
Expand All @@ -105,7 +105,8 @@ void MPU_Config(void);
* @brief The application entry point.
* @retval int
*/
int main(void) {
int main(void)
{
/* USER CODE BEGIN 1 */

#ifdef DEBUG
Expand Down Expand Up @@ -907,19 +908,19 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

/*Configure GPIO pin : PF6 */
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

/*Configure GPIO pins : LED_SW1_Pin LED_SW2_Pin DISPLAY_G_Pin */
GPIO_InitStruct.Pin = LED_SW1_Pin|LED_SW2_Pin|DISPLAY_G_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

/*Configure GPIO pin : PF10 */
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

/*Configure GPIO pins : FLASH_WP_Pin GATE_OUT_Pin DISPLAY_DP_Pin CS_CS_Pin
CS_RST_Pin USB_HOST_PWR_EN_Pin DISPLAY_F_Pin */
GPIO_InitStruct.Pin = FLASH_WP_Pin|GATE_OUT_Pin|DISPLAY_DP_Pin|CS_CS_Pin
Expand Down Expand Up @@ -1032,7 +1033,8 @@ static void MX_GPIO_Init(void)
* @retval None
*/
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const *argument) {
void StartDefaultTask(void const * argument)
{
/* USER CODE BEGIN 5 */
setup();

Expand All @@ -1047,7 +1049,8 @@ void StartDefaultTask(void const *argument) {
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void Error_Handler(void) {
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
#ifdef DEBUG
Expand Down
Loading

0 comments on commit bac5f6c

Please sign in to comment.