nros C API
Lightweight ROS 2 client for embedded real-time systems
Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1
10
11#ifndef NROS_TIMER_H
12#define NROS_TIMER_H
13
14/* Type and function definitions live in <rclc/detail/nros_generated.h>.
15 * This per-module header is kept as a thin shim so existing code that
16 * does `#include <rclc/timer.h>` continues to compile. */
17#include "rclc/types.h"
18
19#include <stddef.h>
20
42#define RCLC_CONTAINER_OF(ptr, type, member) ((type*)(void*)((char*)(ptr)-offsetof(type, member)))
43
104static inline rcl_ret_t rcl_difference_times(const struct rclc_time_t* start,
105 const struct rclc_time_t* finish,
106 struct rcl_duration_t* delta) {
107 if (start == NULL || finish == NULL || delta == NULL) {
109 }
110 /* Both decodes go through the exported entry point; see the note above on
111 * why neither the decode nor the encode is spelled out here. */
114 return RCL_RET_OK;
115}
116
117#endif /* NROS_TIMER_H */
118
119/* Every upstream-path header carries the whole C API, as `<rclc/rclc.h>` does
120 * (phase-492): a ported file that includes only `<rclc/timer.h>` still finds
121 * `RCLC_CHECK_RET`, `RCLC_LOG_*` and the rcl spellings. Outside the guard, so
122 * this header's own declarations are complete before the umbrella reads them. */
123#include "rclc/rclc.h"
#define RCL_RET_OK
Definition nros_generated.h:3489
#define RCL_RET_INVALID_ARGUMENT
Definition nros_generated.h:3504
int64_t rclc_time_to_nanoseconds(const struct rclc_time_t *time)
struct rcl_duration_t rclc_duration_from_nanoseconds(int64_t nanoseconds)
int rcl_ret_t
Definition nros_generated.h:977
Umbrella header for the nano-ros C API, at upstream's path.
Definition nros_generated.h:996
Definition nros_generated.h:982
static rcl_ret_t rcl_difference_times(const struct rclc_time_t *start, const struct rclc_time_t *finish, struct rcl_duration_t *delta)
Compute the duration between two time points: finish - start.
Definition timer.h:104
Shared types and constants for the nros C API.