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 () {
if (Serial.available()) {
cmdChar = (char) Serial.read();
internal();
} else {
cmdChar = 'z';
}
return cmdChar;
}
void McopySerial::internal () {
if (cmdChar == DEBUG) {
debugOn = !debugOn;
cmdChar = 'z';
}
}
void McopySerial::setBaud (int baudRate) {
baud = baudRate;
}

View File

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

View File

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

View File

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