前言
本文的目标:将电压、电流数据打包成特定格式(包头0x5A 0xA5,通道数,电流值(电流原始ADC值),电压值(电压原始ADC值),校验和)通过USART1发送给上位机
一、具体代码修改
#include "./SYSTEM/sys/sys.h"
#include "./SYSTEM/usart/usart.h"
#include "./SYSTEM/delay/delay.h"
#include "./USMART/usmart.h"
#include "./BSP/LED/led.h"
#include "./BSP/LCD/lcd.h"
#include "./BSP/ADC/adc.h"
#include "./BSP/KEY/key.h"
#include "./MALLOC/malloc.h"
#include "./BSP/SDMMC/spi_sdcard.h"
#include "./BSP/NORFLASH/norflash.h"
#include "./FATFS/exfuns/exfuns.h"
#include <math.h>
#include "./BSP/RTC/rtc.h" // 添加RTC头文件
#include <stdio.h>
#include <string.h>
#define ADC_DMA_BUF_SIZE 100 * 2 /* ADC DMA采集 BUF大小, 每个通道100次采样 */
uint16_t g_adc_dma_buf[ADC_DMA_BUF_SIZE]; /* ADC DMA BUF */
订阅专栏 解锁全文
317

被折叠的 条评论
为什么被折叠?



