-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/avr8_common: Prepare for rework ISR #19777
cpu/avr8_common: Prepare for rework ISR #19777
Conversation
Code looks good to me, but the CI has some comments. Note: The vera++ annotations are completely unrelated to this PR and #19779 should fix them. |
3d08415
to
70c08be
Compare
The avr8_state store state information used to determine scheduling and uart irq. This move all uart irq states to avr8_state_uart variable. It introduce the use of General Purpose IO Register 0 (GPIOR0) when available and now all uarts from xmega can be used. This is a preparation for future scheduling and irq optimizations. Signed-off-by: Gerson Fernando Budke <[email protected]>
The avr8_state variable uses bit operation to set/clear the state. This rework avr8_state to use increment/decrement instead. It introduce the use of General Purpose IO Register 1 (GPIOR1) when available. This is a preparation for future scheduling and irq optimizations. Signed-off-by: Gerson Fernando Budke <[email protected]>
The thread_yield_higher is a normal functions. However it has a non regular return instruction which is useless. This remove the useless return on thread_yield_higher to save flash bytes. Signed-off-by: Gerson Fernando Budke <[email protected]>
70c08be
to
9e40e39
Compare
The current ISR implementation for AVR8 requires use of avr8_[enter/exit]_isr pair which add some boilerplate on code. This add AVR8_ISR which clean-up the code and make it simpler and hides any schedule detail from the user perspective. This is a preparation for future scheduling and irq optimizations. Signed-off-by: Gerson Fernando Budke <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
Signed-off-by: Gerson Fernando Budke <[email protected]>
9e40e39
to
1e23730
Compare
This seems ready to go! |
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.
bors merge
19777: cpu/avr8_common: Prepare for rework ISR r=benpicco a=nandojve ### Contribution description This prepares for rework how ISR is handled for AVR-8 platform. It is not expected changes on the behavior but tests on other boards were welcome to avoid regressions. #### Improvements * Split UART state from ISR states. Now it is necessary two variables and GPIORx registers are automatically selected when available. * UART states now supports up to 8 UARTs. * Added AVR8_ISR macro do clean-up and hide internals related to ISR processing. This allows changes on ISR without any other changes on drivers. ### Testing procedure Tests were conducted using atmega328p-xplained-mini and atxmega-a1u-xpro and the zigduino board was only built. The example thread_duel was used to test regressions. 19798: cpu/nrf53: add I2C and SPI support r=benpicco a=dylad ### Contribution description This PR provides support for nRF53 SPI and I2C. It also moves common structs from each nRF CPU folder to `cpu/nrf5x_common` to avoid duplication. Moreover, since nRF9160 and nRF5340 have shared IRQ for UART/SPI/I2C. Both this families now use a common file to register and manage these interrupts. Note that nRF9160 have different name for its interrupts than nRF5340 but they have the same purpose. ### Testing procedure Since some structs were moved around, I think this PR should be carefully tested against nRF52, nRF53 and nRF9160 to avoid any issues. On nRF5340DK-APP, SPI can be tested with its onboard SPI flash. ### Issues/PRs references Co-authored-by: Gerson Fernando Budke <[email protected]> Co-authored-by: Dylan Laduranty <[email protected]>
Build failed (retrying...): |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
This prepares for rework how ISR is handled for AVR-8 platform. It is not expected changes on the behavior but tests on other boards were welcome to avoid regressions.
Improvements
Testing procedure
Tests were conducted using atmega328p-xplained-mini and atxmega-a1u-xpro and the zigduino board was only built. The example thread_duel was used to test regressions.