Skip to content

Commit 3a33584

Browse files
committed
ports/cheriot-rtos/hal: Created timer.h header file.
Signed-off-by: Jacob Trevor <[email protected]>
1 parent 1c48699 commit 3a33584

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ports/cheriot-rtos/hal/timer.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#include <platform-timer.hh>
22

3-
uint64_t get_time() {
3+
extern "C" uint64_t get_time() {
44
StandardClint::init();
55
return StandardClint::time();
66
}
7+
8+
// extern "C" void set_next(uint64_t next_time) {
9+
// StandardClint::init();
10+
// StandardClint::setnext(next_time);
11+
// }
12+
13+
// extern "C" void clear() {
14+
// StandardClient::clear();
15+
// }

ports/cheriot-rtos/hal/timer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "py/obj.h"
2+
3+
#define CLOCK_FREQ_KHZ (50000)
4+
#define MS_TO_CLOCK_CYCLES(x) (x * CLOCK_FREQ_KHZ) // clock 50mHz
5+
6+
extern "C" uint64_t get_time();

ports/cheriot-rtos/hal/uart.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#include <platform-uart.hh>
22

3-
extern uint64_t get_time();
4-
5-
#define CLOCK_FREQ_KHZ (50000)
6-
#define MS_TO_CLOCK_CYCLES(x) (x * CLOCK_FREQ_KHZ) // clock 50mHz
3+
#include "timer.h"
74

85
extern "C" uint8_t uart_get_rx_level(volatile OpenTitanUart<115'200> *block) {
96
return (block->fifoStatus >> 16) & 0xff;

0 commit comments

Comments
 (0)