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: Corrected function pointer prototype and build issues #607

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions multicore/multicore_runner/multicore_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

#define FLAG_VALUE 123

typedef int32_t (*func_ptr_t)(int32_t);

void core1_entry() {
while (1) {
// Function pointer is passed to us via the FIFO
// We have one incoming int32_t as a parameter, and will provide an
// int32_t return value by simply pushing it back on the FIFO
// which also indicates the result is ready.
int32_t (*func)() = (int32_t(*)()) multicore_fifo_pop_blocking();
func_ptr_t func = (func_ptr_t) multicore_fifo_pop_blocking();
int32_t p = multicore_fifo_pop_blocking();
int32_t result = (*func)(p);
int32_t result = func(p);
multicore_fifo_push_blocking(result);
}
}
Expand Down