RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
ab_gp_cycle_ticks.h
Go to the documentation of this file.
1
33#ifndef AB_GP_CYCLE_TICKS_H
34#define AB_GP_CYCLE_TICKS_H
35
36#include <stdint.h>
37
38#include "rte/oal/mutex/rte_mutex.h"
39#include "rte/utils/status/rte_status.h"
40#include "rte/utils/types/rte_types.h"
41
44#define AB_GP_CYCLE_TICKS_LOCK_TIMEOUT_MS 10U
45
47typedef struct
48{
49 rte_mutex_storage_t storage;
50 rte_mutex_handle_t handle;
51 uint32_t count;
53
62
72
82rte_status_t ab_gp_cycle_ticks_take(ab_gp_cycle_ticks_t *ticks, uint32_t *out_pending);
83
92
93#endif /* AB_GP_CYCLE_TICKS_H */
rte_status_t ab_gp_cycle_ticks_take(ab_gp_cycle_ticks_t *ticks, uint32_t *out_pending)
Returns every pending tick and clears the count, as one critical section (cycle thread side).
rte_status_t ab_gp_cycle_ticks_teardown(ab_gp_cycle_ticks_t *ticks)
Destroys the mutex. Call only when no other task can post or take any more (the posting timer is dest...
rte_status_t ab_gp_cycle_ticks_setup(ab_gp_cycle_ticks_t *ticks)
Creates the mutex and clears the count. Setup phase only (rte_mutex_create() is a setup-only resource...
rte_status_t ab_gp_cycle_ticks_post(ab_gp_cycle_ticks_t *ticks)
Adds one tick (timer callback side). The count saturates at UINT32_MAX.
Tick count and the mutex that guards it. Not volatile: every access to count holds the mutex.
rte_mutex_handle_t handle
rte_mutex_storage_t storage