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 #2560

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Sep 28, 2022

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.

Caller can check for errors.
@slaff slaff merged commit 8013fff into SmingHub:develop Sep 29, 2022
slaff pushed a commit to slaff/Sming that referenced this pull request Sep 30, 2022
…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 added a commit that referenced this pull request Oct 4, 2022
…2560) (#2561)

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.

Co-authored-by: Mike <[email protected]>
@mikee47 mikee47 deleted the fix/uart-uninit branch October 4, 2022 13:48
@slaff slaff mentioned this pull request Nov 8, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants