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

Allow sending messages directly from ISR #881

Closed

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 15, 2023

Introduce new synchronization primitives to try to acquire locks and introduce
new functions to send messages from an interrupt service routine

Also fix Pico networking code that currently does this as it's using the
low-priority interrupt mode

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot pguyot force-pushed the w41/allow-sending-messages-from-isr branch 2 times, most recently from 4affd01 to cc1bf1f Compare October 23, 2023 05:32
@pguyot pguyot force-pushed the w41/allow-sending-messages-from-isr branch 14 times, most recently from 5df5e23 to 81b4d8b Compare October 28, 2023 11:08
Introduce and document new functions to send messages from an interrupt service
routine

Add CMake option AVM_DISABLE_ISR to disable these functions as they require
several synchronization and atomic primitives that are not available on all
platforms

Introduce the required synchronization primitives that try and acquire locks

Also fix Pico networking code that sends messages from interrupt service code
(as chosen lwIP mode is low-priority interrupt mode) by using these new
functions

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w41/allow-sending-messages-from-isr branch from 81b4d8b to 4b9711e Compare October 28, 2023 13:03
@pguyot pguyot marked this pull request as ready for review October 28, 2023 13:25
@pguyot
Copy link
Collaborator Author

pguyot commented Oct 29, 2023

Unlike ESP32 SDK, malloc is not interrupt safe with Pico SDK on the contrary to what I thought, so this PR is useless unless we want to enable ISR callbacks on ESP32.

@pguyot pguyot closed this Oct 29, 2023
@fadushin
Copy link
Collaborator

Too bad, this looks like it was a lot of work. Can anything be salvaged?

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