- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 ubuntu22.04 USB Serial Device converter now disconnected
前提条件是,确认切换到虚拟机连接usb转串口;查询设备是否存在,结果找不到。查询usb设备列表,设备还在。查看内核信息,发现usb disconnected。再查看内核最近打印信息,经过查找资料,说是与brltty冲突,需卸载brltty。卸载brltty。重新插拔usb转串口,并切换到虚拟机连接,发现已有usb转串口设备,USB Serial Device converter now disconnected的现象不再出现。...
2022-07-07 15:12:39
1705
1
原创 stm32CubeIDE串口支持printf打印
在usart.c最后增加重写_write函数就可以支持printf打印;/** * @brief redefine write * * @param file * @param buf * @param nbyte * @return int */__attribute__((weak)) int _write(int file, char *buf, int nbyte){ if (HAL_UART_Transmit(&huart2, buf, nbyte, 0x
2022-05-24 12:26:23
994
原创 stm32 hal库的串口中断卡死问题
最近在调试stm32的串口程序发现,1ms的串口收发导致串口卡死,系统正常。经过调试发现hal库的串口中断接收函数,上锁了,但未释放锁。整段函数代码里,只有__HAL_LOCK(huart);上锁函数,没有找到锁的释放,hal库的串口中断接收函数如下:** * @brief Receive an amount of data in interrupt mode. * @note When UART parity is not enabled (PCE = 0), and Word Lengt
2022-05-19 10:26:20
4932
5
原创 文件和字符串的md5算法
需加入的头文件#include "openssl/md5.h"#include <iomanip>字符串的md5算法: std::string MD5(std::string &data) { MD5_CTX ctx; std::ostringstream oss; unsigned char output[32]; MD5_Init(&ctx); MD5_Up..
2020-10-28 20:59:00
268
原创 02尽量以const、enum、inline替换#define【Effective C++笔记】
#define ASPECT_RATIO 1.653const double AspectRatio=1.653;
2020-10-26 20:40:39
234
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人