![](/media/cache/profiles/4b602c3f2f6b86b43ad406fd438e09a8.jpg.50x50_q85.jpg)
Final
Dependencies: TextLCD UPennEMBS keypad mbed-rtos mbed
main.cpp@0:de6d31e19fa5, 2014-12-04 (annotated)
- Committer:
- jatinsha
- Date:
- Thu Dec 04 10:46:07 2014 +0000
- Revision:
- 0:de6d31e19fa5
Final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jatinsha | 0:de6d31e19fa5 | 1 | /* |
jatinsha | 0:de6d31e19fa5 | 2 | CIS541: Embedded Systems for Life Critical Applications |
jatinsha | 0:de6d31e19fa5 | 3 | Project: Pacemaker modelling |
jatinsha | 0:de6d31e19fa5 | 4 | */ |
jatinsha | 0:de6d31e19fa5 | 5 | |
jatinsha | 0:de6d31e19fa5 | 6 | /* Header files */ |
jatinsha | 0:de6d31e19fa5 | 7 | #include "mbed.h" |
jatinsha | 0:de6d31e19fa5 | 8 | #include "rtos.h" |
jatinsha | 0:de6d31e19fa5 | 9 | #include "CardiacPacemaker.h" |
jatinsha | 0:de6d31e19fa5 | 10 | #include <ctype.h> |
jatinsha | 0:de6d31e19fa5 | 11 | #include <string.h> |
jatinsha | 0:de6d31e19fa5 | 12 | #include <stdlib.h> |
jatinsha | 0:de6d31e19fa5 | 13 | |
jatinsha | 0:de6d31e19fa5 | 14 | /* Global variables */ |
jatinsha | 0:de6d31e19fa5 | 15 | |
jatinsha | 0:de6d31e19fa5 | 16 | // Mode-Threads pointers |
jatinsha | 0:de6d31e19fa5 | 17 | Thread *threadListening; |
jatinsha | 0:de6d31e19fa5 | 18 | Thread *threadLogicTiming; |
jatinsha | 0:de6d31e19fa5 | 19 | Thread *threadPacing; |
jatinsha | 0:de6d31e19fa5 | 20 | Thread *threadKeyboard; |
jatinsha | 0:de6d31e19fa5 | 21 | |
jatinsha | 0:de6d31e19fa5 | 22 | Timer timerPrimary; |
jatinsha | 0:de6d31e19fa5 | 23 | Timer timerSecondary; |
jatinsha | 0:de6d31e19fa5 | 24 | // keypad state |
jatinsha | 0:de6d31e19fa5 | 25 | // Define your own keypad values |
jatinsha | 0:de6d31e19fa5 | 26 | |
jatinsha | 0:de6d31e19fa5 | 27 | |
jatinsha | 0:de6d31e19fa5 | 28 | void ThreadListeningPace(void const *args) |
jatinsha | 0:de6d31e19fa5 | 29 | { |
jatinsha | 0:de6d31e19fa5 | 30 | while(1) |
jatinsha | 0:de6d31e19fa5 | 31 | { |
jatinsha | 0:de6d31e19fa5 | 32 | SenseMutex.lock(); |
jatinsha | 0:de6d31e19fa5 | 33 | if(Asense==1) |
jatinsha | 0:de6d31e19fa5 | 34 | { |
jatinsha | 0:de6d31e19fa5 | 35 | ReceivedASense(); |
jatinsha | 0:de6d31e19fa5 | 36 | flagA = 1; |
jatinsha | 0:de6d31e19fa5 | 37 | threadLogicTiming->signal_set(0x1); |
jatinsha | 0:de6d31e19fa5 | 38 | } |
jatinsha | 0:de6d31e19fa5 | 39 | if(Vsense==1) |
jatinsha | 0:de6d31e19fa5 | 40 | { |
jatinsha | 0:de6d31e19fa5 | 41 | ReceivedVSense(); |
jatinsha | 0:de6d31e19fa5 | 42 | flagV = 1; |
jatinsha | 0:de6d31e19fa5 | 43 | threadLogicTiming->signal_set(0x1); |
jatinsha | 0:de6d31e19fa5 | 44 | } |
jatinsha | 0:de6d31e19fa5 | 45 | SenseMutex.unlock(); |
jatinsha | 0:de6d31e19fa5 | 46 | } |
jatinsha | 0:de6d31e19fa5 | 47 | } |
jatinsha | 0:de6d31e19fa5 | 48 | |
jatinsha | 0:de6d31e19fa5 | 49 | void ThreadLogicTiming(void const *args) |
jatinsha | 0:de6d31e19fa5 | 50 | { |
jatinsha | 0:de6d31e19fa5 | 51 | while(1) |
jatinsha | 0:de6d31e19fa5 | 52 | { |
jatinsha | 0:de6d31e19fa5 | 53 | //flagV==0 && timerPrimary.read_ms() >= LRI |
jatinsha | 0:de6d31e19fa5 | 54 | while(timerPrimary.read_ms() < PVARP) |
jatinsha | 0:de6d31e19fa5 | 55 | { |
jatinsha | 0:de6d31e19fa5 | 56 | // Post Ventricular Atrium Refractory Period |
jatinsha | 0:de6d31e19fa5 | 57 | // Ignore Asense or Vsense here |
jatinsha | 0:de6d31e19fa5 | 58 | //pc.puts("|==----(PVARP)|-----------------------------(LRI-AVI)|\n"); |
jatinsha | 0:de6d31e19fa5 | 59 | //pc.puts("PVAB period\n"); |
jatinsha | 0:de6d31e19fa5 | 60 | |
jatinsha | 0:de6d31e19fa5 | 61 | if(flagA == 1) |
jatinsha | 0:de6d31e19fa5 | 62 | { |
jatinsha | 0:de6d31e19fa5 | 63 | pc.puts("Early: Reject\n"); |
jatinsha | 0:de6d31e19fa5 | 64 | flagA = 0; |
jatinsha | 0:de6d31e19fa5 | 65 | } |
jatinsha | 0:de6d31e19fa5 | 66 | |
jatinsha | 0:de6d31e19fa5 | 67 | } |
jatinsha | 0:de6d31e19fa5 | 68 | while(timerPrimary.read_ms() >= PVARP && timerPrimary.read_ms() < (LRI-AVI)) |
jatinsha | 0:de6d31e19fa5 | 69 | { |
jatinsha | 0:de6d31e19fa5 | 70 | // Normal Asense period |
jatinsha | 0:de6d31e19fa5 | 71 | //pc.puts("|======(PVARP)|=====----------(tAs+AVI)|----(LRI-AVI)|\n"); |
jatinsha | 0:de6d31e19fa5 | 72 | //pc.puts("Normal Asense period\n"); |
jatinsha | 0:de6d31e19fa5 | 73 | if(flagA == 1) |
jatinsha | 0:de6d31e19fa5 | 74 | { |
jatinsha | 0:de6d31e19fa5 | 75 | // Acknowledge reception of Asense |
jatinsha | 0:de6d31e19fa5 | 76 | pc.puts("Normal:Asense\n"); |
jatinsha | 0:de6d31e19fa5 | 77 | SendAPace(); |
jatinsha | 0:de6d31e19fa5 | 78 | flag1 = 1; |
jatinsha | 0:de6d31e19fa5 | 79 | flagA = 0; |
jatinsha | 0:de6d31e19fa5 | 80 | //pc.puts("|======(PVARP)|=====(As)=-------(tAs+AVI)|----(LRI-AVI)\n"); |
jatinsha | 0:de6d31e19fa5 | 81 | break; |
jatinsha | 0:de6d31e19fa5 | 82 | } |
jatinsha | 0:de6d31e19fa5 | 83 | } |
jatinsha | 0:de6d31e19fa5 | 84 | if(timerPrimary.read_ms() > (LRI-AVI) ) |
jatinsha | 0:de6d31e19fa5 | 85 | { |
jatinsha | 0:de6d31e19fa5 | 86 | // Asense period exhausted pacemaker needs to Apace the heart |
jatinsha | 0:de6d31e19fa5 | 87 | if(flag1==0) |
jatinsha | 0:de6d31e19fa5 | 88 | { |
jatinsha | 0:de6d31e19fa5 | 89 | SendAPace(); //Forced Atrium Pulse reffering to the below if loop |
jatinsha | 0:de6d31e19fa5 | 90 | } |
jatinsha | 0:de6d31e19fa5 | 91 | else |
jatinsha | 0:de6d31e19fa5 | 92 | { |
jatinsha | 0:de6d31e19fa5 | 93 | flag1 = 0; |
jatinsha | 0:de6d31e19fa5 | 94 | } |
jatinsha | 0:de6d31e19fa5 | 95 | if(flagA == 1) |
jatinsha | 0:de6d31e19fa5 | 96 | { |
jatinsha | 0:de6d31e19fa5 | 97 | pc.puts("Late: Rejected\n"); |
jatinsha | 0:de6d31e19fa5 | 98 | flagA = 0; //just to cleanup for next cycle |
jatinsha | 0:de6d31e19fa5 | 99 | } |
jatinsha | 0:de6d31e19fa5 | 100 | //pc.puts("|======(PVARP)|================================(Ap)(LRI-AVI)|\n"); |
jatinsha | 0:de6d31e19fa5 | 101 | // look for Vsense |
jatinsha | 0:de6d31e19fa5 | 102 | while(timerPrimary.read_ms() < (LRI-AVI)+PVAB) |
jatinsha | 0:de6d31e19fa5 | 103 | { |
jatinsha | 0:de6d31e19fa5 | 104 | // This is Post Atrium Ventricular Blanking period |
jatinsha | 0:de6d31e19fa5 | 105 | // No Vsense should be here |
jatinsha | 0:de6d31e19fa5 | 106 | // Ignore any V here |
jatinsha | 0:de6d31e19fa5 | 107 | } |
jatinsha | 0:de6d31e19fa5 | 108 | while(timerPrimary.read_ms() >= (LRI-AVI)+PVAB && timerPrimary.read_ms() < (LRI-AVI)+VSP) |
jatinsha | 0:de6d31e19fa5 | 109 | { |
jatinsha | 0:de6d31e19fa5 | 110 | // This is Ventricular _______ period |
jatinsha | 0:de6d31e19fa5 | 111 | // Vsense here would be prematuare and needs to be sent at the end of the period as mature |
jatinsha | 0:de6d31e19fa5 | 112 | // Receive and matuare any V here |
jatinsha | 0:de6d31e19fa5 | 113 | if(flagV == 1) |
jatinsha | 0:de6d31e19fa5 | 114 | { |
jatinsha | 0:de6d31e19fa5 | 115 | pc.puts("Unmatured:Converted into matuared\n"); |
jatinsha | 0:de6d31e19fa5 | 116 | //ReceivedVSense(); //pre-mature |
jatinsha | 0:de6d31e19fa5 | 117 | while(timerPrimary.read_ms() < (LRI-AVI)+VSP); //maturing it |
jatinsha | 0:de6d31e19fa5 | 118 | flagV = 0; |
jatinsha | 0:de6d31e19fa5 | 119 | SendVPace(); //matuared |
jatinsha | 0:de6d31e19fa5 | 120 | //LEDTest = 0; |
jatinsha | 0:de6d31e19fa5 | 121 | //pc.puts("|======(PVARP)|================================(Ap)(LRI-AVI)|===(Vsp)===(Vpm)(tVSP)\n"); |
jatinsha | 0:de6d31e19fa5 | 122 | } |
jatinsha | 0:de6d31e19fa5 | 123 | } |
jatinsha | 0:de6d31e19fa5 | 124 | while(timerPrimary.read_ms() >= (LRI-AVI)+VSP && timerPrimary.read_ms() < LRI) |
jatinsha | 0:de6d31e19fa5 | 125 | { |
jatinsha | 0:de6d31e19fa5 | 126 | // This is normal period for Vsense |
jatinsha | 0:de6d31e19fa5 | 127 | // Vsense here would be matuare |
jatinsha | 0:de6d31e19fa5 | 128 | if(flagV == 1) |
jatinsha | 0:de6d31e19fa5 | 129 | { |
jatinsha | 0:de6d31e19fa5 | 130 | pc.puts("Matuared:\n"); |
jatinsha | 0:de6d31e19fa5 | 131 | ReceivedVSense(); //mature |
jatinsha | 0:de6d31e19fa5 | 132 | SendVPace(); |
jatinsha | 0:de6d31e19fa5 | 133 | flagV = 0; |
jatinsha | 0:de6d31e19fa5 | 134 | flag2=1; |
jatinsha | 0:de6d31e19fa5 | 135 | //pc.puts("|======(PVARP)|================================(Ap)(LRI-AVI)|============(Vsm)(tVSP)\n"); |
jatinsha | 0:de6d31e19fa5 | 136 | break; |
jatinsha | 0:de6d31e19fa5 | 137 | } |
jatinsha | 0:de6d31e19fa5 | 138 | } |
jatinsha | 0:de6d31e19fa5 | 139 | if(timerPrimary.read_ms() > LRI) |
jatinsha | 0:de6d31e19fa5 | 140 | { |
jatinsha | 0:de6d31e19fa5 | 141 | // Waiting time for Vsense exhausted |
jatinsha | 0:de6d31e19fa5 | 142 | // Pacemaker needs to generate Vpace now |
jatinsha | 0:de6d31e19fa5 | 143 | // send Vpace and reset timers |
jatinsha | 0:de6d31e19fa5 | 144 | if(flag2==0) |
jatinsha | 0:de6d31e19fa5 | 145 | { |
jatinsha | 0:de6d31e19fa5 | 146 | SendVPace(); //Forced ventricle Pulse reffering to the below if loop |
jatinsha | 0:de6d31e19fa5 | 147 | } |
jatinsha | 0:de6d31e19fa5 | 148 | else |
jatinsha | 0:de6d31e19fa5 | 149 | { |
jatinsha | 0:de6d31e19fa5 | 150 | flag2 = 0; |
jatinsha | 0:de6d31e19fa5 | 151 | } |
jatinsha | 0:de6d31e19fa5 | 152 | //pc.puts("|======(PVARP)|================================(Ap)(LRI-AVI)|=======================(Vp)(LRI)\n"); |
jatinsha | 0:de6d31e19fa5 | 153 | timerPrimary.reset(); // reset for next beat interval |
jatinsha | 0:de6d31e19fa5 | 154 | |
jatinsha | 0:de6d31e19fa5 | 155 | } |
jatinsha | 0:de6d31e19fa5 | 156 | else if(timerPrimary.read_ms() >= (LRI-AVI)+VSP && timerPrimary.read_ms() < LRI) |
jatinsha | 0:de6d31e19fa5 | 157 | { |
jatinsha | 0:de6d31e19fa5 | 158 | // matuare Vsense was received |
jatinsha | 0:de6d31e19fa5 | 159 | // inhibit sending any Vpace |
jatinsha | 0:de6d31e19fa5 | 160 | // Reset timers |
jatinsha | 0:de6d31e19fa5 | 161 | |
jatinsha | 0:de6d31e19fa5 | 162 | timerPrimary.reset(); // reset for next beat interval |
jatinsha | 0:de6d31e19fa5 | 163 | } |
jatinsha | 0:de6d31e19fa5 | 164 | |
jatinsha | 0:de6d31e19fa5 | 165 | } |
jatinsha | 0:de6d31e19fa5 | 166 | else if(timerPrimary.read_ms() < (LRI-AVI) ) |
jatinsha | 0:de6d31e19fa5 | 167 | { |
jatinsha | 0:de6d31e19fa5 | 168 | // Asense observed within the normal period pacemaker does nothing |
jatinsha | 0:de6d31e19fa5 | 169 | |
jatinsha | 0:de6d31e19fa5 | 170 | // now look for VSense witin next AVI |
jatinsha | 0:de6d31e19fa5 | 171 | timerSecondary.start(); |
jatinsha | 0:de6d31e19fa5 | 172 | while(timerSecondary.read_ms() < AVI) |
jatinsha | 0:de6d31e19fa5 | 173 | { |
jatinsha | 0:de6d31e19fa5 | 174 | if(flagV == 1) |
jatinsha | 0:de6d31e19fa5 | 175 | { |
jatinsha | 0:de6d31e19fa5 | 176 | pc.puts("Natural Asense, Natural Vsense:\n"); |
jatinsha | 0:de6d31e19fa5 | 177 | ReceivedVSense(); |
jatinsha | 0:de6d31e19fa5 | 178 | SendVPace(); |
jatinsha | 0:de6d31e19fa5 | 179 | flag2=1; |
jatinsha | 0:de6d31e19fa5 | 180 | flagV = 0; |
jatinsha | 0:de6d31e19fa5 | 181 | //pc.puts("|======(PVARP)|=====(As)==(Vs)|---(tAs+AVI)|----(LRI-AVI)\n"); |
jatinsha | 0:de6d31e19fa5 | 182 | break; |
jatinsha | 0:de6d31e19fa5 | 183 | } |
jatinsha | 0:de6d31e19fa5 | 184 | } |
jatinsha | 0:de6d31e19fa5 | 185 | if(timerSecondary.read_ms() >= AVI) |
jatinsha | 0:de6d31e19fa5 | 186 | { |
jatinsha | 0:de6d31e19fa5 | 187 | while(timerPrimary.read_ms() < URI); // wait till URI to send Vpace |
jatinsha | 0:de6d31e19fa5 | 188 | if(flag2==0) |
jatinsha | 0:de6d31e19fa5 | 189 | { |
jatinsha | 0:de6d31e19fa5 | 190 | SendVPace(); //Forced Atrium Pulse reffering to the below if loop |
jatinsha | 0:de6d31e19fa5 | 191 | } |
jatinsha | 0:de6d31e19fa5 | 192 | else |
jatinsha | 0:de6d31e19fa5 | 193 | { |
jatinsha | 0:de6d31e19fa5 | 194 | flag2 = 0; |
jatinsha | 0:de6d31e19fa5 | 195 | } |
jatinsha | 0:de6d31e19fa5 | 196 | //pc.puts("|======(PVARP)|=====(As)==================(Vp)(URI)|----(LRI-AVI)\n"); |
jatinsha | 0:de6d31e19fa5 | 197 | } |
jatinsha | 0:de6d31e19fa5 | 198 | else if(timerSecondary.read_ms() < AVI) //still less than AVI |
jatinsha | 0:de6d31e19fa5 | 199 | { |
jatinsha | 0:de6d31e19fa5 | 200 | // This means Vsense is already observed |
jatinsha | 0:de6d31e19fa5 | 201 | // both A and V have been managed successfully |
jatinsha | 0:de6d31e19fa5 | 202 | // Reset timers before reinitiating the process |
jatinsha | 0:de6d31e19fa5 | 203 | timerPrimary.reset(); |
jatinsha | 0:de6d31e19fa5 | 204 | timerSecondary.stop(); |
jatinsha | 0:de6d31e19fa5 | 205 | timerSecondary.reset(); |
jatinsha | 0:de6d31e19fa5 | 206 | } |
jatinsha | 0:de6d31e19fa5 | 207 | |
jatinsha | 0:de6d31e19fa5 | 208 | } |
jatinsha | 0:de6d31e19fa5 | 209 | |
jatinsha | 0:de6d31e19fa5 | 210 | }//while(1) ends here |
jatinsha | 0:de6d31e19fa5 | 211 | } |
jatinsha | 0:de6d31e19fa5 | 212 | |
jatinsha | 0:de6d31e19fa5 | 213 | |
jatinsha | 0:de6d31e19fa5 | 214 | |
jatinsha | 0:de6d31e19fa5 | 215 | void SetSleepMode() |
jatinsha | 0:de6d31e19fa5 | 216 | { |
jatinsha | 0:de6d31e19fa5 | 217 | VRP = 200; |
jatinsha | 0:de6d31e19fa5 | 218 | AVI = 200; |
jatinsha | 0:de6d31e19fa5 | 219 | PVARP = 500; |
jatinsha | 0:de6d31e19fa5 | 220 | VSP = 100; |
jatinsha | 0:de6d31e19fa5 | 221 | PVAB = 100; |
jatinsha | 0:de6d31e19fa5 | 222 | LRI = 2000; |
jatinsha | 0:de6d31e19fa5 | 223 | URI = 1000; |
jatinsha | 0:de6d31e19fa5 | 224 | pc.puts("\nSleep Mode."); |
jatinsha | 0:de6d31e19fa5 | 225 | } |
jatinsha | 0:de6d31e19fa5 | 226 | |
jatinsha | 0:de6d31e19fa5 | 227 | void SetExerciseMode() |
jatinsha | 0:de6d31e19fa5 | 228 | { |
jatinsha | 0:de6d31e19fa5 | 229 | VRP = 200; |
jatinsha | 0:de6d31e19fa5 | 230 | AVI = 200; |
jatinsha | 0:de6d31e19fa5 | 231 | PVARP = 500; |
jatinsha | 0:de6d31e19fa5 | 232 | VSP = 100; |
jatinsha | 0:de6d31e19fa5 | 233 | PVAB = 100; |
jatinsha | 0:de6d31e19fa5 | 234 | LRI = 600; |
jatinsha | 0:de6d31e19fa5 | 235 | URI = 343; |
jatinsha | 0:de6d31e19fa5 | 236 | pc.puts("\nExercise Mode."); |
jatinsha | 0:de6d31e19fa5 | 237 | } |
jatinsha | 0:de6d31e19fa5 | 238 | |
jatinsha | 0:de6d31e19fa5 | 239 | void SetNormalMode() |
jatinsha | 0:de6d31e19fa5 | 240 | { |
jatinsha | 0:de6d31e19fa5 | 241 | VRP = 200; |
jatinsha | 0:de6d31e19fa5 | 242 | AVI = 200; |
jatinsha | 0:de6d31e19fa5 | 243 | PVARP = 500; |
jatinsha | 0:de6d31e19fa5 | 244 | VSP = 100; |
jatinsha | 0:de6d31e19fa5 | 245 | PVAB = 100; |
jatinsha | 0:de6d31e19fa5 | 246 | LRI = 1500; |
jatinsha | 0:de6d31e19fa5 | 247 | URI = 600; |
jatinsha | 0:de6d31e19fa5 | 248 | pc.puts("\nNormal Mode."); |
jatinsha | 0:de6d31e19fa5 | 249 | } |
jatinsha | 0:de6d31e19fa5 | 250 | |
jatinsha | 0:de6d31e19fa5 | 251 | void SetObservationMode() |
jatinsha | 0:de6d31e19fa5 | 252 | { |
jatinsha | 0:de6d31e19fa5 | 253 | pc.puts("\nEnter new observation Time (in sec): "); |
jatinsha | 0:de6d31e19fa5 | 254 | pc.puts("\nPress 1 for 10 sec "); |
jatinsha | 0:de6d31e19fa5 | 255 | pc.puts("\nPress 2 for 20 sec "); |
jatinsha | 0:de6d31e19fa5 | 256 | pc.puts("\nPress 3 for 30 sec "); |
jatinsha | 0:de6d31e19fa5 | 257 | |
jatinsha | 0:de6d31e19fa5 | 258 | } |
jatinsha | 0:de6d31e19fa5 | 259 | |
jatinsha | 0:de6d31e19fa5 | 260 | void ThreadKeyboard(void const *args) |
jatinsha | 0:de6d31e19fa5 | 261 | { |
jatinsha | 0:de6d31e19fa5 | 262 | char key; |
jatinsha | 0:de6d31e19fa5 | 263 | while(1) |
jatinsha | 0:de6d31e19fa5 | 264 | { |
jatinsha | 0:de6d31e19fa5 | 265 | if(pc.readable()) |
jatinsha | 0:de6d31e19fa5 | 266 | { |
jatinsha | 0:de6d31e19fa5 | 267 | key = pc.getc(); |
jatinsha | 0:de6d31e19fa5 | 268 | pc.putc(key); |
jatinsha | 0:de6d31e19fa5 | 269 | |
jatinsha | 0:de6d31e19fa5 | 270 | switch(key){ |
jatinsha | 0:de6d31e19fa5 | 271 | case 's': SetSleepMode(); break; |
jatinsha | 0:de6d31e19fa5 | 272 | case 'x': SetExerciseMode(); break; |
jatinsha | 0:de6d31e19fa5 | 273 | case 'n': SetNormalMode(); break; |
jatinsha | 0:de6d31e19fa5 | 274 | case 'o': SetObservationMode(); break; |
jatinsha | 0:de6d31e19fa5 | 275 | case '1': obsPeriod=10000; pc.puts("\nObsPeriod set to 10sec"); break; |
jatinsha | 0:de6d31e19fa5 | 276 | case '2': obsPeriod=20000; pc.puts("\nObsPeriod set to 20sec"); break; |
jatinsha | 0:de6d31e19fa5 | 277 | case '3': obsPeriod=30000; pc.puts("\nObsPeriod set to 30sec"); break; |
jatinsha | 0:de6d31e19fa5 | 278 | |
jatinsha | 0:de6d31e19fa5 | 279 | } |
jatinsha | 0:de6d31e19fa5 | 280 | } |
jatinsha | 0:de6d31e19fa5 | 281 | } |
jatinsha | 0:de6d31e19fa5 | 282 | } |
jatinsha | 0:de6d31e19fa5 | 283 | |
jatinsha | 0:de6d31e19fa5 | 284 | |
jatinsha | 0:de6d31e19fa5 | 285 | int main(void) |
jatinsha | 0:de6d31e19fa5 | 286 | { |
jatinsha | 0:de6d31e19fa5 | 287 | setbuf(stdout,NULL); |
jatinsha | 0:de6d31e19fa5 | 288 | threadListening = new Thread(ThreadListeningPace); |
jatinsha | 0:de6d31e19fa5 | 289 | threadLogicTiming = new Thread(ThreadLogicTiming); |
jatinsha | 0:de6d31e19fa5 | 290 | threadKeyboard = new Thread(ThreadKeyboard); |
jatinsha | 0:de6d31e19fa5 | 291 | |
jatinsha | 0:de6d31e19fa5 | 292 | timerPrimary.start(); |
jatinsha | 0:de6d31e19fa5 | 293 | } |
jatinsha | 0:de6d31e19fa5 | 294 |