generated from hulk/gd32e23x_template_cmake_vscode
适配bootloader
This commit is contained in:
@@ -12,8 +12,8 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
|
||||
/* Memories definition */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 4K
|
||||
FLASH (rx) : ORIGIN = 0x08002000, LENGTH = 32K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include "board_config.h"
|
||||
#include "gd32e23x_usart.h"
|
||||
#include "gd32e23x_misc.h"
|
||||
#include "ultrasonic_analog.h"
|
||||
#include "systick.h"
|
||||
|
||||
@@ -291,6 +292,12 @@ void handle_command(const uint8_t *frame, uint8_t len) {
|
||||
// send_response(RESP_TYPE_OK, (uint8_t *)"v23.0.0.3", 9);
|
||||
return;
|
||||
|
||||
case 9999u:
|
||||
// M9999: 重启系统
|
||||
__disable_irq(); // 关闭全局中断(GD32E230 CMSIS标准函数)
|
||||
nvic_system_reset(); // 系统复位(GD32E230标准库函数)
|
||||
break;
|
||||
|
||||
default:
|
||||
// 其它无参数命令在此扩展(示例:M100)处理逻辑该如何待定
|
||||
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));
|
||||
|
Reference in New Issue
Block a user