Hello,
Any ideas on how to bring the ring buffer code into the project? Can we create additional files other than main.c (any ideas on how to do that?) My main.c will get really big and will be hard to work with.
Adding the header file is not enough to compile the ring buffer APIs because the actual function definitions are located in the ring_buffer.c file :
#include <zephyr/sys/ring_buffer.h> <——I have included this file
ring_buf_put (….) <—– API in main.c does not compile because the linker can not find where the function definitions are located (but they are located in ../zephyrproject/zephyr/lib/os/ring_buffer.c)
in function uart_thread':
... can/src/main.c:363: undefined reference to
ring_buf_put’
collect2: error: ld returned 1 exit status <———————– linker error
ninja: build stopped: subcommand failed.
The *.h file is at …/generated/syscalls_links/include_zephyr/sys/ring_buffer.h, and I assume that the #include takes care of that.
I could not find any guidance in https://docs.zephyrproject.org/3.1.0/develop/application/index.html
Thank you!