Skip to content

Commit db107e1

Browse files
committed
pbio/drv/clock: Add none driver.
This doesn't work with the static inlines, so make a placeholder driver for new ports that don't have a clock yet.
1 parent f8a817e commit db107e1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

bricks/_common/sources.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ PBIO_SRC_C = $(addprefix lib/pbio/,\
138138
drv/charger/charger_mp2639a.c \
139139
drv/clock/clock_ev3rt.c \
140140
drv/clock/clock_linux.c \
141+
drv/clock/clock_none.c \
141142
drv/clock/clock_nxt.c \
142143
drv/clock/clock_stm32.c \
143144
drv/clock/clock_test.c \

lib/pbio/drv/clock/clock_none.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: MIT
2+
// Copyright (c) 2024 The Pybricks Authors
3+
4+
#include <pbdrv/config.h>
5+
6+
#if PBDRV_CONFIG_CLOCK_NONE
7+
8+
#include <stdint.h>
9+
10+
void pbdrv_clock_init(void) {
11+
}
12+
13+
uint32_t pbdrv_clock_get_us(void) {
14+
return 0;
15+
}
16+
17+
uint32_t pbdrv_clock_get_ms(void) {
18+
return 0;
19+
}
20+
21+
uint32_t pbdrv_clock_get_100us(void) {
22+
return 0;
23+
}
24+
25+
#endif // PBDRV_CONFIG_CLOCK_NONE

0 commit comments

Comments
 (0)