Add mcopy_serial library

This commit is contained in:
Matt McWilliams 2023-03-04 18:52:51 -05:00
parent dc746fe6f4
commit 78450e9e6a
6 changed files with 45 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -1 +1,2 @@
debug*
debug*
bin

View File

@ -17,6 +17,7 @@
#include "CanonBLERemote.h"
#include <Arduino.h>
#include "TickTwo.h"
#include "mcopy_serial.h"
#define LOG_LOCAL_LEVEL ESP_LOG_INFO
#include "esp_log.h"

View File

@ -0,0 +1 @@
ino/lib/mcopy_serial/mcopy_serial.cpp

View File

@ -0,0 +1 @@
ino/lib/mcopy_serial/mcopy_serial.h