canon_ble #82

Merged
mattmcw merged 149 commits from canon_ble into main 2023-08-01 03:38:52 +00:00
4 changed files with 20 additions and 0 deletions
Showing only changes of commit 9a89dbe6a5 - Show all commits

View File

@ -13,12 +13,20 @@ void McopySerial::begin () {
char McopySerial::loop () { char McopySerial::loop () {
if (Serial.available()) { if (Serial.available()) {
cmdChar = (char) Serial.read(); cmdChar = (char) Serial.read();
internal();
} else { } else {
cmdChar = 'z'; cmdChar = 'z';
} }
return cmdChar; return cmdChar;
} }
void McopySerial::internal () {
if (cmdChar == DEBUG) {
debugOn = !debugOn;
cmdChar = 'z';
}
}
void McopySerial::setBaud (int baudRate) { void McopySerial::setBaud (int baudRate) {
baud = baudRate; baud = baudRate;
} }

View File

@ -10,6 +10,8 @@ class McopySerial {
volatile bool debugOn = false; volatile bool debugOn = false;
volatile char cmdChar = 'z'; volatile char cmdChar = 'z';
void internal ();
public: public:
/* CMD FLAGS */ /* CMD FLAGS */

View File

@ -13,12 +13,20 @@ void McopySerial::begin () {
char McopySerial::loop () { char McopySerial::loop () {
if (Serial.available()) { if (Serial.available()) {
cmdChar = (char) Serial.read(); cmdChar = (char) Serial.read();
internal();
} else { } else {
cmdChar = 'z'; cmdChar = 'z';
} }
return cmdChar; return cmdChar;
} }
void McopySerial::internal () {
if (cmdChar == DEBUG) {
debugOn = !debugOn;
cmdChar = 'z';
}
}
void McopySerial::setBaud (int baudRate) { void McopySerial::setBaud (int baudRate) {
baud = baudRate; baud = baudRate;
} }

View File

@ -10,6 +10,8 @@ class McopySerial {
volatile bool debugOn = false; volatile bool debugOn = false;
volatile char cmdChar = 'z'; volatile char cmdChar = 'z';
void internal ();
public: public:
/* CMD FLAGS */ /* CMD FLAGS */