我现在的方法似乎采集的有问题。while循环中的程序如下:
if((flag&0x0a)==0x0a) { //每次数据准备好后,产生一次中断,标志位置位
ADS1299_Drdy(data_count); //该函数负责采集数据,每次27个字节
if(data_count==count_num)
{
Write_wenjian(p_filename,RBuffer_Num,cache_point); //收集够一定数量开始写进SD卡
data_count=0;
}
flag&=(~ADS_DRDY);
// flag&=(~cache_flag);
}
else if((flag&0x50)==0x50){ //判断开始按键按下
p_filename=znFAT_CreateFilename();
Create_wenjian(p_filename);
flag|=start_flag;
flag&=(~create_flag);
flag&=(~power_start);
ADS1299_Start_Pin();
ADS1299_RDataC();
GPIO_SetBits(GPIOD, GPIO_Pin_6);
}
else if((flag&0x06)==0x06){
GPIO_ResetBits(GPIOD, GPIO_Pin_6);
ADS1299_Reset_Pin();
ADS1299_Stop_Pin();
cache[0]=CountNum;
cache[1]=CountNum>>8;
cache[2]=CountNum>>16;
cache[3]=CountNum>>24;
Write_wenjian(p_filename,4,cache_point);
znFAT_Close_File(&fileinfo);
znFAT_Flush_FS();
flag=0x44;
} |