Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.1k
Modification of ArduinoCore-avr to use API#329
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Move CDC and MSC classes to own files.Fix all u8/u32 entries to stantard types.
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.
Some drive-by comments, because I was curious to see what this was about...
| // Public Methods ////////////////////////////////////////////////////////////// | ||
| voidHardwareSerial::begin(unsignedlong baud,byte config) | ||
| voidUartClass::begin(unsignedlong baud,uint16_t config) |
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.
Theconfig is later assigned to a*_ucsrc which is declared as auint8_t in UART.h. Was this change intentional?
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 is due tohttps://github.com/arduino/ArduinoCore-API/blob/master/api/HardwareSerial.h#L91 , so the signature must beuint16_t .
Said that, I'll push a commit to fix this by casting the assignment*_ucsrc = (uint8_t)config; (since we are assured that config fits an uint8_t)
| #include"Stream.h" | ||
| #if ARDUINO_API_VERSION > 10000 | ||
| usingnamespacearduino; |
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.
Maybe add a comment to explain why thisusing namespace statement is needed. It us contrary to the usual recommendation of avoidingusing namespace in a C++ header file:https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
| volatileuint8_t *ucsrc,volatileuint8_t *udr); | ||
| voidbegin(unsignedlong baud) {begin(baud, SERIAL_8N1); } | ||
| voidbegin(unsignedlong,uint8_t); | ||
| voidbegin(unsignedlong,uint16_t); |
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.
Similar to above, it's not clear why this was changed to auint16_t, when theconfig is later assigned only to auint8_t.
Tnthr commentedSep 12, 2023
Has there been any further discussion on this? Or generally bringing the AVR core into the API? forum or mailing list perhaps? Thanks |
davidkennedydev commentedJul 8, 2025
Will Arduino eventually have a standard API for different boards? What is the status in 2025? |
Uh oh!
There was an error while loading.Please reload this page.
The following proposed modifications are intended to port the API to the AVR boards:
Files modified:
Files deleted, because included in the API: