2022-2-20-大二下
C语言Time库时间获取
格式化输出
#include <time.h>
#include <stdio.h>
int main()
{
time_t now =time(0);
struct tm *ltm = localtime(&now);
char a[100];
sprintf(a, "%04d:%02d:%02d",1900+ltm->tm_year,ltm->tm_mon,ltm->tm_mday);
printf("%s",a);
}
格式化时
%.2f保留两位小数,整数全输出
%2d保留2位整数输出,若不足两位则补 空 格
%02d保留2位整数输出,若不足两位则补0

https://blog.csdn.net/Capricorn_devil/article/details/88792531
PWM关闭!
CCR直接拉0最好
其他的方案如PWM_Stop仍然会有小波动会被EXTI捕获到
高级定时器启动普通定时器的中断

RCR调0就是与通用定时器相同。
RCR作用是计数器当出现N+1溢出后才进中断。N为0时就是一次溢出进一次。

使用update中断
最后记得启动中断
HAL_TIM_Base_Start_IT(&htim1);
中断内使用delay

调高timebase优先级
滴答计时器中断SysTick_Handler
SysTick作为时基,即时间基准,向其他定时器提供时间基准
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
理论上cubemx会自动配置为1ms进一次该中断
可以在该中断加入用户代码替代定时器中断
英伟达老驱动下载地址
https://cn.download.nvidia.cn/Windows/399.24/399.24-notebook-win10-64bit-international-whql.exe
Ubuntu文件管理器地址栏不显示
使用Ctrl+L
蓝桥的知识
I2C设备地址模式有7 8 10位
串口波特的单位是位/秒
电压放大倍数为10倍,电压增益就是20dB。电压放大倍数为100倍是,电压增益就是40dB。
volatile和register使变量不能被优化,前者要求cpu去内存寻址,后者要求cpu直接存在三缓里
RS485和CAN是差分信号
qt错误
In template: call to implicitly-deleted copy constructor of 'singaldata' error occurred here in instantiation of member function 'QVector<singaldata>::reallocData' requested here in instantiation of member function 'QVector<singaldata>::detach' requested here in instantiation of member function 'QVector<singaldata>::data' requested here in instantiation of member function 'QVector<singaldata>::operator[]' requested here copy constructor of 'singaldata' is implicitly deleted because field 'time' has a deleted copy constructor copy constructor of 'DataTime' is implicitly deleted because variant field 'data_time_' has a non-trivial copy constructor
我觉得是不能用迭代器,迭代器有锅
用at吧
同一串代码不同地方就是不行
Error: expected 1 of 1: 0x1ba01477

添加一句
set CPUTAPID 0

QHash
放结构体直接放
typedef struct history_send {
QString data;
bool is_Hex = false;
int send_num = 1;
QDateTime time;
} HistorySend;
QHash<QString, HistorySend> history_send_list_;
history_send_list_[data].is_Hex

浙公网安备 33010602011771号