-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
In bridge.h k_msleep calls should be substituted by k_yield
see zephyr documentation
boolean flags should be substituted by zephyr atomic_t type and accessed accordingly eg:
#include <zephyr/sys/atomic.h>
atomic_t data_ready = ATOMIC_INIT(0);
int shared_data;
// Producer thread
void producer(void) {
shared_data = 42;
// Use release ordering to ensure data is visible
atomic_set(&data_ready, 1);
}
// Consumer thread
void consumer(void) {
// Use acquire ordering to ensure we see the data
while (atomic_get(&data_ready) == 0) {
k_yield(); // or k_msleep(1)
}
// Now safe to use shared_data
printk("Data: %d\n", shared_data);
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request