Merge pull request #5413 from xiangxistu/v4.0.x

按照 v4.0.5 计划同步内容
This commit is contained in:
guo 2021-12-22 16:00:12 +08:00 committed by GitHub
commit 36538b2914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 79 additions and 44 deletions

View File

@ -141,10 +141,11 @@ __Vectors DCD __initial_sp ; Top of Stack
DCD TRNG_IRQHandler ; 96:TRNG DCD TRNG_IRQHandler ; 96:TRNG
DCD FPU_IRQHandler ; 97:FPU DCD FPU_IRQHandler ; 97:FPU
DCD UART6_IRQHandler ; 98:UART6 DCD UART6_IRQHandler ; 98:UART6
DCD UART7_IRQHandler ; 98:UART7 DCD UART7_IRQHandler ; 99:UART7
DCD SPI3_IRQHandler ; 100:SPI3 DCD SPI3_IRQHandler ; 100:SPI3
DCD SPI4_IRQHandler ; 101:SPI4 DCD SPI4_IRQHandler ; 101:SPI4
DCD SPI5_IRQHandler ; 102:SPI5 DCD SPI5_IRQHandler ; 102:SPI5
DCD 0 ; 103:Reserved
DCD TLI_IRQHandler ; 104:TLI DCD TLI_IRQHandler ; 104:TLI
DCD TLI_ER_IRQHandler ; 105:TLI Error DCD TLI_ER_IRQHandler ; 105:TLI Error
DCD IPA_IRQHandler ; 106:IPA DCD IPA_IRQHandler ; 106:IPA

View File

@ -104,6 +104,7 @@ g_pfnVectors:
.word CAN1_TX_IRQHandler // 79:CAN1 TX .word CAN1_TX_IRQHandler // 79:CAN1 TX
.word CAN1_RX0_IRQHandler // 80:CAN1 RX0 .word CAN1_RX0_IRQHandler // 80:CAN1 RX0
.word CAN1_RX1_IRQHandler // 81:CAN1 RX1 .word CAN1_RX1_IRQHandler // 81:CAN1 RX1
.word CAN1_EWMC_IRQHandler // 82:CAN1 EWMC
.word USBFS_IRQHandler // 83:USBFS .word USBFS_IRQHandler // 83:USBFS
.word DMA1_Channel5_IRQHandler // 84:DMA1 Channel5 .word DMA1_Channel5_IRQHandler // 84:DMA1 Channel5
.word DMA1_Channel6_IRQHandler // 85:DMA1 Channel6 .word DMA1_Channel6_IRQHandler // 85:DMA1 Channel6
@ -120,10 +121,11 @@ g_pfnVectors:
.word TRNG_IRQHandler // 96:TRNG .word TRNG_IRQHandler // 96:TRNG
.word FPU_IRQHandler // 97:FPU .word FPU_IRQHandler // 97:FPU
.word UART6_IRQHandler // 98:UART6 .word UART6_IRQHandler // 98:UART6
.word UART7_IRQHandler // 98:UART7 .word UART7_IRQHandler // 99:UART7
.word SPI3_IRQHandler // 100:SPI3 .word SPI3_IRQHandler // 100:SPI3
.word SPI4_IRQHandler // 101:SPI4 .word SPI4_IRQHandler // 101:SPI4
.word SPI5_IRQHandler // 102:SPI5 .word SPI5_IRQHandler // 102:SPI5
.word 0 // 103:Reserved
.word TLI_IRQHandler // 104:TLI .word TLI_IRQHandler // 104:TLI
.word TLI_ER_IRQHandler // 105:TLI Error .word TLI_ER_IRQHandler // 105:TLI Error
.word IPA_IRQHandler // 106:IPA .word IPA_IRQHandler // 106:IPA

View File

@ -125,10 +125,11 @@ __vector_table
DCD TRNG_IRQHandler ; 96:TRNG DCD TRNG_IRQHandler ; 96:TRNG
DCD FPU_IRQHandler ; 97:FPU DCD FPU_IRQHandler ; 97:FPU
DCD UART6_IRQHandler ; 98:UART6 DCD UART6_IRQHandler ; 98:UART6
DCD UART7_IRQHandler ; 98:UART7 DCD UART7_IRQHandler ; 99:UART7
DCD SPI3_IRQHandler ; 100:SPI3 DCD SPI3_IRQHandler ; 100:SPI3
DCD SPI4_IRQHandler ; 101:SPI4 DCD SPI4_IRQHandler ; 101:SPI4
DCD SPI5_IRQHandler ; 102:SPI5 DCD SPI5_IRQHandler ; 102:SPI5
DCD 0 ; 103:Reserved
DCD TLI_IRQHandler ; 104:TLI DCD TLI_IRQHandler ; 104:TLI
DCD TLI_ER_IRQHandler ; 105:TLI Error DCD TLI_ER_IRQHandler ; 105:TLI Error
DCD IPA_IRQHandler ; 106:IPA DCD IPA_IRQHandler ; 106:IPA

View File

@ -233,7 +233,7 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
HAL_FLASH_Unlock(); HAL_FLASH_Unlock();
/* Clear OPTVERR bit set on virgin samples */ /* Clear OPTVERR bit set on virgin samples */
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR); __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR | FLASH_FLAG_PGSERR);
/* Get the 1st page to erase */ /* Get the 1st page to erase */
FirstPage = GetPage(addr); FirstPage = GetPage(addr);
/* Get the number of pages to erase from 1st page */ /* Get the number of pages to erase from 1st page */

View File

@ -109,7 +109,7 @@ int rt_wdt_init(void)
stm32_wdt.hiwdg.Init.Reload = 0x00000FFF; stm32_wdt.hiwdg.Init.Reload = 0x00000FFF;
#if defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F7) \ #if defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F7) \
|| defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0) || defined(SOC_SERIES_STM32G0)
stm32_wdt.hiwdg.Init.Window = 0x00000FFF; stm32_wdt.hiwdg.Init.Window = 0x00000FFF;
#endif #endif
stm32_wdt.is_start = 0; stm32_wdt.is_start = 0;

View File

@ -264,6 +264,10 @@ static void client_cli_parser(at_client_t client)
} }
else else
{ {
if(cur_line_len >= FINSH_CMD_SIZE)
{
continue;
}
rt_kprintf("%c", ch); rt_kprintf("%c", ch);
cur_line[cur_line_len++] = ch; cur_line[cur_line_len++] = ch;
} }

View File

@ -40,6 +40,14 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#ifndef BYTE_ORDER
#ifdef RT_USING_BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* RT_USING_BIG_ENDIAN */
#endif /* BYTE_ORDER */
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef int8_t s8_t; typedef int8_t s8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;

View File

@ -39,14 +39,10 @@
#include <rtthread.h> #include <rtthread.h>
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define SYS_MBOX_NULL RT_NULL #define SYS_MBOX_NULL RT_NULL
#define SYS_SEM_NULL RT_NULL #define SYS_SEM_NULL RT_NULL
typedef u32_t sys_prot_t; typedef rt_uint32_t sys_prot_t;
#define SYS_MBOX_SIZE 10 #define SYS_MBOX_SIZE 10
#define SYS_LWIP_TIMER_NAME "timer" #define SYS_LWIP_TIMER_NAME "timer"

View File

@ -37,10 +37,6 @@
#define LWIP_PLATFORM_BYTESWAP 0 #define LWIP_PLATFORM_BYTESWAP 0
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/* #define RT_LWIP_DEBUG */ /* #define RT_LWIP_DEBUG */
#ifdef RT_LWIP_DEBUG #ifdef RT_LWIP_DEBUG

View File

@ -39,6 +39,14 @@
#include <rtthread.h> #include <rtthread.h>
#include <string.h> #include <string.h>
#ifndef BYTE_ORDER
#ifdef RT_USING_BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* RT_USING_BIG_ENDIAN */
#endif /* BYTE_ORDER */
#define U16_F "hu" #define U16_F "hu"
#define S16_F "hd" #define S16_F "hd"
#define X16_F "hx" #define X16_F "hx"

View File

@ -39,14 +39,10 @@
#include <rtthread.h> #include <rtthread.h>
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define SYS_MBOX_NULL RT_NULL #define SYS_MBOX_NULL RT_NULL
#define SYS_SEM_NULL RT_NULL #define SYS_SEM_NULL RT_NULL
typedef u32_t sys_prot_t; typedef rt_uint32_t sys_prot_t;
#define SYS_MBOX_SIZE 10 #define SYS_MBOX_SIZE 10
#define SYS_LWIP_TIMER_NAME "timer" #define SYS_LWIP_TIMER_NAME "timer"

View File

@ -45,10 +45,6 @@
#define LWIP_PLATFORM_BYTESWAP 0 #define LWIP_PLATFORM_BYTESWAP 0
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/* #define RT_LWIP_DEBUG */ /* #define RT_LWIP_DEBUG */
#ifdef RT_LWIP_DEBUG #ifdef RT_LWIP_DEBUG

View File

@ -39,6 +39,13 @@
#include <rtthread.h> #include <rtthread.h>
#include <string.h> #include <string.h>
#ifndef BYTE_ORDER
#ifdef RT_USING_BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* RT_USING_BIG_ENDIAN */
#endif /* BYTE_ORDER */
#define U16_F "hu" #define U16_F "hu"
#define S16_F "hd" #define S16_F "hd"

View File

@ -36,17 +36,12 @@
#define __ARCH_SYS_ARCH_H__ #define __ARCH_SYS_ARCH_H__
#include "arch/cc.h" #include "arch/cc.h"
#include <rtthread.h> #include <rtthread.h>
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define SYS_MBOX_NULL RT_NULL #define SYS_MBOX_NULL RT_NULL
#define SYS_SEM_NULL RT_NULL #define SYS_SEM_NULL RT_NULL
typedef u32_t sys_prot_t; typedef rt_uint32_t sys_prot_t;
#define SYS_MBOX_SIZE 10 #define SYS_MBOX_SIZE 10
#define SYS_LWIP_TIMER_NAME "timer" #define SYS_LWIP_TIMER_NAME "timer"

View File

@ -45,10 +45,6 @@
#define LWIP_PLATFORM_BYTESWAP 0 #define LWIP_PLATFORM_BYTESWAP 0
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/* #define RT_LWIP_DEBUG */ /* #define RT_LWIP_DEBUG */
#ifdef RT_LWIP_DEBUG #ifdef RT_LWIP_DEBUG

View File

@ -39,6 +39,14 @@
#include <rtthread.h> #include <rtthread.h>
#include <string.h> #include <string.h>
#ifndef BYTE_ORDER
#ifdef RT_USING_BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* RT_USING_BIG_ENDIAN */
#endif /* BYTE_ORDER */
#define U16_F "hu" #define U16_F "hu"
#define S16_F "hd" #define S16_F "hd"
#define X16_F "hx" #define X16_F "hx"

View File

@ -36,17 +36,12 @@
#define __ARCH_SYS_ARCH_H__ #define __ARCH_SYS_ARCH_H__
#include "arch/cc.h" #include "arch/cc.h"
#include <rtthread.h> #include <rtthread.h>
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define SYS_MBOX_NULL RT_NULL #define SYS_MBOX_NULL RT_NULL
#define SYS_SEM_NULL RT_NULL #define SYS_SEM_NULL RT_NULL
typedef u32_t sys_prot_t; typedef rt_uint32_t sys_prot_t;
#define SYS_MBOX_SIZE 10 #define SYS_MBOX_SIZE 10
#define SYS_LWIP_TIMER_NAME "timer" #define SYS_LWIP_TIMER_NAME "timer"

View File

@ -360,7 +360,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex)
rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter);
counter ++; counter ++;
tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO);
if (tmpmutex == RT_NULL) if (tmpmutex == RT_NULL)
return ERR_MEM; return ERR_MEM;
else else
@ -779,6 +779,32 @@ void ppp_trace(int level, const char *format, ...)
} }
#endif #endif
#ifdef LWIP_HOOK_IP4_ROUTE_SRC
struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src)
{
struct netif *netif;
/* iterate through netifs */
for (netif = netif_list; netif != NULL; netif = netif->next)
{
/* is the netif up, does it have a link and a valid address? */
if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif)))
{
/* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */
if (src != NULL)
{
if (ip4_addr_cmp(src, netif_ip4_addr(netif)))
{
return netif;
}
}
}
}
netif = netif_default;
return netif;
}
#endif /* LWIP_HOOK_IP4_ROUTE_SRC */
/* /*
* export bsd socket symbol for RT-Thread Application Module * export bsd socket symbol for RT-Thread Application Module
*/ */

View File

@ -47,10 +47,6 @@
#define LWIP_PLATFORM_BYTESWAP 0 #define LWIP_PLATFORM_BYTESWAP 0
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/* #define RT_LWIP_DEBUG */ /* #define RT_LWIP_DEBUG */
#ifdef RT_LWIP_DEBUG #ifdef RT_LWIP_DEBUG
@ -648,4 +644,8 @@
#endif #endif
#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) lwip_ip4_route_src(dest, src)
#include "lwip/ip_addr.h"
struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src);
#endif /* __LWIPOPTS_H__ */ #endif /* __LWIPOPTS_H__ */