新增:串口通讯避障功能
1、Launcher中的串口只使用串口0(调试串口)、串口2(主动RS485端口);串口1与串口3不使用,且不初始化。将串口通讯缓冲区修改为1100Byte。 目的:CH564由于将Launcher代码搬运到RAM中运行,因此可使用的变量大小只有32Kbyte。不使用的串口将不初始化,同时使用的通讯缓冲区将节约出来,否则RAM空间不够使用。 2、串口2 - 增加RS485使能,同时通讯增加避障功能。
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "watchdog.h"
|
||||
|
||||
volatile uint32_t SysTick_100us = 0;
|
||||
volatile uint32_t SysTick_1ms = 0;
|
||||
@@ -65,6 +66,7 @@ void Delay_Us(uint32_t n)
|
||||
for(uint32_t i=0;i<n;i++){
|
||||
for(uint32_t j=0;j<30;j++){
|
||||
__NOP();
|
||||
WDT_Feed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,6 +295,8 @@ void Dbg_Println(int DbgOptBit ,const char *fmt, ...)
|
||||
|
||||
va_start(ap, fmt);
|
||||
while (*fmt) {
|
||||
WDT_Feed();
|
||||
|
||||
if (*fmt != '%') {
|
||||
__putchar__(*fmt++);
|
||||
continue;
|
||||
@@ -354,9 +358,10 @@ void Dbg_Print_Buff(int DbgOptBit ,const char *cmd ,uint8_t *buff,uint32_t len)
|
||||
printf("%8d [%6d]: %s",SysTick_Now,SysTick_Diff,cmd);
|
||||
for(uint32_t i=0;i<len;i++)
|
||||
{
|
||||
WDT_Feed();
|
||||
printf("%02X ",buff[i]);
|
||||
}
|
||||
printf("\n\r");
|
||||
printf("\r\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user