feat(school_stm32): 添加基础的 STM32F103RCT6 项目结构
- 创建了项目的基本目录结构和文件 - 添加了 CMakeLists.txt 和 Makefile 构建配置 - 创建了 main.c 文件,实现了简单的 LED 闪烁和按键检测功能 - 集成了 SEGGER RTT 库 - 添加了 .gitignore 文件,排除了不必要的生成文件
This commit is contained in:
24
libs/logger.h
Normal file
24
libs/logger.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __LOGGER_H__
|
||||
#define __LOGGER_H__
|
||||
|
||||
#include "SEGGER_RTT/RTT/SEGGER_RTT.h"
|
||||
#define __PYNIC_NO_STDIO__
|
||||
#define _pynic_logout_printf(fmt, ...) SEGGER_RTT_printf(0, fmt, ##__VA_ARGS__)
|
||||
#define _pynic_snprintf snprintf
|
||||
#define _pynic_exit goto_error_handler
|
||||
|
||||
void Error_Handler(void);
|
||||
static void goto_error_handler(int errno) {
|
||||
(void)errno;
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
#ifdef __PYNIC_LOG_IMPLIMENT__
|
||||
#include <stdio.h>
|
||||
#define INIT_LOGGER() do { \
|
||||
SEGGER_RTT_Init(); \
|
||||
} while(0)
|
||||
#endif
|
||||
#include "pynic_log/pynic_log.h"
|
||||
|
||||
#endif // __LOGGER_H__
|
Reference in New Issue
Block a user