Contiki-NG
Toggle main menu visibility
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
21
void
22
rtimer_arch_init
(
void
)
23
{
24
}
25
26
void
27
rtimer_arch_schedule
(rtimer_clock_t t)
28
{
29
(void)t;
/* stub: see the WARNING above — does not actually schedule */
30
}
31
32
rtimer_clock_t
33
rtimer_arch_now
(
void
)
34
{
35
uint32_t lo;
36
__asm__
volatile
(
"csrr %0, cycle"
:
"=r"
(lo));
37
return
(rtimer_clock_t)lo;
38
}
rtimer_arch_init
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_arch_now
rtimer_clock_t rtimer_arch_now()
Returns the current real-time clock time.
Definition
rtimer-arch.c:109
rtimer_arch_schedule
void rtimer_arch_schedule(rtimer_clock_t t)
Schedules an rtimer task to be triggered at time t.
Definition
rtimer-arch.c:65
rtimer.h
Header file for the real-time timer module.
arch
cpu
nrf-vpr
rtimer-arch.c
Generated on
for Contiki-NG by
1.17.0