error: #20: identifier “__HAL_RCC_GPIOA_CLK_ENABLE“ is undefined

..\..\User\main.c(21): error:  #20: identifier "__HAL_RCC_GPIOA_CLK_ENABLE" is undefined解决办法L:__HAL_RCC_GPIOA_CLK_ENABLE();少了个括号,今天发现的,留给自己看的。

main.c(24): warning: #223-D: function "HAL_Init" declared implicitly HAL_Init(); main.c(31): warning: #223-D: function "HAL_GPIO_ReadPin" declared implicitly uint8_t left_sensor_state = HAL_GPIO_ReadPin(SENSOR_PORT, LEFT_SENSOR_PIN); main.c(31): error: #20: identifier "GPIO_PIN_0" is undefined uint8_t left_sensor_state = HAL_GPIO_ReadPin(SENSOR_PORT, LEFT_SENSOR_PIN); main.c(32): error: #20: identifier "GPIO_PIN_1" is undefined uint8_t right_sensor_state = HAL_GPIO_ReadPin(SENSOR_PORT, RIGHT_SENSOR_PIN); main.c(34): error: #20: identifier "GPIO_PIN_SET" is undefined if (left_sensor_state == GPIO_PIN_SET && right_sensor_state == GPIO_PIN_RESET) main.c(34): error: #20: identifier "GPIO_PIN_RESET" is undefined if (left_sensor_state == GPIO_PIN_SET && right_sensor_state == GPIO_PIN_RESET) main.c(38): warning: #223-D: function "HAL_Delay" declared implicitly HAL_Delay(1000); // 鍋囪鏃嬭浆鏃堕棿涓?s main.c(47): warning: #223-D: function "HAL_Delay" declared implicitly HAL_Delay(1000); // 鍋囪鏃嬭浆鏃堕棿涓?s main.c(61): error: #20: identifier "RCC_OscInitTypeDef" is undefined RCC_OscInitTypeDef RCC_OscInitStruct = {0}; main.c(62): error: #20: identifier "RCC_ClkInitTypeDef" is undefined RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; main.c(64): error: #20: identifier "RCC_OSCILLATORTYPE_HSI" is undefined RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; main.c(65): error: #20: identifier "RCC_HSI_ON" is undefined RCC_OscInitStruct.HSIState = RCC_HSI_ON; main.c(66): error: #20: identifier "RCC_HSICALIBRATION_DEFAULT" is undefined RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; main.c(67): error: #20: identifier "RCC_PLL_NONE" is undefined RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; main.c(68): warning: #223-D: function "HAL_RCC_OscConfig" declared implicitly if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) main.c(68): error: #20: identifier "HAL_OK" is undefined if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) main.c(70): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); main.c(73): error: #20: identifier "RCC_CLOCKTYPE_HCLK" is undefined RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK main.c(73): error: #20: identifier "RCC_CLOCKTYPE_SYSCLK" is undefined RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK main.c(74): error: #20: identifier "RCC_CLOCKTYPE_PCLK1" is undefined |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; main.c(74): error: #20: identifier "RCC_CLOCKTYPE_PCLK2" is undefined |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; main.c(75): error: #20: identifier "RCC_SYSCLKSOURCE_HSI" is undefined RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; main.c(76): error: #20: identifier "RCC_SYSCLK_DIV1" is undefined RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; main.c(77): error: #20: identifier "RCC_HCLK_DIV1" is undefined RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; main.c(80): warning: #223-D: function "HAL_RCC_ClockConfig" declared implicitly if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) main.c(80): error: #20: identifier "FLASH_LATENCY_0" is undefined if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) main.c(80): error: #20: identifier "HAL_OK" is undefined if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) main.c(82): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); main.c(90): warning: #223-D: function "__HAL_RCC_GPIOA_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOA_CLK_ENABLE(); main.c(93): error: #136: struct "<unnamed>" has no field "Pin" GPIO_InitStruct.Pin = LEFT_SENSOR_PIN | RIGHT_SENSOR_PIN; main.c(93): error: #20: identifier "GPIO_PIN_0" is undefined GPIO_InitStruct.Pin = LEFT_SENSOR_PIN | RIGHT_SENSOR_PIN; main.c(93): error: #20: identifier "GPIO_PIN_1" is undefined GPIO_InitStruct.Pin = LEFT_SENSOR_PIN | RIGHT_SENSOR_PIN; main.c(94): error: #136: struct "<unnamed>" has no field "Mode" GPIO_InitStruct.Mode = GPIO_MODE_INPUT; main.c(94): error: #20: identifier "GPIO_MODE_INPUT" is undefined GPIO_InitStruct.Mode = GPIO_MODE_INPUT; main.c(95): error: #136: struct "<unnamed>" has no field "Pull" GPIO_InitStruct.Pull = GPIO_NOPULL; main.c(95): error: #20: identifier "GPIO_NOPULL" is undefined GPIO_InitStruct.Pull = GPIO_NOPULL; main.c(96): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(SENSOR_PORT, &GPIO_InitStruct); main.c(99): error: #136: struct "<unnamed>" has no field "Pin" GPIO_InitStruct.Pin = IN1_PIN | IN2_PIN | IN3_PIN | IN4_PIN; main.c(99): error: #20: identifier "GPIO_PIN_2" is undefined GPIO_InitStruct.Pin = IN1_PIN | IN2_PIN | IN3_PIN | IN4_PIN; main.c(99): error: #20: identifier "GPIO_PIN_3" is undefined GPIO_InitStruct.Pin = IN1_PIN | IN2_PIN | IN3_PIN | IN4_PIN; main.c: 10 warnings, 30 errors compiling car_control.c... "..\OBJ\STM32F103.axf" - 30 Error(s), 10 Warning(s).
最新发布
01-07
*** Using Compiler &#39;V5.06 update 5 (build 528)&#39;, folder: &#39;E:\stm32\ARM\ARMCC\Bin&#39; Build target &#39;BreathingLightProMax&#39; compiling i2c.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/i2c.h(35): error: #20: identifier "I2C_HandleTypeDef" is undefined extern I2C_HandleTypeDef hi2c1; ../Core/Src/i2c.c(27): error: #20: identifier "I2C_HandleTypeDef" is undefined I2C_HandleTypeDef hi2c1; ../Core/Src/i2c.c(40): error: #20: identifier "I2C1" is undefined hi2c1.Instance = I2C1; ../Core/Src/i2c.c(42): error: #20: identifier "I2C_DUTYCYCLE_2" is undefined hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; ../Core/Src/i2c.c(44): error: #20: identifier "I2C_ADDRESSINGMODE_7BIT" is undefined hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; ../Core/Src/i2c.c(45): error: #20: identifier "I2C_DUALADDRESS_DISABLE" is undefined hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; ../Core/Src/i2c.c(47): error: #20: identifier "I2C_GENERALCALL_DISABLE" is undefined hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; ../Core/Src/i2c.c(48): error: #20: identifier "I2C_NOSTRETCH_DISABLE" is undefined hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; ../Core/Src/i2c.c(49): warning: #223-D: function "HAL_I2C_Init" declared implicitly if (HAL_I2C_Init(&hi2c1) != HAL_OK) ../Core/Src/i2c.c(49): error: #20: identifier "HAL_OK" is undefined if (HAL_I2C_Init(&hi2c1) != HAL_OK) ../Core/Src/i2c.c(51): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/i2c.c(59): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) ../Core/Src/i2c.c(62): error: #20: identifier "GPIO_InitTypeDef" is undefined GPIO_InitTypeDef GPIO_InitStruct = {0}; ../Core/Src/i2c.c(63): error: #20: identifier "I2C1" is undefined if(i2cHandle->Instance==I2C1) ../Core/Src/i2c.c(69): warning: #223-D: function "__HAL_RCC_GPIOB_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOB_CLK_ENABLE(); ../Core/Src/i2c.c(74): error: #20: identifier "GPIO_PIN_6" is undefined GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; ../Core/Src/i2c.c(74): error: #20: identifier "GPIO_PIN_7" is undefined GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; ../Core/Src/i2c.c(75): error: #20: identifier "GPIO_MODE_AF_OD" is undefined GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; ../Core/Src/i2c.c(76): error: #20: identifier "GPIO_SPEED_FREQ_HIGH" is undefined GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; ../Core/Src/i2c.c(77): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/i2c.c(77): error: #20: identifier "GPIOB" is undefined HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/i2c.c(80): warning: #223-D: function "__HAL_RCC_I2C1_CLK_ENABLE" declared implicitly __HAL_RCC_I2C1_CLK_ENABLE(); ../Core/Src/i2c.c(87): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) ../Core/Src/i2c.c(90): error: #20: identifier "I2C1" is undefined if(i2cHandle->Instance==I2C1) ../Core/Src/i2c.c(96): warning: #223-D: function "__HAL_RCC_I2C1_CLK_DISABLE" declared implicitly __HAL_RCC_I2C1_CLK_DISABLE(); ../Core/Src/i2c.c(102): warning: #223-D: function "HAL_GPIO_DeInit" declared implicitly HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(102): error: #20: identifier "GPIOB" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(102): error: #20: identifier "GPIO_PIN_6" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(104): error: #20: identifier "GPIO_PIN_7" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7); ../Core/Src/i2c.c: 7 warnings, 23 errors compiling stm32f1xx_hal_msp.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/stm32f1xx_hal_msp.c(70): warning: #223-D: function "__HAL_RCC_AFIO_CLK_ENABLE" declared implicitly __HAL_RCC_AFIO_CLK_ENABLE(); ../Core/Src/stm32f1xx_hal_msp.c(71): warning: #223-D: function "__HAL_RCC_PWR_CLK_ENABLE" declared implicitly __HAL_RCC_PWR_CLK_ENABLE(); ../Core/Src/stm32f1xx_hal_msp.c(77): warning: #223-D: function "__HAL_AFIO_REMAP_SWJ_NOJTAG" declared implicitly __HAL_AFIO_REMAP_SWJ_NOJTAG(); ../Core/Src/stm32f1xx_hal_msp.c: 3 warnings, 1 error compiling stm32f1xx_it.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/stm32f1xx_it.c(58): error: #20: identifier "UART_HandleTypeDef" is undefined extern UART_HandleTypeDef huart3; ../Core/Src/stm32f1xx_it.c(188): warning: #223-D: function "HAL_IncTick" declared implicitly HAL_IncTick(); ../Core/Src/stm32f1xx_it.c(209): warning: #223-D: function "HAL_UART_IRQHandler" declared implicitly HAL_UART_IRQHandler(&huart3); ../Core/Src/stm32f1xx_it.c: 2 warnings, 2 errors compiling usart.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/usart.h(37): error: #20: identifier "uint16_t" is undefined extern uint16_t current_freq; ../Core/Inc/usart.h(38): error: #20: identifier "uint16_t" is undefined extern uint16_t current_duty; ../Core/Inc/usart.h(41): error: #20: identifier "UART_HandleTypeDef" is undefined extern UART_HandleTypeDef huart3; ../Core/Inc/usart.h(45): error: #20: identifier "uint32_t" is undefined void VOFA_Send(float *data, uint32_t count); ../Core/Src/usart.c(24): error: #20: identifier "uint8_t" is undefined const uint8_t firewave_head[FIREWAVE_HEAD_LEN] = {0xAA, 0x07, 0x00, 0x00}; ../Core/Src/usart.c(25): error: #20: identifier "uint8_t" is undefined const uint8_t firewave_tail[FIREWAVE_TAIL_LEN] = {0x00, 0x00, 0x07, 0xAA}; ../Core/Src/usart.c(30): error: #20: identifier "UART_HandleTypeDef" is undefined UART_HandleTypeDef huart3; ../Core/Src/usart.c(44): error: #20: identifier "USART3" is undefined huart3.Instance = USART3; ../Core/Src/usart.c(46): error: #20: identifier "UART_WORDLENGTH_8B" is undefined huart3.Init.WordLength = UART_WORDLENGTH_8B; ../Core/Src/usart.c(47): error: #20: identifier "UART_STOPBITS_1" is undefined huart3.Init.StopBits = UART_STOPBITS_1; ../Core/Src/usart.c(48): error: #20: identifier "UART_PARITY_NONE" is undefined huart3.Init.Parity = UART_PARITY_NONE; ../Core/Src/usart.c(49): error: #20: identifier "UART_MODE_TX_RX" is undefined huart3.Init.Mode = UART_MODE_TX_RX; ../Core/Src/usart.c(50): error: #20: identifier "UART_HWCONTROL_NONE" is undefined huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE; ../Core/Src/usart.c(51): error: #20: identifier "UART_OVERSAMPLING_16" is undefined huart3.Init.OverSampling = UART_OVERSAMPLING_16; ../Core/Src/usart.c(52): warning: #223-D: function "HAL_UART_Init" declared implicitly if (HAL_UART_Init(&huart3) != HAL_OK) ../Core/Src/usart.c(52): error: #20: identifier "HAL_OK" is undefined if (HAL_UART_Init(&huart3) != HAL_OK) ../Core/Src/usart.c(54): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/usart.c(62): error: #20: identifier "UART_HandleTypeDef" is undefined void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) ../Core/Src/usart.c(65): error: #20: identifier "GPIO_InitTypeDef" is undefined GPIO_InitTypeDef GPIO_InitStruct = {0}; ../Core/Src/usart.c(66): error: #20: identifier "USART3" is undefined if(uartHandle->Instance==USART3) ../Core/Src/usart.c(72): warning: #223-D: function "__HAL_RCC_USART3_CLK_ENABLE" declared implicitly __HAL_RCC_USART3_CLK_ENABLE(); ../Core/Src/usart.c(74): warning: #223-D: function "__HAL_RCC_GPIOB_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOB_CLK_ENABLE(); ../Core/Src/usart.c(79): error: #20: identifier "GPIO_PIN_10" is undefined GPIO_InitStruct.Pin = GPIO_PIN_10; ../Core/Src/usart.c(80): error: #20: identifier "GPIO_MODE_AF_PP" is undefined GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; ../Core/Src/usart.c(81): error: #20: identifier "GPIO_SPEED_FREQ_HIGH" is undefined GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; ../Core/Src/usart.c(82): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/usart.c(82): error: #20: identifier "GPIOB" is undefined HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/usart.c(84): error: #20: identifier "GPIO_PIN_11" is undefined GPIO_InitStruct.Pin = GPIO_PIN_11; ../Core/Src/usart.c(85): error: #20: identifier "GPIO_MODE_INPUT" is undefined GPIO_InitStruct.Mode = GPIO_MODE_INPUT; ../Core/Src/usart.c(86): error: #20: identifier "GPIO_NOPULL" is undefined GPIO_InitStruct.Pull = GPIO_NOPULL; ../Core/Src/usart.c(90): warning: #223-D: function "HAL_NVIC_SetPriority" declared implicitly HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); ../Core/Src/usart.c(90): error: #20: identifier "USART3_IRQn" is undefined HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); ../Core/Src/usart.c(91): warning: #223-D: function "HAL_NVIC_EnableIRQ" declared implicitly HAL_NVIC_EnableIRQ(USART3_IRQn); ../Core/Src/usart.c(98): error: #20: identifier "UART_HandleTypeDef" is undefined void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) ../Core/Src/usart.c(101): error: #20: identifier "USART3" is undefined if(uartHandle->Instance==USART3) ../Core/Src/usart.c(107): warning: #223-D: function "__HAL_RCC_USART3_CLK_DISABLE" declared implicitly __HAL_RCC_USART3_CLK_DISABLE(); ../Core/Src/usart.c(113): warning: #223-D: function "HAL_GPIO_DeInit" declared implicitly HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11); ../Core/Src/usart.c(113): error: #20: identifier "GPIOB" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11); ../Core/Src/usart.c: 9 warnings, 30 errors compiling tim.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/tim.h(32): error: #20: identifier "uint16_t" is undefined extern uint16_t current_freq; ../Core/Inc/tim.h(33): error: #20: identifier "uint16_t" is undefined extern uint16_t current_duty; ../Core/Inc/tim.h(36): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim1; ../Core/Inc/tim.h(38): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim2; ../Core/Inc/tim.h(40): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim3; ../Core/Inc/tim.h(42): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim4; ../Core/Inc/tim.h(53): error: #20: identifier "TIM_HandleTypeDef" is undefined void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); ../Core/Src/tim.c(27): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim1; ../Core/Src/tim.c(28): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim2; ../Core/Src/tim.c(29): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim3; ../Core/Src/tim.c(30): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim4; ../Core/Src/tim.c(40): error: #20: identifier "TIM_ClockConfigTypeDef" is undefined TIM_ClockConfigTypeDef sClockSourceConfig = {0}; ../Core/Src/tim.c(41): error: #20: identifier "TIM_MasterConfigTypeDef" is undefined TIM_MasterConfigTypeDef sMasterConfig = {0}; ../Core/Src/tim.c(42): error: #20: identifier "TIM_OC_InitTypeDef" is undefined TIM_OC_InitTypeDef sConfigOC = {0}; ../Core/Src/tim.c(43): error: #20: identifier "TIM_BreakDeadTimeConfigTypeDef" is undefined TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; ../Core/Src/tim.c(48): error: #20: identifier "TIM1" is undefined htim1.Instance = TIM1; ../Core/Src/tim.c(50): error: #20: identifier "TIM_COUNTERMODE_UP" is undefined htim1.Init.CounterMode = TIM_COUNTERMODE_UP; ../Core/Src/tim.c(52): error: #20: identifier "TIM_CLOCKDIVISION_DIV1" is undefined htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; ../Core/Src/tim.c(54): error: #20: identifier "TIM_AUTORELOAD_PRELOAD_ENABLE" is undefined htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; ../Core/Src/tim.c(55): warning: #223-D: function "HAL_TIM_Base_Init" declared implicitly if (HAL_TIM_Base_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(55): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_Base_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(57): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(59): error: #20: identifier "TIM_CLOCKSOURCE_INTERNAL" is undefined sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; ../Core/Src/tim.c(60): warning: #223-D: function "HAL_TIM_ConfigClockSource" declared implicitly if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) ../Core/Src/tim.c(60): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) ../Core/Src/tim.c(62): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(64): warning: #223-D: function "HAL_TIM_PWM_Init" declared implicitly if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(64): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(66): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(68): warning: #223-D: function "HAL_TIM_OC_Init" declared implicitly if (HAL_TIM_OC_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(68): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_OC_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(70): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(72): error: #20: identifier "TIM_TRGO_RESET" is undefined sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; ../Core/Src/tim.c(73): error: #20: identifier "TIM_MASTERSLAVEMODE_DISABLE" is undefined sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; ../Core/Src/tim.c(74): warning: #223-D: function "HAL_TIMEx_MasterConfigSynchronization" declared implicitly if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) ../Core/Src/tim.c(74): error: #20: identifier "HAL_OK" is undefined if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) ../Core/Src/tim.c(76): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(78): error: #20: identifier "TIM_OCMODE_PWM1" is undefined sConfigOC.OCMode = TIM_OCMODE_PWM1; ../Core/Src/tim.c(80): error: #20: identifier "TIM_OCPOLARITY_HIGH" is undefined sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; ../Core/Src/tim.c: 10 warnings, 30 errors compiling gpio.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/gpio.c(45): error: #20: identifier "GPIO_InitTypeDef" is undefined GPIO_InitTypeDef GPIO_InitStruct = {0}; ../Core/Src/gpio.c(48): warning: #223-D: function "__HAL_RCC_GPIOD_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOD_CLK_ENABLE(); ../Core/Src/gpio.c(49): warning: #223-D: function "__HAL_RCC_GPIOA_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOA_CLK_ENABLE(); ../Core/Src/gpio.c(50): warning: #223-D: function "__HAL_RCC_GPIOB_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOB_CLK_ENABLE(); ../Core/Src/gpio.c(54): error: #20: identifier "K3_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K4_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K5_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K6_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(55): error: #20: identifier "K1_Pin" is undefined |K1_Pin|K2_Pin; ../Core/Src/gpio.c(55): error: #20: identifier "K2_Pin" is undefined |K1_Pin|K2_Pin; ../Core/Src/gpio.c(56): error: #20: identifier "GPIO_MODE_INPUT" is undefined GPIO_InitStruct.Mode = GPIO_MODE_INPUT; ../Core/Src/gpio.c(57): error: #20: identifier "GPIO_PULLUP" is undefined GPIO_InitStruct.Pull = GPIO_PULLUP; ../Core/Src/gpio.c(58): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); ../Core/Src/gpio.c(58): error: #20: identifier "GPIOA" is undefined HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); ../Core/Src/gpio.c: 4 warnings, 11 errors compiling key.c... key.h(16): warning: #1-D: last line of file ends without a newline #endif ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H key.c(96): error: #20: identifier "target_frequency" is undefined target_frequency = (float)current_freq; key.c(97): error: #20: identifier "target_duty_cycle" is undefined target_duty_cycle = (float)current_duty; key.c: 1 warning, 4 errors compiling main.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/main.c(104): error: #20: identifier "htim1" is undefined uint16_t arr1 = _HAL_TIM_GET_AUTORELOAD(&htim1); ../Core/Src/main.c(110): error: #20: identifier "htim2" is undefined uint16_t arr2 = _HAL_TIM_GET_AUTORELOAD(&htim2); ../Core/Src/main.c(116): error: #20: identifier "htim3" is undefined uint16_t arr3 = _HAL_TIM_GET_AUTORELOAD(&htim3); ../Core/Src/main.c(122): error: #20: identifier "htim4" is undefined uint16_t arr4 = _HAL_TIM_GET_AUTORELOAD(&htim4); ../Core/Src/main.c(157): error: #20: identifier "htim1" is undefined htim1.Instance->ARR = arr; ../Core/Src/main.c(163): error: #20: identifier "htim1" is undefined htim1.Instance->CCR2 = htim1.Instance->ARR * current_duty / 100; ../Core/Src/main.c(192): error: #20: identifier "huart3" is undefined HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 0xffff); ../Core/Src/main.c(226): warning: #223-D: function "MX_GPIO_Init" declared implicitly MX_GPIO_Init(); ../Core/Src/main.c(227): warning: #223-D: function "MX_TIM2_Init" declared implicitly MX_TIM2_Init(); ../Core/Src/main.c(228): warning: #223-D: function "MX_TIM1_Init" declared implicitly MX_TIM1_Init(); ../Core/Src/main.c(229): warning: #223-D: function "MX_TIM3_Init" declared implicitly MX_TIM3_Init(); ../Core/Src/main.c(230): warning: #223-D: function "MX_TIM4_Init" declared implicitly MX_TIM4_Init(); ../Core/Src/main.c(231): warning: #223-D: function "MX_I2C1_Init" declared implicitly MX_I2C1_Init(); ../Core/Src/main.c(232): warning: #223-D: function "MX_USART3_UART_Init" declared implicitly MX_USART3_UART_Init(); ../Core/Src/main.c(234): error: #20: identifier "htim1" is undefined HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_1); ../Core/Src/main.c(235): error: #20: identifier "htim2" is undefined HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_1); ../Core/Src/main.c(236): error: #20: identifier "htim3" is undefined HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_1); ../Core/Src/main.c(237): error: #20: identifier "htim4" is undefined HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_3); ../Core/Src/main.c(347): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/main.c(361): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/main.c(373): error: #159: declaration is incompatible with previous "Error_Handler" (declared at line 347) void Error_Handler(void) ../Core/Src/main.c(101): warning: #177-D: function "BreathingLight" was declared but never referenced static void BreathingLight(void){ ../Core/Src/main.c: 10 warnings, 17 errors compiling sdd1306.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/i2c.h(35): error: #20: identifier "I2C_HandleTypeDef" is undefined extern I2C_HandleTypeDef hi2c1; ..\Core\Src\sdd1306.c(257): warning: #177-D: variable "x_start_cycle" was declared but never referenced int x_start_cycle = current_x; ..\Core\Src\sdd1306.c(13): warning: #177-D: variable "wave_x" was declared but never referenced static uint8_t wave_x = 0; // 波形当前的X坐标 ..\Core\Src\sdd1306.c: 2 warnings, 2 errors "BreathingLightProMax\BreathingLightProMax.axf" - 120 Error(s), 48 Warning(s). Target not created.
11-27
*** Using Compiler &#39;V5.06 update 5 (build 528)&#39;, folder: &#39;E:\stm32\ARM\ARMCC\Bin&#39; Build target &#39;BreathingLightProMax&#39; compiling gpio.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/gpio.c(45): error: #20: identifier "GPIO_InitTypeDef" is undefined GPIO_InitTypeDef GPIO_InitStruct = {0}; ../Core/Src/gpio.c(48): warning: #223-D: function "__HAL_RCC_GPIOD_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOD_CLK_ENABLE(); ../Core/Src/gpio.c(49): warning: #223-D: function "__HAL_RCC_GPIOA_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOA_CLK_ENABLE(); ../Core/Src/gpio.c(50): warning: #223-D: function "__HAL_RCC_GPIOB_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOB_CLK_ENABLE(); ../Core/Src/gpio.c(54): error: #20: identifier "K3_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K4_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K5_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(54): error: #20: identifier "K6_Pin" is undefined GPIO_InitStruct.Pin = K3_Pin|K4_Pin|K5_Pin|K6_Pin ../Core/Src/gpio.c(55): error: #20: identifier "K1_Pin" is undefined |K1_Pin|K2_Pin; ../Core/Src/gpio.c(55): error: #20: identifier "K2_Pin" is undefined |K1_Pin|K2_Pin; ../Core/Src/gpio.c(56): error: #20: identifier "GPIO_MODE_INPUT" is undefined GPIO_InitStruct.Mode = GPIO_MODE_INPUT; ../Core/Src/gpio.c(57): error: #20: identifier "GPIO_PULLUP" is undefined GPIO_InitStruct.Pull = GPIO_PULLUP; ../Core/Src/gpio.c(58): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); ../Core/Src/gpio.c(58): error: #20: identifier "GPIOA" is undefined HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); ../Core/Src/gpio.c: 4 warnings, 11 errors compiling tim.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/tim.h(32): error: #20: identifier "uint16_t" is undefined extern uint16_t current_freq; ../Core/Inc/tim.h(33): error: #20: identifier "uint16_t" is undefined extern uint16_t current_duty; ../Core/Inc/tim.h(36): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim1; ../Core/Inc/tim.h(38): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim2; ../Core/Inc/tim.h(40): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim3; ../Core/Inc/tim.h(42): error: #20: identifier "TIM_HandleTypeDef" is undefined extern TIM_HandleTypeDef htim4; ../Core/Inc/tim.h(53): error: #20: identifier "TIM_HandleTypeDef" is undefined void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); ../Core/Src/tim.c(27): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim1; ../Core/Src/tim.c(28): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim2; ../Core/Src/tim.c(29): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim3; ../Core/Src/tim.c(30): error: #20: identifier "TIM_HandleTypeDef" is undefined TIM_HandleTypeDef htim4; ../Core/Src/tim.c(40): error: #20: identifier "TIM_ClockConfigTypeDef" is undefined TIM_ClockConfigTypeDef sClockSourceConfig = {0}; ../Core/Src/tim.c(41): error: #20: identifier "TIM_MasterConfigTypeDef" is undefined TIM_MasterConfigTypeDef sMasterConfig = {0}; ../Core/Src/tim.c(42): error: #20: identifier "TIM_OC_InitTypeDef" is undefined TIM_OC_InitTypeDef sConfigOC = {0}; ../Core/Src/tim.c(43): error: #20: identifier "TIM_BreakDeadTimeConfigTypeDef" is undefined TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; ../Core/Src/tim.c(48): error: #20: identifier "TIM1" is undefined htim1.Instance = TIM1; ../Core/Src/tim.c(50): error: #20: identifier "TIM_COUNTERMODE_UP" is undefined htim1.Init.CounterMode = TIM_COUNTERMODE_UP; ../Core/Src/tim.c(52): error: #20: identifier "TIM_CLOCKDIVISION_DIV1" is undefined htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; ../Core/Src/tim.c(54): error: #20: identifier "TIM_AUTORELOAD_PRELOAD_ENABLE" is undefined htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; ../Core/Src/tim.c(55): warning: #223-D: function "HAL_TIM_Base_Init" declared implicitly if (HAL_TIM_Base_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(55): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_Base_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(57): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(59): error: #20: identifier "TIM_CLOCKSOURCE_INTERNAL" is undefined sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; ../Core/Src/tim.c(60): warning: #223-D: function "HAL_TIM_ConfigClockSource" declared implicitly if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) ../Core/Src/tim.c(60): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) ../Core/Src/tim.c(62): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(64): warning: #223-D: function "HAL_TIM_PWM_Init" declared implicitly if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(64): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(66): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(68): warning: #223-D: function "HAL_TIM_OC_Init" declared implicitly if (HAL_TIM_OC_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(68): error: #20: identifier "HAL_OK" is undefined if (HAL_TIM_OC_Init(&htim1) != HAL_OK) ../Core/Src/tim.c(70): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(72): error: #20: identifier "TIM_TRGO_RESET" is undefined sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; ../Core/Src/tim.c(73): error: #20: identifier "TIM_MASTERSLAVEMODE_DISABLE" is undefined sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; ../Core/Src/tim.c(74): warning: #223-D: function "HAL_TIMEx_MasterConfigSynchronization" declared implicitly if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) ../Core/Src/tim.c(74): error: #20: identifier "HAL_OK" is undefined if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) ../Core/Src/tim.c(76): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/tim.c(78): error: #20: identifier "TIM_OCMODE_PWM1" is undefined sConfigOC.OCMode = TIM_OCMODE_PWM1; ../Core/Src/tim.c(80): error: #20: identifier "TIM_OCPOLARITY_HIGH" is undefined sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; ../Core/Src/tim.c: 10 warnings, 30 errors compiling stm32f1xx_it.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/stm32f1xx_it.c(58): error: #20: identifier "UART_HandleTypeDef" is undefined extern UART_HandleTypeDef huart3; ../Core/Src/stm32f1xx_it.c(188): warning: #223-D: function "HAL_IncTick" declared implicitly HAL_IncTick(); ../Core/Src/stm32f1xx_it.c(209): warning: #223-D: function "HAL_UART_IRQHandler" declared implicitly HAL_UART_IRQHandler(&huart3); ../Core/Src/stm32f1xx_it.c: 2 warnings, 2 errors compiling stm32f1xx_hal_msp.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/stm32f1xx_hal_msp.c(70): warning: #223-D: function "__HAL_RCC_AFIO_CLK_ENABLE" declared implicitly __HAL_RCC_AFIO_CLK_ENABLE(); ../Core/Src/stm32f1xx_hal_msp.c(71): warning: #223-D: function "__HAL_RCC_PWR_CLK_ENABLE" declared implicitly __HAL_RCC_PWR_CLK_ENABLE(); ../Core/Src/stm32f1xx_hal_msp.c(77): warning: #223-D: function "__HAL_AFIO_REMAP_SWJ_NOJTAG" declared implicitly __HAL_AFIO_REMAP_SWJ_NOJTAG(); ../Core/Src/stm32f1xx_hal_msp.c: 3 warnings, 1 error compiling i2c.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/i2c.h(35): error: #20: identifier "I2C_HandleTypeDef" is undefined extern I2C_HandleTypeDef hi2c1; ../Core/Src/i2c.c(27): error: #20: identifier "I2C_HandleTypeDef" is undefined I2C_HandleTypeDef hi2c1; ../Core/Src/i2c.c(40): error: #20: identifier "I2C1" is undefined hi2c1.Instance = I2C1; ../Core/Src/i2c.c(42): error: #20: identifier "I2C_DUTYCYCLE_2" is undefined hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; ../Core/Src/i2c.c(44): error: #20: identifier "I2C_ADDRESSINGMODE_7BIT" is undefined hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; ../Core/Src/i2c.c(45): error: #20: identifier "I2C_DUALADDRESS_DISABLE" is undefined hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; ../Core/Src/i2c.c(47): error: #20: identifier "I2C_GENERALCALL_DISABLE" is undefined hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; ../Core/Src/i2c.c(48): error: #20: identifier "I2C_NOSTRETCH_DISABLE" is undefined hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; ../Core/Src/i2c.c(49): warning: #223-D: function "HAL_I2C_Init" declared implicitly if (HAL_I2C_Init(&hi2c1) != HAL_OK) ../Core/Src/i2c.c(49): error: #20: identifier "HAL_OK" is undefined if (HAL_I2C_Init(&hi2c1) != HAL_OK) ../Core/Src/i2c.c(51): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/i2c.c(59): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) ../Core/Src/i2c.c(62): error: #20: identifier "GPIO_InitTypeDef" is undefined GPIO_InitTypeDef GPIO_InitStruct = {0}; ../Core/Src/i2c.c(63): error: #20: identifier "I2C1" is undefined if(i2cHandle->Instance==I2C1) ../Core/Src/i2c.c(69): warning: #223-D: function "__HAL_RCC_GPIOB_CLK_ENABLE" declared implicitly __HAL_RCC_GPIOB_CLK_ENABLE(); ../Core/Src/i2c.c(74): error: #20: identifier "GPIO_PIN_6" is undefined GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; ../Core/Src/i2c.c(74): error: #20: identifier "GPIO_PIN_7" is undefined GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; ../Core/Src/i2c.c(75): error: #20: identifier "GPIO_MODE_AF_OD" is undefined GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; ../Core/Src/i2c.c(76): error: #20: identifier "GPIO_SPEED_FREQ_HIGH" is undefined GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; ../Core/Src/i2c.c(77): warning: #223-D: function "HAL_GPIO_Init" declared implicitly HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/i2c.c(77): error: #20: identifier "GPIOB" is undefined HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); ../Core/Src/i2c.c(80): warning: #223-D: function "__HAL_RCC_I2C1_CLK_ENABLE" declared implicitly __HAL_RCC_I2C1_CLK_ENABLE(); ../Core/Src/i2c.c(87): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) ../Core/Src/i2c.c(90): error: #20: identifier "I2C1" is undefined if(i2cHandle->Instance==I2C1) ../Core/Src/i2c.c(96): warning: #223-D: function "__HAL_RCC_I2C1_CLK_DISABLE" declared implicitly __HAL_RCC_I2C1_CLK_DISABLE(); ../Core/Src/i2c.c(102): warning: #223-D: function "HAL_GPIO_DeInit" declared implicitly HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(102): error: #20: identifier "GPIOB" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(102): error: #20: identifier "GPIO_PIN_6" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6); ../Core/Src/i2c.c(104): error: #20: identifier "GPIO_PIN_7" is undefined HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7); ../Core/Src/i2c.c: 7 warnings, 23 errors compiling main.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/main.c(231): warning: #223-D: function "MX_GPIO_Init" declared implicitly MX_GPIO_Init(); ../Core/Src/main.c(232): warning: #223-D: function "MX_TIM2_Init" declared implicitly MX_TIM2_Init(); ../Core/Src/main.c(233): warning: #223-D: function "MX_TIM1_Init" declared implicitly MX_TIM1_Init(); ../Core/Src/main.c(234): warning: #223-D: function "MX_TIM3_Init" declared implicitly MX_TIM3_Init(); ../Core/Src/main.c(235): warning: #223-D: function "MX_TIM4_Init" declared implicitly MX_TIM4_Init(); ../Core/Src/main.c(236): warning: #223-D: function "MX_I2C1_Init" declared implicitly MX_I2C1_Init(); ../Core/Src/main.c(237): warning: #223-D: function "MX_USART3_UART_Init" declared implicitly MX_USART3_UART_Init(); ../Core/Src/main.c(352): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/main.c(366): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/main.c(378): error: #159: declaration is incompatible with previous "Error_Handler" (declared at line 352) void Error_Handler(void) ../Core/Src/main.c(106): warning: #177-D: function "BreathingLight" was declared but never referenced static void BreathingLight(void){ ../Core/Src/main.c: 10 warnings, 6 errors compiling sdd1306.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/i2c.h(35): error: #20: identifier "I2C_HandleTypeDef" is undefined extern I2C_HandleTypeDef hi2c1; ..\Core\Src\sdd1306.c(257): warning: #177-D: variable "x_start_cycle" was declared but never referenced int x_start_cycle = current_x; ..\Core\Src\sdd1306.c(13): warning: #177-D: variable "wave_x" was declared but never referenced static uint8_t wave_x = 0; // 波形当前的X坐标 ..\Core\Src\sdd1306.c: 2 warnings, 2 errors compiling usart.c... ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Src/usart.c(25): error: #20: identifier "FIREWAVE_HEAD_LEN" is undefined const uint8_t firewave_head[FIREWAVE_HEAD_LEN] = {0xAA, 0x07, 0x00, 0x00}; ../Core/Src/usart.c(26): error: #20: identifier "FIREWAVE_TAIL_LEN" is undefined const uint8_t firewave_tail[FIREWAVE_TAIL_LEN] = {0x00, 0x00, 0x07, 0xAA}; ../Core/Src/usart.c(28): error: #20: identifier "WAVE_POINTS" is undefined static float wave_data[WAVE_POINTS]; ../Core/Src/usart.c(55): warning: #223-D: function "Error_Handler" declared implicitly Error_Handler(); ../Core/Src/usart.c(145): error: #20: identifier "current_duty" is undefined uint32_t high_points = (uint32_t)(WAVE_POINTS * (current_duty / 100.0f)); ../Core/Src/usart.c(152): error: #20: identifier "V_MAX" is undefined wave_data[i] = V_MAX; ../Core/Src/usart.c: 1 warning, 7 errors compiling key.c... key.h(16): warning: #1-D: last line of file ends without a newline #endif ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H ../Core/Inc/main.h(22): error: #37: the #endif for this directive is missing #ifndef __MAIN_H key.c(96): error: #20: identifier "target_frequency" is undefined target_frequency = (float)current_freq; key.c(97): error: #20: identifier "target_duty_cycle" is undefined target_duty_cycle = (float)current_duty; key.c: 1 warning, 4 errors "BreathingLightProMax\BreathingLightProMax.axf" - 86 Error(s), 40 Warning(s). Target not created. Build Time Elapsed: 00:00:02
11-27
*** Using Compiler ‘V5.06 update 1 (build 61)’, folder: ‘D:\Keil_v5\ARM\ARMCC\Bin’ Rebuild target ‘ADC-DEMO’ assembling startup_stm32f10x_md.s… compiling main.c… compiling led.c… compiling usart1.c… compiling delay.c… compiling dht11.c… dht11.c(18): warning: #188-D: enumerated type mixed with another type HT11_DQ_OUT(0); //拉??DQ dht11.c(20): warning: #188-D: enumerated type mixed with another type HT11_DQ_OUT(1); //DQ=1 dht11.c: 2 warnings, 0 errors compiling sys.c… compiling stm32f10x_it.c… compiling adc.c… adc.h(41): error: #20: identifier “ADC_HandleTypeDef” is undefined void adc_channel_set(ADC_HandleTypeDef adc_handle, uint32_t ch,uint32_t rank, uint32_t stime); / ADC通??? / adc.c(25): error: #20: identifier “ADC_HandleTypeDef” is undefined ADC_HandleTypeDef g_adc_handle; / ADC?浔? / adc.c(38): error: #20: identifier “ADC_DATAALIGN_RIGHT” is undefined g_adc_handle.Init.DataAlign = ADC_DATAALIGN_RIGHT; / ?荻??敕?式:?叶??? / adc.c(39): error: #20: identifier “ADC_SCAN_DISABLE” is undefined g_adc_handle.Init.ScanConvMode = ADC_SCAN_DISABLE; / ??扫??模式,???玫?一??通?? / adc.c(44): error: #20: identifier “ADC_SOFTWARE_START” is undefined g_adc_handle.Init.ExternalTrigConv = ADC_SOFTWARE_START; / 触发转换方式:?砑シ? / adc.c(45): warning: #223-D: function “HAL_ADC_Init” declared implicitly HAL_ADC_Init(&g_adc_handle); / ??始化 / adc.c(47): warning: #223-D: function “HAL_ADCEx_Calibration_Start” declared implicitly HAL_ADCEx_Calibration_Start(&g_adc_handle); / 校准ADC */ adc.c(56): error: #20: identifier “ADC_HandleTypeDef” is undefined void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) adc.c(61): error: #20: identifierRCC_PeriphCLKInitTypeDef” is undefined RCC_PeriphCLKInitTypeDef adc_clk_init = {0}; adc.c(63): warning: #223-D: function “__HAL_RCC_ADC1_CLK_ENABLE” declared implicitly DC_ADCX_CHY_CLK_ENABLE(); /* 使??ADCx时?? */ adc.c(64): warning: #223-D: function “__HAL_RCC_GPIOA_CLK_ENABLE” declared implicitly DC_ADCX_CHY_GPIO_CLK_ENABLE(); /* 开??GPIO时?? / adc.c(67): error: #20: identifierRCC_PERIPHCLK_ADC” is undefined adc_clk_init.PeriphClockSelection = RCC_PERIPHCLK_ADC; / ADC???时?? / adc.c(68): error: #20: identifierRCC_ADCPCLK2_DIV6” is undefined adc_clk_init.AdcClockSelection = RCC_ADCPCLK2_DIV6; / ??频???6时??为72M/6=12MHz / adc.c(69): warning: #223-D: function “HAL_RCCEx_PeriphCLKConfig” declared implicitly HAL_RCCEx_PeriphCLKConfig(&adc_clk_init); / ???ADC时?? / adc.c(72): error: #136: struct “” has no field “Pin” gpio_init_struct.Pin = ADC_ADCX_CHY_GPIO_PIN; / ADC通??IO?? / adc.c(72): error: #20: identifier “GPIO_PIN_2” is undefined gpio_init_struct.Pin = DC_ADCX_CHY_GPIO_PIN; / ADC通??IO?? / adc.c(73): error: #136: struct “” has no field “Mode” gpio_init_struct.Mode = GPIO_MODE_ANALOG; / 模?? / adc.c(73): error: #20: identifier “GPIO_MODE_ANALOG” is undefined gpio_init_struct.Mode = GPIO_MODE_ANALOG; / 模?? */ adc.c(74): warning: #223-D: function “HAL_GPIO_Init” declared implicitly HAL_GPIO_Init(ADC_ADCX_CHY_GPIO_PORT, &gpio_init_struct); adc.c(94): error: #20: identifier “ADC_HandleTypeDef” is undefined void adc_channel_set(ADC_HandleTypeDef adc_handle, uint32_t ch, uint32_t rank, uint32_t stime) adc.c(96): error: #20: identifier “ADC_ChannelConfTypeDef” is undefined ADC_ChannelConfTypeDef adc_ch_conf; adc.c(101): warning: #223-D: function “HAL_ADC_ConfigChannel” declared implicitly HAL_ADC_ConfigChannel(adc_handle, &adc_ch_conf); / 通??? / adc.c(111): error: #20: identifier “ADC_REGULAR_RANK_1” is undefined adc_channel_set(&g_adc_handle , ch, ADC_REGULAR_RANK_1, ADC_SAMPLETIME_239CYCLES_5); / ???通?溃???泻筒???时?? / adc.c(111): error: #20: identifier “ADC_SAMPLETIME_239CYCLES_5” is undefined adc_channel_set(&g_adc_handle , ch, ADC_REGULAR_RANK_1, ADC_SAMPLETIME_239CYCLES_5); / ???通?溃???泻筒???时?? / adc.c(113): warning: #223-D: function “HAL_ADC_Start” declared implicitly HAL_ADC_Start(&g_adc_handle); / 开??ADC / adc.c(114): warning: #223-D: function “HAL_ADC_PollForConversion” declared implicitly HAL_ADC_PollForConversion(&g_adc_handle, 10); / ??询转换 / adc.c(115): warning: #223-D: function “HAL_ADC_GetValue” declared implicitly return (uint16_t)HAL_ADC_GetValue(&g_adc_handle); / 返???罱?一??ADC1???榈?转换?峁? / adc.c(132): warning: #223-D: function “delay_ms” declared implicitly delay_ms(5); adc.c: 11 warnings, 17 errors compiling atim.c… atim.h(44): error: #20: identifier “TIM_HandleTypeDef” is undefined extern TIM_HandleTypeDef g_timx_cplm_pwm_handle; / 定时??x?浔? / atim.c(26): error: #20: identifier “TIM_HandleTypeDef” is undefined TIM_HandleTypeDef g_timx_cplm_pwm_handle; / 定时??x?浔? */ atim.c(46): error: #20: identifier “TIM_OC_InitTypeDef” is undefined TIM_OC_InitTypeDef tim_oc_cplm_pwm = {0}; atim.c(48): warning: #223-D: function “__HAL_RCC_TIM1_CLK_ENABLE” declared implicitly TIM_TIMX_CPLM_CLK_ENABLE(); /* TIMx 时??使?? */ atim.c(49): warning: #223-D: function “__HAL_RCC_GPIOA_CLK_ENABLE” declared implicitly TIM_TIMX_CPLM_CHY_GPIO_CLK_ENABLE(); /* 通??X??应IO??时??使?? */ atim.c(50): warning: #223-D: function “__HAL_RCC_GPIOB_CLK_ENABLE” declared implicitly TIM_TIMX_CPLM_CHYN_GPIO_CLK_ENABLE(); /* 通??X互补通?蓝?应IO??时??使?? / atim.c(52): error: #136: struct “” has no field “Pin” gpio_init_struct.Pin = ATIM_TIMX_CPLM_CHY_GPIO_PIN; atim.c(52): error: #20: identifier “GPIO_PIN_8” is undefined gpio_init_struct.Pin = TIM_TIMX_CPLM_CHY_GPIO_PIN; atim.c(53): error: #136: struct “” has no field “Mode” gpio_init_struct.Mode = GPIO_MODE_AF_PP; atim.c(53): error: #20: identifier “GPIO_MODE_AF_PP” is undefined gpio_init_struct.Mode = GPIO_MODE_AF_PP; atim.c(54): error: #136: struct “” has no field “Pull” gpio_init_struct.Pull = GPIO_PULLDOWN; atim.c(54): error: #20: identifier “GPIO_PULLDOWN” is undefined gpio_init_struct.Pull = GPIO_PULLDOWN; atim.c(55): error: #136: struct “” has no field “Speed” gpio_init_struct.Speed = GPIO_SPEED_FREQ_HIGH ; atim.c(55): error: #20: identifier “GPIO_SPEED_FREQ_HIGH” is undefined gpio_init_struct.Speed = GPIO_SPEED_FREQ_HIGH ; atim.c(56): warning: #223-D: function “HAL_GPIO_Init” declared implicitly HAL_GPIO_Init(ATIM_TIMX_CPLM_CHY_GPIO_PORT, &gpio_init_struct); atim.c(58): error: #136: struct “” has no field “Pin” gpio_init_struct.Pin = ATIM_TIMX_CPLM_CHYN_GPIO_PIN; atim.c(58): error: #20: identifier “GPIO_PIN_13” is undefined gpio_init_struct.Pin = TIM_TIMX_CPLM_CHYN_GPIO_PIN; atim.c(63): error: #20: identifier “TIM_COUNTERMODE_UP” is undefined g_timx_cplm_pwm_handle.Init.CounterMode = TIM_COUNTERMODE_UP; / ???黾???模式 / atim.c(65): error: #20: identifier “TIM_CLOCKDIVISION_DIV4” is undefined g_timx_cplm_pwm_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; / CKD[1:0] = 10, tDTS = 4 * tCK_INT = Ft / 4 = 18Mhz / atim.c(66): error: #20: identifier “TIM_AUTORELOAD_PRELOAD_ENABLEis undefined g_timx_cplm_pwm_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; / 使??影?蛹拇???TIMx_ARR / atim.c(67): warning: #223-D: function “HAL_TIM_PWM_Init” declared implicitly HAL_TIM_PWM_Init(&g_timx_cplm_pwm_handle); atim.c(69): error: #20: identifier “TIM_OCMODE_PWM1” is undefined tim_oc_cplm_pwm.OCMode = TIM_OCMODE_PWM1; / PWM模式1 / atim.c(70): error: #20: identifier “TIM_OCPOLARITY_HIGH” is undefined tim_oc_cplm_pwm.OCPolarity = TIM_OCPOLARITY_HIGH; / OCy ?偷?平??效 / atim.c(71): error: #20: identifier “TIM_OCNPOLARITY_HIGH” is undefined tim_oc_cplm_pwm.OCNPolarity = TIM_OCNPOLARITY_HIGH; / OCyN ?偷?平??效 / atim.c(72): error: #20: identifier “TIM_OCIDLESTATE_RESET” is undefined tim_oc_cplm_pwm.OCIdleState = TIM_OCIDLESTATE_RESET; / 当MOE=0,OCx=1 / atim.c(73): error: #20: identifier “TIM_OCNIDLESTATE_RESET” is undefined tim_oc_cplm_pwm.OCNIdleState = TIM_OCNIDLESTATE_RESET; / 当MOE=0,OCxN=1 / atim.c(75): warning: #223-D: function “HAL_TIM_PWM_ConfigChannel” declared implicitly HAL_TIM_PWM_ConfigChannel(&g_timx_cplm_pwm_handle, &tim_oc_cplm_pwm, ATIM_TIMX_CPLM_CHY); atim.c(75): error: #20: identifier “TIM_CHANNEL_1” is undefined HAL_TIM_PWM_ConfigChannel(&g_timx_cplm_pwm_handle, &tim_oc_cplm_pwm, TIM_TIMX_CPLM_CHY); atim.c(77): warning: #223-D: function “HAL_TIM_PWM_Start” declared implicitly HAL_TIM_PWM_Start(&g_timx_cplm_pwm_handle, ATIM_TIMX_CPLM_CHY); / 使??OCy?涑? / atim.c(78): warning: #223-D: function “HAL_TIMEx_PWMN_Start” declared implicitly HAL_TIMEx_PWMN_Start(&g_timx_cplm_pwm_handle, ATIM_TIMX_CPLM_CHY); / 使??OCyN?涑? / atim.c: 8 warnings, 22 errors compiling atk_fan.c… atim.h(44): error: #20: identifier “TIM_HandleTypeDef” is undefined extern TIM_HandleTypeDef g_timx_cplm_pwm_handle; / 定时??x?浔? / atk_fan.c(43): warning: #223-D: function “HAL_TIM_PWM_Stop” declared implicitly HAL_TIM_PWM_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇???通???涑? / atk_fan.c(43): error: #20: identifier “TIM_CHANNEL_1” is undefined HAL_TIM_PWM_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇???通???涑? / atk_fan.c(44): warning: #223-D: function “HAL_TIMEx_PWMN_Stop” declared implicitly HAL_TIMEx_PWMN_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇栈ゲ?通???涑? / atk_fan.c(55): warning: #223-D: function “HAL_TIM_PWM_Stop” declared implicitly HAL_TIM_PWM_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇???通???涑? / atk_fan.c(55): error: #20: identifier “TIM_CHANNEL_1” is undefined HAL_TIM_PWM_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇???通???涑? / atk_fan.c(56): warning: #223-D: function “HAL_TIMEx_PWMN_Stop” declared implicitly HAL_TIMEx_PWMN_Stop(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / ?乇栈ゲ?通???涑? / atk_fan.c(60): warning: #223-D: function “HAL_TIM_PWM_Start” declared implicitly HAL_TIM_PWM_Start(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / 开???通???涑? / atk_fan.c(64): warning: #223-D: function “HAL_TIMEx_PWMN_Start” declared implicitly HAL_TIMEx_PWMN_Start(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1); / 开?艋ゲ?通???涑? / atk_fan.c(75): warning: #223-D: function “__HAL_TIM_GetAutoreload” declared implicitly if (para < (__HAL_TIM_GetAutoreload(&g_timx_cplm_pwm_handle))) / ??? */ atk_fan.c(77): warning: #223-D: function “__HAL_TIM_SetCompare” declared implicitly __HAL_TIM_SetCompare(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1, para); atk_fan.c(77): error: #20: identifier “TIM_CHANNEL_1” is undefined __HAL_TIM_SetCompare(&g_timx_cplm_pwm_handle, TIM_CHANNEL_1, para); atk_fan.c: 8 warnings, 4 errors compiling atk_light.c… adc.h(41): error: #20: identifier “ADC_HandleTypeDef” is undefined void adc_channel_set(ADC_HandleTypeDef adc_handle, uint32_t ch,uint32_t rank, uint32_t stime); / ADC通??? */ atk_light.c(33): warning: #223-D: function “__HAL_RCC_GPIOA_CLK_ENABLE” declared implicitly TK_LIGHT_DO_GPIO_CLK_ENABLE(); /* DO时??使?? / atk_light.c(35): error: #136: struct “” has no field “Pin” gpio_init_struct.Pin = ATK_LIGHT_DO_GPIO_PIN; / DO?? / atk_light.c(35): error: #20: identifier “GPIO_PIN_3” is undefined gpio_init_struct.Pin = TK_LIGHT_DO_GPIO_PIN; / DO?? / atk_light.c(36): error: #136: struct “” has no field “Mode” gpio_init_struct.Mode = GPIO_MODE_INPUT; / ??? / atk_light.c(36): error: #20: identifier “GPIO_MODE_INPUT” is undefined gpio_init_struct.Mode = GPIO_MODE_INPUT; / ??? / atk_light.c(37): error: #136: struct “” has no field “Pull” gpio_init_struct.Pull = GPIO_NOPULL; / ???拉 / atk_light.c(37): error: #20: identifier “GPIO_NOPULL” is undefined gpio_init_struct.Pull = GPIO_NOPULL; / ???拉 / atk_light.c(38): warning: #223-D: function “HAL_GPIO_Init” declared implicitly HAL_GPIO_Init(ATK_LIGHT_DO_GPIO_PORT, &gpio_init_struct); / DO?懦?始化 / atk_light.c(51): error: #20: identifier “ADC_CHANNEL_2” is undefined temp_val = adc_get_result_average( DC_ADCX_CHY, 10); / ??取平??值 */ atk_light.c: 2 warnings, 8 errors compiling stm32f10x_gpio.c… compiling stm32f10x_rcc.c… compiling stm32f10x_usart.c… compiling stm32f10x_adc.c… compiling stm32f10x_dma.c… compiling stm32f10x_flash.c… compiling stm32f10x_rtc.c… compiling misc.c… compiling stm32f10x_tim.c… compiling stm32f10x_exti.c… compiling core_cm3.c… compiling system_stm32f10x.c… “.\STM32-DEMO.axf” - 51 Error(s), 31 Warning(s). Target not created. Build Time Elapsed: 00:00:06
06-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值