Contiki-NG
Loading...
Searching...
No Matches
rtimer-arch.c
1/*
2 * Copyright (c) 2026, RISE Research Institutes of Sweden AB
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#include "contiki.h"
9#include "sys/rtimer.h"
10#include "rtimer-arch.h"
11#include <stdint.h>
12
13/*
14 * rtimer is a stub on the FLPR: rtimer_arch_schedule() is a no-op, so
15 * rtimer_set() callbacks never fire (anything relying on rtimers, e.g.
16 * TSCH/CSL, will hang). rtimer_arch_now() and RTIMER_ARCH_SECOND are
17 * placeholders too. A real implementation needs a GRTC compare channel
18 * + interrupt.
19 */
20
21void
23{
24}
25
26void
27rtimer_arch_schedule(rtimer_clock_t t)
28{
29 (void)t; /* stub: see the WARNING above — does not actually schedule */
30}
31
32rtimer_clock_t
34{
35 uint32_t lo;
36 __asm__ volatile ("csrr %0, cycle" : "=r"(lo));
37 return (rtimer_clock_t)lo;
38}
void rtimer_arch_init(void)
We don't need to explicitly initialise anything but this routine is required by the API.
Definition rtimer-arch.c:59
rtimer_clock_t rtimer_arch_now()
Returns the current real-time clock time.
void rtimer_arch_schedule(rtimer_clock_t t)
Schedules an rtimer task to be triggered at time t.
Definition rtimer-arch.c:65
Header file for the real-time timer module.