Pacemaker code Implementation for SFWRENG 3K04
Dependencies: FXOS8700Q Queue mbed-rtos mbed
Fork of Pacemaker by
hardware.cpp@16:08d5e5a3ee74, 2016-11-17 (annotated)
- Committer:
- noahzwiep
- Date:
- Thu Nov 17 04:03:25 2016 +0000
- Revision:
- 16:08d5e5a3ee74
- Parent:
- 10:0e0130742e87
- Child:
- 19:d58e1e1a9a24
- Made change to hardware class that provides sensing pin; - Made dataStruct class in which there is multiple threading for grabbing queue data; - Made queue in datastruct to allow storage of data
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FiveDollar | 0:b2b3955cd77b | 1 | #pragma once |
FiveDollar | 0:b2b3955cd77b | 2 | #include "hardware.h" |
FiveDollar | 0:b2b3955cd77b | 3 | #include "mbed.h" |
FiveDollar | 0:b2b3955cd77b | 4 | |
FiveDollar | 0:b2b3955cd77b | 5 | |
noahzwiep | 16:08d5e5a3ee74 | 6 | hardware::hardware(): atrium(PTC12),ventricle(PTC12),pc(USBTX,USBRX),sense(PTB2){ |
FiveDollar | 0:b2b3955cd77b | 7 | pc.baud(9600); |
FiveDollar | 0:b2b3955cd77b | 8 | } |
FiveDollar | 0:b2b3955cd77b | 9 | |
FiveDollar | 0:b2b3955cd77b | 10 | hardware::~hardware(){}; |
FiveDollar | 0:b2b3955cd77b | 11 | |
FiveDollar | 0:b2b3955cd77b | 12 | Serial* hardware::getSerial(){ |
FiveDollar | 0:b2b3955cd77b | 13 | Serial* p = &pc; |
FiveDollar | 0:b2b3955cd77b | 14 | return p; |
FiveDollar | 0:b2b3955cd77b | 15 | } |
FiveDollar | 0:b2b3955cd77b | 16 | |
trane3 | 5:253c33930e91 | 17 | PwmOut* hardware::getChamber(char chamber){ |
FiveDollar | 0:b2b3955cd77b | 18 | if(chamber == 'a'){ |
FiveDollar | 1:fbba2687ddfe | 19 | PwmOut* a = &atrium; |
FiveDollar | 0:b2b3955cd77b | 20 | return a; |
FiveDollar | 0:b2b3955cd77b | 21 | } |
FiveDollar | 0:b2b3955cd77b | 22 | else { |
FiveDollar | 1:fbba2687ddfe | 23 | PwmOut* v = &ventricle; |
FiveDollar | 0:b2b3955cd77b | 24 | return v; |
FiveDollar | 0:b2b3955cd77b | 25 | } |
noahzwiep | 16:08d5e5a3ee74 | 26 | } |
noahzwiep | 16:08d5e5a3ee74 | 27 | |
noahzwiep | 16:08d5e5a3ee74 | 28 | double hardware::getSense(){ |
noahzwiep | 16:08d5e5a3ee74 | 29 | return sense.read(); |
noahzwiep | 16:08d5e5a3ee74 | 30 | } |