-
-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
[Feature Request] Adafruit BLE UART Friend support (refinement and re-open #10674) #22495
base: develop
Are you sure you want to change the base?
Conversation
platforms/avr/drivers/uart.h
Outdated
@@ -31,6 +31,7 @@ void uart_init(uint32_t baud); | |||
void uart_write(uint8_t data); | |||
|
|||
uint8_t uart_read(void); | |||
int16_t uart_read2(void); // non-blocking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition here would be invalid, as it creates inconsistencies in what is meant to be a generic API.
The net result is your change would only successfully compile on AVR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thank you for your reviews.
I will re-refine and re-think strategy to support Adafruit BLE UART friends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can also be implemented using the existing APIs:
int16_t uart_read_nonblock() {
if (uart_available()) {
return uart_read();
} else {
return -1;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, it works! thank you for your advice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed unecessary changes about generic UART driver's code and re-pushed. thank you.
7e75f57
to
6435a0f
Compare
this PR is still lack of test code/coverage for added function, but i don't know how to add test/mock for driver in QMK. |
6435a0f
to
2d0e448
Compare
code rebased to change target branch (master -> develop) |
make more clean definition
Would be nice to make this cross MCU .. rn it's using AVR specific functions like |
https://github.com/qmk/qmk_firmware/blob/master/platforms/progmem.h already defines a lot of similar functions as alias to "regular" functions on non-AVR controllers, adding a couple of them should be enough make the code cross-platform ( |
Description
Add driver support for Adafruit BLE UART friends
, and add non-blocking read API to AVR UART driver.The function required from YANG's HHKB BLE mod.
HHKB BLE mod is already merged to master branch, but this code base is cannot build with
BLUETOOTH_ENABLE
at all time due to lack of feature support for Adafruit BLE UART. HHKB BLE mod's code calls non exist API.Types of Changes
Related issues
BLUETOOTH_ENABLE
#22494Checklist
Acknowledgments
some code reference to @naoki-mizuno 's code within kanru#3 and originally PR by @kanru
thank you for your contributions and knowledgements.