Unverified Commit 23e68973 authored by marklinmax's avatar marklinmax Committed by GitHub

Add SerialUSB::ignoreFlowControl() method (#1624)

Fixes #1620
parent 70af32ee
......@@ -130,7 +130,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
static uint64_t last_avail_time;
int written = 0;
if (tud_cdc_connected()) {
if (tud_cdc_connected() || _ignoreFlowControl) {
for (size_t i = 0; i < length;) {
int n = length - i;
int avail = tud_cdc_write_available();
......@@ -171,6 +171,9 @@ SerialUSB::operator bool() {
return tud_cdc_connected();
}
void SerialUSB::ignoreFlowControl(bool ignore) {
_ignoreFlowControl = ignore;
}
static bool _dtr = false;
static bool _rts = false;
......
......@@ -44,6 +44,8 @@ public:
using Print::write;
operator bool() override;
void ignoreFlowControl(bool ignore = true);
// ESP8266 compat
void setDebugOutput(bool unused) {
(void) unused;
......@@ -51,6 +53,7 @@ public:
private:
bool _running = false;
bool _ignoreFlowControl = false;
};
extern SerialUSB Serial;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment