Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smg_uart_uninit() from blocking subsequent re-initialisation (#… #2561

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

slaff
Copy link
Contributor

@slaff slaff commented Sep 30, 2022

…2560)

This PR fixes a bug in the Esp8266 and Host uart driver implementations of smg_uart_uninit which causes subsequent calls to smg_uart_init_ex to fail as it thinks the port is in use.

This bug is exposed if a port is opened, closed and then re-opened:

Serial.begin(COM_SPEED_SERIAL);
...
Serial.end(); // optional - begin() calls this internally anyway
Serial.begin(9600); // fails

Also add a bool return value from HardwareSerial::begin() method so caller can check for errors.

…mingHub#2560)

This PR fixes a bug in the Esp8266 and Host uart driver implementations of `smg_uart_uninit` which causes subsequent calls to `smg_uart_init_ex` to fail as it thinks the port is in use.

This bug is exposed if a port is opened, closed and then re-opened:

```
Serial.begin(COM_SPEED_SERIAL);
...
Serial.end(); // optional - begin() calls this internally anyway
Serial.begin(9600); // fails
```

Also add a `bool` return value from `HardwareSerial::begin()` method so caller can check for errors.
@slaff slaff added this to the 4.2.x - LTS milestone Sep 30, 2022
@slaff slaff merged commit 4cf5a69 into SmingHub:lts-develop/4.2.x Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants