Skip to content

Commit 36538b2

Browse files
authored
Merge pull request #5413 from xiangxistu/v4.0.x
按照 v4.0.5 计划同步内容
2 parents c538791 + 53299b9 commit 36538b2

File tree

19 files changed

+79
-44
lines changed

19 files changed

+79
-44
lines changed

bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ __Vectors DCD __initial_sp ; Top of Stack
141141
DCD TRNG_IRQHandler ; 96:TRNG
142142
DCD FPU_IRQHandler ; 97:FPU
143143
DCD UART6_IRQHandler ; 98:UART6
144-
DCD UART7_IRQHandler ; 98:UART7
144+
DCD UART7_IRQHandler ; 99:UART7
145145
DCD SPI3_IRQHandler ; 100:SPI3
146146
DCD SPI4_IRQHandler ; 101:SPI4
147147
DCD SPI5_IRQHandler ; 102:SPI5
148+
DCD 0 ; 103:Reserved
148149
DCD TLI_IRQHandler ; 104:TLI
149150
DCD TLI_ER_IRQHandler ; 105:TLI Error
150151
DCD IPA_IRQHandler ; 106:IPA

bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ g_pfnVectors:
104104
.word CAN1_TX_IRQHandler // 79:CAN1 TX
105105
.word CAN1_RX0_IRQHandler // 80:CAN1 RX0
106106
.word CAN1_RX1_IRQHandler // 81:CAN1 RX1
107+
.word CAN1_EWMC_IRQHandler // 82:CAN1 EWMC
107108
.word USBFS_IRQHandler // 83:USBFS
108109
.word DMA1_Channel5_IRQHandler // 84:DMA1 Channel5
109110
.word DMA1_Channel6_IRQHandler // 85:DMA1 Channel6
@@ -120,10 +121,11 @@ g_pfnVectors:
120121
.word TRNG_IRQHandler // 96:TRNG
121122
.word FPU_IRQHandler // 97:FPU
122123
.word UART6_IRQHandler // 98:UART6
123-
.word UART7_IRQHandler // 98:UART7
124+
.word UART7_IRQHandler // 99:UART7
124125
.word SPI3_IRQHandler // 100:SPI3
125126
.word SPI4_IRQHandler // 101:SPI4
126127
.word SPI5_IRQHandler // 102:SPI5
128+
.word 0 // 103:Reserved
127129
.word TLI_IRQHandler // 104:TLI
128130
.word TLI_ER_IRQHandler // 105:TLI Error
129131
.word IPA_IRQHandler // 106:IPA

bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ __vector_table
125125
DCD TRNG_IRQHandler ; 96:TRNG
126126
DCD FPU_IRQHandler ; 97:FPU
127127
DCD UART6_IRQHandler ; 98:UART6
128-
DCD UART7_IRQHandler ; 98:UART7
128+
DCD UART7_IRQHandler ; 99:UART7
129129
DCD SPI3_IRQHandler ; 100:SPI3
130130
DCD SPI4_IRQHandler ; 101:SPI4
131131
DCD SPI5_IRQHandler ; 102:SPI5
132+
DCD 0 ; 103:Reserved
132133
DCD TLI_IRQHandler ; 104:TLI
133134
DCD TLI_ER_IRQHandler ; 105:TLI Error
134135
DCD IPA_IRQHandler ; 106:IPA

bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
233233
HAL_FLASH_Unlock();
234234

235235
/* Clear OPTVERR bit set on virgin samples */
236-
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);
236+
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR | FLASH_FLAG_PGSERR);
237237
/* Get the 1st page to erase */
238238
FirstPage = GetPage(addr);
239239
/* Get the number of pages to erase from 1st page */

bsp/stm32/libraries/HAL_Drivers/drv_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int rt_wdt_init(void)
109109

110110
stm32_wdt.hiwdg.Init.Reload = 0x00000FFF;
111111
#if defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F7) \
112-
|| defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0)
112+
|| defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0) || defined(SOC_SERIES_STM32G0)
113113
stm32_wdt.hiwdg.Init.Window = 0x00000FFF;
114114
#endif
115115
stm32_wdt.is_start = 0;

components/net/at/src/at_cli.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ static void client_cli_parser(at_client_t client)
264264
}
265265
else
266266
{
267+
if(cur_line_len >= FINSH_CMD_SIZE)
268+
{
269+
continue;
270+
}
267271
rt_kprintf("%c", ch);
268272
cur_line[cur_line_len++] = ch;
269273
}

components/net/lwip-1.4.1/src/arch/include/arch/cc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
#include <string.h>
4141
#include <stdint.h>
4242

43+
#ifndef BYTE_ORDER
44+
#ifdef RT_USING_BIG_ENDIAN
45+
#define BYTE_ORDER BIG_ENDIAN
46+
#else
47+
#define BYTE_ORDER LITTLE_ENDIAN
48+
#endif /* RT_USING_BIG_ENDIAN */
49+
#endif /* BYTE_ORDER */
50+
4351
typedef uint8_t u8_t;
4452
typedef int8_t s8_t;
4553
typedef uint16_t u16_t;

components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@
3939

4040
#include <rtthread.h>
4141

42-
#ifndef BYTE_ORDER
43-
#define BYTE_ORDER LITTLE_ENDIAN
44-
#endif
45-
4642
#define SYS_MBOX_NULL RT_NULL
4743
#define SYS_SEM_NULL RT_NULL
4844

49-
typedef u32_t sys_prot_t;
45+
typedef rt_uint32_t sys_prot_t;
5046

5147
#define SYS_MBOX_SIZE 10
5248
#define SYS_LWIP_TIMER_NAME "timer"

components/net/lwip-1.4.1/src/lwipopts.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737

3838
#define LWIP_PLATFORM_BYTESWAP 0
3939

40-
#ifndef BYTE_ORDER
41-
#define BYTE_ORDER LITTLE_ENDIAN
42-
#endif
43-
4440
/* #define RT_LWIP_DEBUG */
4541

4642
#ifdef RT_LWIP_DEBUG

components/net/lwip-2.0.2/src/arch/include/arch/cc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
#include <rtthread.h>
4040
#include <string.h>
4141

42+
#ifndef BYTE_ORDER
43+
#ifdef RT_USING_BIG_ENDIAN
44+
#define BYTE_ORDER BIG_ENDIAN
45+
#else
46+
#define BYTE_ORDER LITTLE_ENDIAN
47+
#endif /* RT_USING_BIG_ENDIAN */
48+
#endif /* BYTE_ORDER */
49+
4250
#define U16_F "hu"
4351
#define S16_F "hd"
4452
#define X16_F "hx"

components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@
3939

4040
#include <rtthread.h>
4141

42-
#ifndef BYTE_ORDER
43-
#define BYTE_ORDER LITTLE_ENDIAN
44-
#endif
45-
4642
#define SYS_MBOX_NULL RT_NULL
4743
#define SYS_SEM_NULL RT_NULL
4844

49-
typedef u32_t sys_prot_t;
45+
typedef rt_uint32_t sys_prot_t;
5046

5147
#define SYS_MBOX_SIZE 10
5248
#define SYS_LWIP_TIMER_NAME "timer"

components/net/lwip-2.0.2/src/lwipopts.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545

4646
#define LWIP_PLATFORM_BYTESWAP 0
4747

48-
#ifndef BYTE_ORDER
49-
#define BYTE_ORDER LITTLE_ENDIAN
50-
#endif
51-
5248
/* #define RT_LWIP_DEBUG */
5349

5450
#ifdef RT_LWIP_DEBUG

components/net/lwip-2.0.3/src/arch/include/arch/cc.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
#include <rtthread.h>
4040
#include <string.h>
4141

42+
#ifndef BYTE_ORDER
43+
#ifdef RT_USING_BIG_ENDIAN
44+
#define BYTE_ORDER BIG_ENDIAN
45+
#else
46+
#define BYTE_ORDER LITTLE_ENDIAN
47+
#endif /* RT_USING_BIG_ENDIAN */
48+
#endif /* BYTE_ORDER */
4249

4350
#define U16_F "hu"
4451
#define S16_F "hd"

components/net/lwip-2.0.3/src/arch/include/arch/sys_arch.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,12 @@
3636
#define __ARCH_SYS_ARCH_H__
3737

3838
#include "arch/cc.h"
39-
4039
#include <rtthread.h>
4140

42-
#ifndef BYTE_ORDER
43-
#define BYTE_ORDER LITTLE_ENDIAN
44-
#endif
45-
4641
#define SYS_MBOX_NULL RT_NULL
4742
#define SYS_SEM_NULL RT_NULL
4843

49-
typedef u32_t sys_prot_t;
44+
typedef rt_uint32_t sys_prot_t;
5045

5146
#define SYS_MBOX_SIZE 10
5247
#define SYS_LWIP_TIMER_NAME "timer"

components/net/lwip-2.0.3/src/lwipopts.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545

4646
#define LWIP_PLATFORM_BYTESWAP 0
4747

48-
#ifndef BYTE_ORDER
49-
#define BYTE_ORDER LITTLE_ENDIAN
50-
#endif
51-
5248
/* #define RT_LWIP_DEBUG */
5349

5450
#ifdef RT_LWIP_DEBUG

components/net/lwip-2.1.2/src/arch/include/arch/cc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
#include <rtthread.h>
4040
#include <string.h>
4141

42+
#ifndef BYTE_ORDER
43+
#ifdef RT_USING_BIG_ENDIAN
44+
#define BYTE_ORDER BIG_ENDIAN
45+
#else
46+
#define BYTE_ORDER LITTLE_ENDIAN
47+
#endif /* RT_USING_BIG_ENDIAN */
48+
#endif /* BYTE_ORDER */
49+
4250
#define U16_F "hu"
4351
#define S16_F "hd"
4452
#define X16_F "hx"

components/net/lwip-2.1.2/src/arch/include/arch/sys_arch.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,12 @@
3636
#define __ARCH_SYS_ARCH_H__
3737

3838
#include "arch/cc.h"
39-
4039
#include <rtthread.h>
4140

42-
#ifndef BYTE_ORDER
43-
#define BYTE_ORDER LITTLE_ENDIAN
44-
#endif
45-
4641
#define SYS_MBOX_NULL RT_NULL
4742
#define SYS_SEM_NULL RT_NULL
4843

49-
typedef u32_t sys_prot_t;
44+
typedef rt_uint32_t sys_prot_t;
5045

5146
#define SYS_MBOX_SIZE 10
5247
#define SYS_LWIP_TIMER_NAME "timer"

components/net/lwip-2.1.2/src/arch/sys_arch.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex)
360360
rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter);
361361
counter ++;
362362

363-
tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO);
363+
tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO);
364364
if (tmpmutex == RT_NULL)
365365
return ERR_MEM;
366366
else
@@ -779,6 +779,32 @@ void ppp_trace(int level, const char *format, ...)
779779
}
780780
#endif
781781

782+
#ifdef LWIP_HOOK_IP4_ROUTE_SRC
783+
struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src)
784+
{
785+
struct netif *netif;
786+
787+
/* iterate through netifs */
788+
for (netif = netif_list; netif != NULL; netif = netif->next)
789+
{
790+
/* is the netif up, does it have a link and a valid address? */
791+
if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif)))
792+
{
793+
/* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */
794+
if (src != NULL)
795+
{
796+
if (ip4_addr_cmp(src, netif_ip4_addr(netif)))
797+
{
798+
return netif;
799+
}
800+
}
801+
}
802+
}
803+
netif = netif_default;
804+
return netif;
805+
}
806+
#endif /* LWIP_HOOK_IP4_ROUTE_SRC */
807+
782808
/*
783809
* export bsd socket symbol for RT-Thread Application Module
784810
*/

components/net/lwip-2.1.2/src/lwipopts.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747

4848
#define LWIP_PLATFORM_BYTESWAP 0
4949

50-
#ifndef BYTE_ORDER
51-
#define BYTE_ORDER LITTLE_ENDIAN
52-
#endif
53-
5450
/* #define RT_LWIP_DEBUG */
5551

5652
#ifdef RT_LWIP_DEBUG
@@ -648,4 +644,8 @@
648644
#endif
649645

650646

647+
#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) lwip_ip4_route_src(dest, src)
648+
#include "lwip/ip_addr.h"
649+
struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src);
650+
651651
#endif /* __LWIPOPTS_H__ */

0 commit comments

Comments
 (0)