编译成功
This commit is contained in:
+70
-3
@@ -7,6 +7,64 @@ srcDirs: []
|
||||
virtualFolder:
|
||||
name: <virtual_root>
|
||||
files: []
|
||||
folders:
|
||||
- name: System
|
||||
files:
|
||||
- path: VoiletBspStm32F10x/System/system_stm32f10x.c
|
||||
- path: VoiletBspStm32F10x/System/LinkScripts/Gcc/stm32_flash_ze.ld
|
||||
- path: VoiletBspStm32F10x/System/Cmsis/Src/core_cm3.c
|
||||
folders: []
|
||||
- name: Startup
|
||||
files:
|
||||
- path: VoiletBspStm32F10x/System/Startup/Gcc/startup_stm32f10x_hd.s
|
||||
folders: []
|
||||
- name: App
|
||||
files:
|
||||
- path: App/Src/LetterShell.c
|
||||
- path: App/Src/main.c
|
||||
folders: []
|
||||
- name: Shell
|
||||
files:
|
||||
- path: VoiletBspStm32F10x/ThirdParty/LetterShellV3/Src/shell.c
|
||||
- path: VoiletBspStm32F10x/ThirdParty/LetterShellV3/Src/shell_cmd_list.c
|
||||
- path: VoiletBspStm32F10x/ThirdParty/LetterShellV3/Src/shell_companion.c
|
||||
- path: VoiletBspStm32F10x/ThirdParty/LetterShellV3/Src/shell_ext.c
|
||||
folders: []
|
||||
- name: Bsp
|
||||
files:
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/Bsp.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/Delay.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/Gpio.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/Interrupt.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/SeggerCall.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/SysCall.c
|
||||
- path: VoiletBspStm32F10x/Bsp/Src/Uart.c
|
||||
folders: []
|
||||
- name: StdLib
|
||||
files:
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/misc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_adc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_bkp.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_can.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_cec.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_crc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_dac.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_dbgmcu.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_dma.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_exti.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_flash.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_fsmc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_gpio.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_i2c.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_iwdg.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_pwr.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_rcc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_rtc.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_sdio.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_spi.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_tim.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_usart.c
|
||||
- path: VoiletBspStm32F10x/StdLib/Src/stm32f10x_wwdg.c
|
||||
folders: []
|
||||
dependenceList: []
|
||||
outDir: Output
|
||||
@@ -15,8 +73,17 @@ miscInfo:
|
||||
targets:
|
||||
Debug:
|
||||
cppPreprocessAttrs:
|
||||
defineList: []
|
||||
incList: []
|
||||
defineList:
|
||||
- USE_STDPERIPH_DRIVER
|
||||
- STM32F10X_HD
|
||||
incList:
|
||||
- App/Inc
|
||||
- Board
|
||||
- VoiletBspStm32F10x/Bsp/Inc
|
||||
- VoiletBspStm32F10x/StdLib/Inc
|
||||
- VoiletBspStm32F10x/System/Cmsis/Inc
|
||||
- VoiletBspStm32F10x/System
|
||||
- VoiletBspStm32F10x/ThirdParty/LetterShellV3/Inc
|
||||
libList: []
|
||||
excludeList: []
|
||||
settings:
|
||||
@@ -55,7 +122,7 @@ targets:
|
||||
LIB_FLAGS: -lm
|
||||
output-format: elf
|
||||
remove-unused-input-sections: true
|
||||
scatterFilePath: <YOUR_LINKER_SCRIPT>.lds
|
||||
scatterFilePath: VoiletBspStm32F10x/System/LinkScripts/Gcc/stm32_flash_ze.ld
|
||||
storageLayout:
|
||||
RAM: []
|
||||
ROM: []
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"[c]": {
|
||||
"editor.defaultFormatter": "xaver.clang-format"
|
||||
},
|
||||
"[cpp]": {
|
||||
"editor.defaultFormatter": "xaver.clang-format"
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
#define WR_BUFFER_SIZE 512
|
||||
|
||||
/* 1. 创建shell对象,开辟shell缓冲区 */
|
||||
Shell Host; //Shell实例化
|
||||
char HostBuffer[WR_BUFFER_SIZE]; //读写缓冲区
|
||||
Shell Host; // Shell实例化
|
||||
char HostBuffer[WR_BUFFER_SIZE]; // 读写缓冲区
|
||||
const COM_MAP_T *HostCom = TTY_COM;
|
||||
/**
|
||||
* @brief Shell写函数
|
||||
@@ -16,8 +16,9 @@ const COM_MAP_T *HostCom = TTY_COM;
|
||||
* @note void
|
||||
* @example void
|
||||
*/
|
||||
signed short ShellWrite(char *ch, unsigned short Len) {
|
||||
ComSendStr(HostCom, (uint8_t *) ch, Len);
|
||||
signed short ShellWrite(char *ch, unsigned short Len)
|
||||
{
|
||||
ComSendStr(HostCom, (uint8_t *)ch, Len);
|
||||
return Len;
|
||||
}
|
||||
|
||||
@@ -28,29 +29,30 @@ signed short ShellWrite(char *ch, unsigned short Len) {
|
||||
* @note void
|
||||
* @example void
|
||||
*/
|
||||
void LetterShellIrqFunc(void *Param) {
|
||||
void LetterShellIrqFunc(void *Param)
|
||||
{
|
||||
uint8_t ch = 0x00;
|
||||
ch = ComReceiveChar(Param);
|
||||
shellHandler(&Host, ch);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 初始化Shell
|
||||
* @note void
|
||||
* @param ComX 串口号,baud 波特率
|
||||
* @retval void
|
||||
*/
|
||||
void LetterShellInit(const COM_MAP_T *ComX, uint32_t Baud) {
|
||||
//初始化串口
|
||||
void LetterShellInit(const COM_MAP_T *ComX, uint32_t Baud)
|
||||
{
|
||||
// 初始化串口
|
||||
ComStdConfig(ComX, Baud);
|
||||
//设置串口回调函数
|
||||
// 设置串口回调函数
|
||||
IrqRegister(ComX->Periph.Irqn, LetterShellIrqFunc);
|
||||
//设置中断等级
|
||||
// 设置中断等级
|
||||
IrqEnable(ComX->Periph.Irqn, 1, 1);
|
||||
//注册写函数
|
||||
// 注册写函数
|
||||
Host.write = ShellWrite;
|
||||
//初始化LetterShell
|
||||
// 初始化LetterShell
|
||||
shellInit(&Host, HostBuffer, WR_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
// Created by anonymous on 2026/5/24.
|
||||
//
|
||||
/* C标准库头文件 */
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
/* BSP文件 */
|
||||
#include "main.h"
|
||||
#include "Bsp.h"
|
||||
#include "main.h"
|
||||
|
||||
int main(void) {
|
||||
int main(void)
|
||||
{
|
||||
|
||||
BspInit();
|
||||
|
||||
while (1) {
|
||||
while (1)
|
||||
{
|
||||
LedToggle(LED0);
|
||||
DelayMs(100);
|
||||
}
|
||||
Reference in New Issue
Block a user