This commit is contained in:
2026-04-23 17:20:51 +08:00
parent 4c4cfa76b4
commit c185b3d8b9
77 changed files with 13811 additions and 24616 deletions

View File

@@ -214,7 +214,7 @@
#define MAC_ADDR5 0U
/* Definition of the Ethernet driver buffers size and count */
#define ETH_RX_BUF_SIZE /* buffer size for receive */
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */

View File

@@ -22,7 +22,7 @@
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
/* Private includes ----------------------------------------------------------*/

View File

@@ -69,15 +69,15 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOD, DS1302_CLK_Pin|DS1302_DIO_Pin|DS1302_RST_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : PCPin PCPin */
/*Configure GPIO pins : W5500_RST_Pin W5500_INT_Pin */
GPIO_InitStruct.Pin = W5500_RST_Pin|W5500_INT_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/*Configure GPIO pins : PBPin PBPin PBPin PBPin
PBPin PBPin */
/*Configure GPIO pins : RS485_1_EN_Pin RS485_2_EN_Pin RS485_3_EN_Pin SPI2_CS_Pin
BUZZER_Pin RS485_EN_Pin */
GPIO_InitStruct.Pin = RS485_1_EN_Pin|RS485_2_EN_Pin|RS485_3_EN_Pin|SPI2_CS_Pin
|BUZZER_Pin|RS485_EN_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
@@ -85,35 +85,35 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pins : PEPin PEPin PEPin */
/*Configure GPIO pins : RS485_4_EN_Pin RELAY_1_Pin W5500_SPI1_CS_Pin */
GPIO_InitStruct.Pin = RS485_4_EN_Pin|RELAY_1_Pin|W5500_SPI1_CS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pins : PEPin PEPin */
/*Configure GPIO pins : RELAY_2_Pin RELAY_3_Pin */
GPIO_InitStruct.Pin = RELAY_2_Pin|RELAY_3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pin : PtPin */
/*Configure GPIO pin : LED_Pin */
GPIO_InitStruct.Pin = LED_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : PDPin PDPin PDPin */
/*Configure GPIO pins : DS1302_CLK_Pin DS1302_DIO_Pin DS1302_RST_Pin */
GPIO_InitStruct.Pin = DS1302_CLK_Pin|DS1302_DIO_Pin|DS1302_RST_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pin : PtPin */
/*Configure GPIO pin : RELAY_4_Pin */
GPIO_InitStruct.Pin = RELAY_4_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;

View File

@@ -67,6 +67,7 @@ void SystemClock_Config(void);
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
@@ -97,7 +98,7 @@ int main(void)
MX_SPI2_Init();
MX_USART3_UART_Init();
MX_USART6_UART_Init();
// MX_IWDG_Init();
MX_IWDG_Init();
/* USER CODE BEGIN 2 */
app_init();
//HAL_GPIO_WritePin(JK1_GPIO_Port,JK1_Pin,GPIO_PIN_SET);
@@ -179,8 +180,7 @@ void Error_Handler(void)
}
/* USER CODE END Error_Handler_Debug */
}
#ifdef USE_FULL_ASSERT
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.

View File

@@ -20,7 +20,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
@@ -63,6 +62,7 @@
*/
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */

View File

@@ -91,7 +91,7 @@
/*!< Uncomment the following line if you need to relocate the vector table
anywhere in Flash or Sram, else the vector table is kept at the automatic
remap of boot address selected */
/* #define USER_VECT_TAB_ADDRESS */
#define USER_VECT_TAB_ADDRESS
#if defined(USER_VECT_TAB_ADDRESS)
/*!< Uncomment the following line if you need to relocate your vector Table
@@ -105,7 +105,7 @@
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
#define VECT_TAB_OFFSET 0x00004000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#endif /* VECT_TAB_SRAM */
#endif /* USER_VECT_TAB_ADDRESS */