Changes done in ECG and BT
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_20sept_2017_4th_oct_2017 by
Diff: main.cpp
- Revision:
- 22:ffa88619551d
- Parent:
- 20:7c64e6ecad76
- Child:
- 24:d992ee8369f4
diff -r 7ef1b0b40841 -r ffa88619551d main.cpp --- a/main.cpp Wed Jun 21 08:39:10 2017 +0000 +++ b/main.cpp Fri Jun 23 07:25:24 2017 +0000 @@ -11,7 +11,7 @@ #include "sdcard.h" #include "eeprom_pgm.h" #include "struct.h" - +#include "battery.h" Serial gc(USBTX, USBRX); DigitalIn q1(PTB11); DigitalIn q(PTB8); @@ -19,7 +19,7 @@ uint8_t touch(uint8_t state); // touch state uint8_t display(uint8_t state1); // display state -int pid=0; // patient ID +int32_t pid=0; // patient ID static uint8_t nstate=0; static uint8_t nstate1=0; static uint8_t flag=0; //flag to indicate not to update pid as it is already done @@ -27,7 +27,7 @@ static uint8_t glc_flag=0; // glc_flag to indicate the glc test is already done for the same pid uint8_t state_r=0; // state to receive from bluetooth uint8_t state_t=1; // state to transmit to bluetooth -float heart_rate=0; +uint16_t heart_rate=0; int main(){ @@ -49,24 +49,44 @@ static uint8_t state_touch=1; static uint8_t state_t=1; static uint8_t state_r=0; - + float b_voltage=0; + /* b_voltage=battery_voltage(); + //gc.printf("%f \n", b_voltage ); + if (b_voltage<3.5) + { + bat_screen_nocharge(); + DisableTouch(); + } + + +else + { + // enable touch function + bat_screen_charge(); + EnableTouch();*/ while(1) { switch(main_state) // main state machine { - case 1: state_display=touch(state_touch); // touch state - - - if(state_display==12) - main_state=3; + case 1: state_display=touch(state_touch); // touch state + if(state_display==12) + main_state=3; - else - main_state=2; + else + main_state=2; break; case 2: state_touch=display(state_display); //display state - main_state=1; - break; + /* if (b_voltage<3.5) + { + bat_screen_nocharge(); + DisableTouch(); + } + else { */ + // bat_screen_charge(); + main_state=1; + // } + break; case 3: DisableTouch(); // bluetooth send @@ -92,11 +112,11 @@ } - +} } -} +//} uint8_t touch(uint8_t state)