![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Contains all code needed for analog digital and oscope
Diff: main.cpp
- Revision:
- 6:f2c589ad6241
- Parent:
- 5:6b72bf1da751
- Child:
- 7:60e993355f76
diff -r 6b72bf1da751 -r f2c589ad6241 main.cpp --- a/main.cpp Wed Apr 22 20:19:52 2020 +0000 +++ b/main.cpp Thu Apr 23 02:45:20 2020 +0000 @@ -75,6 +75,10 @@ volatile unsigned char oScopeTriggerVoltageBit; volatile unsigned char oScopeTriggerVoltageVal; +volatile bool analogRunning; +volatile bool oScopeRunning; +volatile bool digitalRunning; + void digital_sample_func(void) //sampling function, samples each pin specified and Ors it { @@ -128,7 +132,7 @@ oScopeTicker.detach(); oScopeCut.detach(); newoScope=true; - oScopeStatus=0; + oScopeRunning=0; } void oScope_sample_func(void){ @@ -219,10 +223,10 @@ switch(state) { case reset: tickerboi.detach(); //detach Ticker - DigitalStatus=0; //turn off status LED - AnalogStatus=0; + digitalRunning=0; //turn off status LED + analogRunning=0; - if(oScopeStatus){ + if(oScopeRunning){ oScope_kill_func(); } @@ -230,17 +234,17 @@ case digital: tickerboi.attach(&digital_sample_func, .5); - DigitalStatus=1; // turn on status LED + digitalRunning=1; // turn on status LED break; case analog: tickerboi.attach(&analog_sample_func, .5); - AnalogStatus=1; + analogRunning=1; case oScope: oScopeTime=command & timeMask; oScope_poll=true; - oScopeStatus=1; + oScopeRunning=1; oScopeTriggerType= command & triggerType; oScopeTriggerVoltageBit = command & triggerVolt; break; @@ -254,6 +258,10 @@ while(1) { + DigitalStatus=digitalRunning; + AnalogStatus=analogRunning; + oScopeStatus=oScopeRunning; + if(newDigital) { //if digital sampling was run PC.putc(DigitalSample); newDigital=false;