会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
信念D力量`Blog
博客园
首页
联系
订阅
管理
2023年11月7日
CMake 构建静态库和动态库
摘要: 静态库 项目结构: Message.h #pragma once #include <iosfwd> #include <string> class Message { public: Message(const std::string& m); void printMsg(void); void
阅读全文
posted @ 2023-11-07 20:47 小土坡
阅读(27)
评论(0)
推荐(0)
2023年10月26日
C++ 构造函数
摘要: C++ 构造函数就是创建类对象时自动执行的函数,编译器会默认提供3给默认构造函数,一个构造函数,一个拷贝构造函数,一个移动构造函数。 例子: class A { }; 类 A 的3给默认构造函数为: A(); // 构造函数 A(const A&); // 拷贝构造函数 A(A&&) // 移动构造
阅读全文
posted @ 2023-10-26 22:43 小土坡
阅读(26)
评论(0)
推荐(0)
2023年10月22日
分享我的AT32F413CCU7核心板原理图
摘要: 在此分享一个我画的AT32F413CCU7核心板原理图,该原理图使用 KiCAD 绘制,并且已在嘉立创打了版,经测试正常。 链接:https://pan.baidu.com/s/1_OIfiv8Prb3favvymzhYgg?pwd=u6ga 提取码:u6ga
阅读全文
posted @ 2023-10-22 15:23 小土坡
阅读(111)
评论(0)
推荐(0)
用 C++ 的方式写一个通用的 IO 库
摘要: 新建两个文件 xtp_io.h 和 xtp_io.cpp,在该两个文件中定义一个 IO class,然后实现3个类函数:high()、low()、toggle()。 xtp_io.h #pragma once #include "xtp_defines.h" #if defined AT32 #in
阅读全文
posted @ 2023-10-22 03:48 小土坡
阅读(33)
评论(0)
推荐(0)
分享一个 FreeRTOS 任务通知的例子,基于C++的混合开发尝试
摘要: 首先创建一个 led.h 和一个 led.cpp,文件内容如下: led.h #pragma once #include "FreeRTOS.h" #include "task.h" #include "at32f413.h" class Led { public: Led(gpio_type* _
阅读全文
posted @ 2023-10-22 02:31 小土坡
阅读(245)
评论(0)
推荐(0)
第一个基于 C++ 的 Qt 程序,开发工具 CLion
摘要: 这里直接给出代码: AppWindow.h // // Created by freer on 2023/10/22. // #ifndef UNTITLED_APPWINDOW_H #define UNTITLED_APPWINDOW_H #include <QtWidgets> #include
阅读全文
posted @ 2023-10-22 01:20 小土坡
阅读(62)
评论(0)
推荐(0)
2023年8月18日
Vim 基础配置
摘要: ```vim " 设置行号 set number " 不与vi兼容 set nocompatible " 语法高亮 syntax on " 模式显示 set showmode set showcmd " 支持鼠标 set mouse=a " utf-8 编码 set encoding=utf-8 "
阅读全文
posted @ 2023-08-18 01:15 小土坡
阅读(118)
评论(0)
推荐(0)
2023年8月17日
AT32 IIC 固件库函数的使用
摘要: ## at32f413_i2c.h ## 宏定义 ```c #define I2C_STARTF_FLAG ((uint32_t)0x00000001) /*!< I2c启动条件生成完成标志 */ #define I2C_ADDR7F_FLAG ((uint32_t)0x00000002) /*!<
阅读全文
posted @ 2023-08-17 23:20 小土坡
阅读(192)
评论(0)
推荐(0)
2023年8月13日
rust 声明宏学习笔记
摘要: 在写 `rust` 版的 `hello,world` 时想必你一定用到了 `println!();` 这个“函数”了吧,其实 `println!()` 就是一个`声明宏`。 声明宏语法: `macro_rules ! 宏名字 宏规则1|宏规则2..` 匹配器: - `item` : 程序项 - `b
阅读全文
posted @ 2023-08-13 14:17 小土坡
阅读(77)
评论(0)
推荐(0)
Rust 中的包的使用,以及将包分为多个文件模块
摘要: ## 在 main.rs 中创建一个模块 例子如下: ```rust mod geometry { #[derive(Debug)] #[derive(Default)] pub struct Box { pub width: f64, pub height: f64, pub length: f6
阅读全文
posted @ 2023-08-13 13:35 小土坡
阅读(391)
评论(0)
推荐(0)
下一页
公告