• Support
  • Looking for k_queue_append (), k_queue_init() example

Hello, I am having trouble getting these APIs to work : k_queue_append (), k_queue_init(), etc. I am using
https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/kernel/queue/src/test_queue_contexts.c as the prime example. However, this example is for ZTEST, but I was looking for a smaller code snippet that uses queues. I also need to use tasks (and I have them), so the queues meant to be for inter-task communication. My other alternative is to use messages queues defined in https://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.3.0/zephyr/kernel/data_passing/message_queues.html (I have not tried them yet). Any ideas are appreciated!

What exactly are you using the queue for? I found that using message queues is a bit more sane for my applications. FIFOs are also useful but require heap usage or a separate pre-allocation of memory.

    Planning on using them to pass the info between the threads. I am switching to the message queues. I think they are a lot more straightforward, like you said.

      Terms and Conditions | Privacy Policy