-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
I tried to find a workaround for this SoftwareSerial issue by dynamically creating & destroying instances via new & delete. However, after a few cycles the board stalls, i.e. no life-beat and manual reset required. Seems like the destructor does not release all required resources.
Here is a sketch to reproduce the error:
#include <SoftwareSerial.h>
SoftwareSerial *SoftSerial;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
SoftSerial = new SoftwareSerial(0, 1); // Rx, Tx
SoftSerial->begin(9600);
SoftSerial->write(0x55);
delete(SoftSerial);
SoftSerial = new SoftwareSerial(0, 1); // Rx, Tx
SoftSerial->begin(19200);
SoftSerial->write(0x55);
delete(SoftSerial);
delay(500);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project