diff --git a/ino/lib/mcopy_serial/mcopy_serial.cpp b/ino/lib/mcopy_serial/mcopy_serial.cpp new file mode 100644 index 0000000..03e30e8 --- /dev/null +++ b/ino/lib/mcopy_serial/mcopy_serial.cpp @@ -0,0 +1,20 @@ +#include "mcopy_serial.h" + +void McopySerial::begin (int baudRate) { + baud = baudRate; + begin(); +} + +void McopySerial::begin () { + +} + +void McopySerial::debug (bool state) { + debugOn = state; +} + +void McopySerial::log (String message) { + if (debugOn) { + Serial.println(message); + } +} \ No newline at end of file diff --git a/ino/lib/mcopy_serial/mcopy_serial.h b/ino/lib/mcopy_serial/mcopy_serial.h new file mode 100644 index 0000000..de3c700 --- /dev/null +++ b/ino/lib/mcopy_serial/mcopy_serial.h @@ -0,0 +1,20 @@ +#ifndef MCOPY_SERIAL +#define MCOPY_SERIAL + +#include "Arduino.h" + +class McopySerial { + + private: + volatile int baud = 57600; + volatile bool debugOn = false; + + public: + void begin(); + void begin(int baudRate); + + void debug (bool state); + void log (String message); +}; + +#endif \ No newline at end of file diff --git a/ino/mcopy_cam_canon/.gitignore b/ino/mcopy_cam_canon/.gitignore index 0a5cc89..4fee890 100644 --- a/ino/mcopy_cam_canon/.gitignore +++ b/ino/mcopy_cam_canon/.gitignore @@ -1 +1,2 @@ -debug* \ No newline at end of file +debug* +bin diff --git a/ino/mcopy_cam_canon/mcopy_cam_canon.ino b/ino/mcopy_cam_canon/mcopy_cam_canon.ino index 6512073..a0a9283 100644 --- a/ino/mcopy_cam_canon/mcopy_cam_canon.ino +++ b/ino/mcopy_cam_canon/mcopy_cam_canon.ino @@ -17,6 +17,7 @@ #include "CanonBLERemote.h" #include #include "TickTwo.h" +#include "mcopy_serial.h" #define LOG_LOCAL_LEVEL ESP_LOG_INFO #include "esp_log.h" diff --git a/ino/mcopy_cam_canon/mcopy_serial.cpp b/ino/mcopy_cam_canon/mcopy_serial.cpp new file mode 120000 index 0000000..d09c529 --- /dev/null +++ b/ino/mcopy_cam_canon/mcopy_serial.cpp @@ -0,0 +1 @@ +ino/lib/mcopy_serial/mcopy_serial.cpp \ No newline at end of file diff --git a/ino/mcopy_cam_canon/mcopy_serial.h b/ino/mcopy_cam_canon/mcopy_serial.h new file mode 120000 index 0000000..15f2d9f --- /dev/null +++ b/ino/mcopy_cam_canon/mcopy_serial.h @@ -0,0 +1 @@ +ino/lib/mcopy_serial/mcopy_serial.h \ No newline at end of file