编译成功
This commit is contained in:
+70
-3
@@ -7,6 +7,64 @@ srcDirs: []
|
|||||||
virtualFolder:
|
virtualFolder:
|
||||||
name: <virtual_root>
|
name: <virtual_root>
|
||||||
files: []
|
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: []
|
folders: []
|
||||||
dependenceList: []
|
dependenceList: []
|
||||||
outDir: Output
|
outDir: Output
|
||||||
@@ -15,8 +73,17 @@ miscInfo:
|
|||||||
targets:
|
targets:
|
||||||
Debug:
|
Debug:
|
||||||
cppPreprocessAttrs:
|
cppPreprocessAttrs:
|
||||||
defineList: []
|
defineList:
|
||||||
incList: []
|
- 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: []
|
libList: []
|
||||||
excludeList: []
|
excludeList: []
|
||||||
settings:
|
settings:
|
||||||
@@ -55,7 +122,7 @@ targets:
|
|||||||
LIB_FLAGS: -lm
|
LIB_FLAGS: -lm
|
||||||
output-format: elf
|
output-format: elf
|
||||||
remove-unused-input-sections: true
|
remove-unused-input-sections: true
|
||||||
scatterFilePath: <YOUR_LINKER_SCRIPT>.lds
|
scatterFilePath: VoiletBspStm32F10x/System/LinkScripts/Gcc/stm32_flash_ze.ld
|
||||||
storageLayout:
|
storageLayout:
|
||||||
RAM: []
|
RAM: []
|
||||||
ROM: []
|
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
|
#define WR_BUFFER_SIZE 512
|
||||||
|
|
||||||
/* 1. 创建shell对象,开辟shell缓冲区 */
|
/* 1. 创建shell对象,开辟shell缓冲区 */
|
||||||
Shell Host; //Shell实例化
|
Shell Host; // Shell实例化
|
||||||
char HostBuffer[WR_BUFFER_SIZE]; //读写缓冲区
|
char HostBuffer[WR_BUFFER_SIZE]; // 读写缓冲区
|
||||||
const COM_MAP_T *HostCom = TTY_COM;
|
const COM_MAP_T *HostCom = TTY_COM;
|
||||||
/**
|
/**
|
||||||
* @brief Shell写函数
|
* @brief Shell写函数
|
||||||
@@ -16,8 +16,9 @@ const COM_MAP_T *HostCom = TTY_COM;
|
|||||||
* @note void
|
* @note void
|
||||||
* @example void
|
* @example void
|
||||||
*/
|
*/
|
||||||
signed short ShellWrite(char *ch, unsigned short Len) {
|
signed short ShellWrite(char *ch, unsigned short Len)
|
||||||
ComSendStr(HostCom, (uint8_t *) ch, Len);
|
{
|
||||||
|
ComSendStr(HostCom, (uint8_t *)ch, Len);
|
||||||
return Len;
|
return Len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,29 +29,30 @@ signed short ShellWrite(char *ch, unsigned short Len) {
|
|||||||
* @note void
|
* @note void
|
||||||
* @example void
|
* @example void
|
||||||
*/
|
*/
|
||||||
void LetterShellIrqFunc(void *Param) {
|
void LetterShellIrqFunc(void *Param)
|
||||||
|
{
|
||||||
uint8_t ch = 0x00;
|
uint8_t ch = 0x00;
|
||||||
ch = ComReceiveChar(Param);
|
ch = ComReceiveChar(Param);
|
||||||
shellHandler(&Host, ch);
|
shellHandler(&Host, ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 初始化Shell
|
* @brief 初始化Shell
|
||||||
* @note void
|
* @note void
|
||||||
* @param ComX 串口号,baud 波特率
|
* @param ComX 串口号,baud 波特率
|
||||||
* @retval void
|
* @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);
|
ComStdConfig(ComX, Baud);
|
||||||
//设置串口回调函数
|
// 设置串口回调函数
|
||||||
IrqRegister(ComX->Periph.Irqn, LetterShellIrqFunc);
|
IrqRegister(ComX->Periph.Irqn, LetterShellIrqFunc);
|
||||||
//设置中断等级
|
// 设置中断等级
|
||||||
IrqEnable(ComX->Periph.Irqn, 1, 1);
|
IrqEnable(ComX->Periph.Irqn, 1, 1);
|
||||||
//注册写函数
|
// 注册写函数
|
||||||
Host.write = ShellWrite;
|
Host.write = ShellWrite;
|
||||||
//初始化LetterShell
|
// 初始化LetterShell
|
||||||
shellInit(&Host, HostBuffer, WR_BUFFER_SIZE);
|
shellInit(&Host, HostBuffer, WR_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,17 +2,19 @@
|
|||||||
// Created by anonymous on 2026/5/24.
|
// Created by anonymous on 2026/5/24.
|
||||||
//
|
//
|
||||||
/* C标准库头文件 */
|
/* C标准库头文件 */
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
/* BSP文件 */
|
/* BSP文件 */
|
||||||
#include "main.h"
|
|
||||||
#include "Bsp.h"
|
#include "Bsp.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void)
|
||||||
|
{
|
||||||
|
|
||||||
BspInit();
|
BspInit();
|
||||||
|
|
||||||
while (1) {
|
while (1)
|
||||||
|
{
|
||||||
LedToggle(LED0);
|
LedToggle(LED0);
|
||||||
DelayMs(100);
|
DelayMs(100);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user