1 /* 2 * Copyright (c) 2023 Trackunit Corporation 3 * Copyright (c) 2025 Croxel Inc. 4 * Copyright (c) 2025 CogniPilot Foundation 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 */ 8 9 #include <zephyr/kernel.h> 10 #include <zephyr/sys/iterable_sections.h> 11 #include <zephyr/gnss/rtk/rtk.h> 12 gnss_rtk_publish_data(const struct gnss_rtk_data * data)13void gnss_rtk_publish_data(const struct gnss_rtk_data *data) 14 { 15 static K_SEM_DEFINE(publish_lock, 1, 1); 16 17 (void)k_sem_take(&publish_lock, K_FOREVER); 18 19 STRUCT_SECTION_FOREACH(gnss_rtk_data_callback, callback) { 20 callback->callback(callback->dev, data); 21 } 22 23 k_sem_give(&publish_lock); 24 } 25