File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 29
29
#include <sys/boardctl.h>
30
30
#include <sys/time.h>
31
31
32
+ #include <cxd56_rtc.h>
33
+
32
34
#include "sched/sched.h"
33
35
34
36
#include "boards/board.h"
45
47
safe_mode_t port_init (void ) {
46
48
boardctl (BOARDIOC_INIT , 0 );
47
49
48
- board_init ();
50
+ // Wait until RTC is available
51
+ while (g_rtc_enabled == false);
49
52
50
53
if (board_requests_safe_mode ()) {
51
54
return USER_SAFE_MODE ;
@@ -121,14 +124,10 @@ void board_timerhook(void)
121
124
}
122
125
123
126
uint64_t port_get_raw_ticks (uint8_t * subticks ) {
124
- struct timeval tv ;
125
- gettimeofday (& tv , NULL );
126
- long computed_subticks = tv .tv_usec * 1024 * 32 / 1000000 ;
127
- if (subticks != NULL ) {
128
- * subticks = computed_subticks % 32 ;
129
- }
127
+ uint64_t count = cxd56_rtc_count ();
128
+ * subticks = count % 32 ;
130
129
131
- return tv . tv_sec * 1024 + computed_subticks / 32 ;
130
+ return count / 32 ;
132
131
}
133
132
134
133
// Enable 1/1024 second tick.
You can’t perform that action at this time.
0 commit comments