Fix all the following issues which we faced during 01st April internal demo 1) Display hang and jump issue 2) Sequencing issue 3) Issue with BP code

Dependencies:   SDFileSystem ds3231 program mbed testUniGraphic_150217

Fork of Int_Demo_01Apr2017_newdisplaycode_bp_nikita by nikita teggi

ecgg.cpp

Committer:
nikitateggi
Date:
2017-05-08
Revision:
12:ab85607bb10a
Parent:
4:6bd81bb1790d

File content as of revision 12:ab85607bb10a:

/** ECG ADS1291 Test program.
ADS1291 is a single channel ECG chip
with a 24 bit Sigma-Delta ADC
 */
 
#include "mbed.h"
#include <string.h>
#include <stdio.h>
#include "ds3231.h"
#include "SDFileSystem.h"
#include "ecg_dec.h"
#include "rtc.h"
#include "sdcard.h"
#include "ec_bp.h"
Serial pc(USBTX,USBRX);  



int ecg(int pid) 
 {

    int concatenate_value2 = 0;
    int32_t sample_sum; // static int32_t avg[1500];
    int32_t count = 0; int32_t fs = 500; int32_t w=0,w1=0;
    Timer t;
    unsigned char chk = 1;
    pc.baud(baud_rate);
    freqset();               // setting the frequency
    setupfunc();              
    ecgsetupfunc();
    chk = 1;
   sd_open_ECGfile(pid);        // opening the ecg file
   
 for(int i=0; i<N_ECG; i++)
   {
     concatenate_value2= readvalue();
     sd_write(concatenate_value2);               // writing into the sd card
     pc.printf( "%d\n", concatenate_value2);
   } 
   
   sd_close();          // closing the file

 
 
 }    // End of main function