备份-使能网线拔插监测回调
This commit is contained in:
parent
1e5029938f
commit
70dd5b57b2
|
@ -151,7 +151,7 @@ void start_lwip_task(void const *argument)
|
||||||
uint32_t phyreg = 0;
|
uint32_t phyreg = 0;
|
||||||
uint8_t tcp_hart_num = 0;
|
uint8_t tcp_hart_num = 0;
|
||||||
HAL_ETH_ReadPHYRegister(&heth, 0x00, PHY_BSR, &phyreg);
|
HAL_ETH_ReadPHYRegister(&heth, 0x00, PHY_BSR, &phyreg);
|
||||||
if (((phyreg >> 2) & 0x1) != 0x1)
|
if (((phyreg >> 2) & 0x1) != 0x1) // PHY_BSR寄存器的第2位表示PHY是否连接 PHY_LINKED_STATUS
|
||||||
{
|
{
|
||||||
/* When the netif link is down this function must be called */
|
/* When the netif link is down this function must be called */
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,8 @@ void SystemClock_Config(void)
|
||||||
|
|
||||||
/** Initializes the CPU, AHB and APB buses clocks
|
/** Initializes the CPU, AHB and APB buses clocks
|
||||||
*/
|
*/
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||||
|
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||||
|
@ -167,12 +168,12 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||||
{
|
{
|
||||||
if (CH438_1_INT_Pin == GPIO_Pin)
|
if (CH438_1_INT_Pin == GPIO_Pin)
|
||||||
{
|
{
|
||||||
// ch438_1_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_1的中断请求
|
// ch438_1_int_flag = 1; // 霈曄蔭CH438_1<EFBFBD><EFBFBD>葉<EFBFBD>剜<EFBFBD>敹梹<EFBFBD><EFBFBD>其<EFBFBD>銝剜鱏憭<EFBFBD><EFBFBD><EFBFBD>賣㺭銝剖ế<EFBFBD>剜糓<EFBFBD>虫蛹CH438_1<EFBFBD><EFBFBD>葉<EFBFBD>剛窈瘙?
|
||||||
ch438_interrupt_handler_ch438_chip_1();
|
ch438_interrupt_handler_ch438_chip_1();
|
||||||
}
|
}
|
||||||
if (CH438_2_INT_Pin == GPIO_Pin)
|
if (CH438_2_INT_Pin == GPIO_Pin)
|
||||||
{
|
{
|
||||||
// ch438_2_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_2的中断请求
|
// ch438_2_int_flag = 1; // 霈曄蔭CH438_1<EFBFBD><EFBFBD>葉<EFBFBD>剜<EFBFBD>敹梹<EFBFBD><EFBFBD>其<EFBFBD>銝剜鱏憭<EFBFBD><EFBFBD><EFBFBD>賣㺭銝剖ế<EFBFBD>剜糓<EFBFBD>虫蛹CH438_2<EFBFBD><EFBFBD>葉<EFBFBD>剛窈瘙?
|
||||||
ch438_interrupt_handler_ch438_chip_2();
|
ch438_interrupt_handler_ch438_chip_2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,8 +192,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||||
/* USER CODE BEGIN Callback 0 */
|
/* USER CODE BEGIN Callback 0 */
|
||||||
|
|
||||||
/* USER CODE END Callback 0 */
|
/* USER CODE END Callback 0 */
|
||||||
if (htim->Instance == TIM4)
|
if (htim->Instance == TIM4) {
|
||||||
{
|
|
||||||
HAL_IncTick();
|
HAL_IncTick();
|
||||||
}
|
}
|
||||||
/* USER CODE BEGIN Callback 1 */
|
/* USER CODE BEGIN Callback 1 */
|
||||||
|
|
|
@ -79,6 +79,10 @@
|
||||||
#define TCP_SNDLOWAT 1071
|
#define TCP_SNDLOWAT 1071
|
||||||
/*----- Value in opt.h for TCP_WND_UPDATE_THRESHOLD: LWIP_MIN(TCP_WND/4, TCP_MSS*4) -----*/
|
/*----- Value in opt.h for TCP_WND_UPDATE_THRESHOLD: LWIP_MIN(TCP_WND/4, TCP_MSS*4) -----*/
|
||||||
#define TCP_WND_UPDATE_THRESHOLD 536
|
#define TCP_WND_UPDATE_THRESHOLD 536
|
||||||
|
/*----- Default Value for LWIP_NETIF_STATUS_CALLBACK: 0 ---*/
|
||||||
|
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||||
|
/*----- Default Value for LWIP_NETIF_EXT_STATUS_CALLBACK: 0 ---*/
|
||||||
|
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
|
||||||
/*----- Value in opt.h for LWIP_NETIF_LINK_CALLBACK: 0 -----*/
|
/*----- Value in opt.h for LWIP_NETIF_LINK_CALLBACK: 0 -----*/
|
||||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||||
/*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/
|
/*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -27,9 +27,11 @@ GPIO.groupedBy=Group By Peripherals
|
||||||
KeepUserPlacement=false
|
KeepUserPlacement=false
|
||||||
LWIP.BSP.number=1
|
LWIP.BSP.number=1
|
||||||
LWIP.GATEWAY_ADDRESS=192.168.001.222
|
LWIP.GATEWAY_ADDRESS=192.168.001.222
|
||||||
LWIP.IPParameters=LWIP_DHCP,IP_ADDRESS,NETMASK_ADDRESS,GATEWAY_ADDRESS,MEMP_NUM_TCP_PCB_LISTEN,MEMP_NUM_NETCONN,MEMP_NUM_RAW_PCB,MEMP_NUM_SELECT_CB,MEMP_NUM_REASSDATA,MEMP_NUM_TCP_PCB,MEMP_NUM_PBUF,MEMP_NUM_TCP_SEG,PBUF_POOL_BUFSIZE,PBUF_POOL_SIZE,MEM_SIZE,TCP_SND_QUEUELEN
|
LWIP.IPParameters=LWIP_DHCP,IP_ADDRESS,NETMASK_ADDRESS,GATEWAY_ADDRESS,MEMP_NUM_TCP_PCB_LISTEN,MEMP_NUM_NETCONN,MEMP_NUM_RAW_PCB,MEMP_NUM_SELECT_CB,MEMP_NUM_REASSDATA,MEMP_NUM_TCP_PCB,MEMP_NUM_PBUF,MEMP_NUM_TCP_SEG,PBUF_POOL_BUFSIZE,PBUF_POOL_SIZE,MEM_SIZE,TCP_SND_QUEUELEN,LWIP_NETIF_STATUS_CALLBACK,LWIP_NETIF_EXT_STATUS_CALLBACK
|
||||||
LWIP.IP_ADDRESS=192.168.001.029
|
LWIP.IP_ADDRESS=192.168.001.029
|
||||||
LWIP.LWIP_DHCP=0
|
LWIP.LWIP_DHCP=0
|
||||||
|
LWIP.LWIP_NETIF_EXT_STATUS_CALLBACK=1
|
||||||
|
LWIP.LWIP_NETIF_STATUS_CALLBACK=1
|
||||||
LWIP.MEMP_NUM_NETCONN=20
|
LWIP.MEMP_NUM_NETCONN=20
|
||||||
LWIP.MEMP_NUM_PBUF=20
|
LWIP.MEMP_NUM_PBUF=20
|
||||||
LWIP.MEMP_NUM_RAW_PCB=20
|
LWIP.MEMP_NUM_RAW_PCB=20
|
||||||
|
|
Loading…
Reference in New Issue