Skip to content

Commit c5d46fc

Browse files
committed
Feature: Now you can enable/disable the lib in software
1 parent 3469fbc commit c5d46fc

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ft857d.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ void ft857d::addCATMSet(void (*userFunc)(byte)) {
131131

132132
// check function
133133
void ft857d::check() {
134+
// do nothing if it was disabled by software
135+
if (!enabled) return;
136+
134137
// first check if we have at least 5 bytes waiting on the buffer
135138
byte i = Serial.available();
136139
if (i < 5) return;

src/ft857d.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class ft857d {
115115
void addCATGetMode(byte (*)(void));
116116
void addCATSMeter(byte (*)(void));
117117
void addCATTXStatus(byte (*)(void));
118+
boolean enabled = true;
118119

119120
private:
120121
byte nullPad[5] = {0,0,0,0,0};

0 commit comments

Comments
 (0)