Skip to content

Commit 8c8db7d

Browse files
aescolarkartben
authored andcommitted
drivers/timer/native_posix_timer: Support only native_sim
Now that native_posix has been removed, this driver only needs to support native_sim. Let's stop using the transitional headers which supported both. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent 8b7bfd4 commit 8c8db7d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/timer/native_posix_timer.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#include <zephyr/init.h>
1616
#include <zephyr/drivers/timer/system_timer.h>
1717
#include <zephyr/sys_clock.h>
18-
#include "timer_model.h"
18+
#include "nsi_hw_scheduler.h"
19+
#include "nsi_timer_model.h"
1920
#include "soc.h"
2021
#include <zephyr/arch/posix/posix_trace.h>
2122

@@ -29,12 +30,12 @@ static uint64_t last_tick_time;
2930
*/
3031
uint32_t sys_clock_cycle_get_32(void)
3132
{
32-
return hwm_get_time();
33+
return nsi_hws_get_time();
3334
}
3435

3536
uint64_t sys_clock_cycle_get_64(void)
3637
{
37-
return hwm_get_time();
38+
return nsi_hws_get_time();
3839
}
3940

4041
/**
@@ -45,7 +46,7 @@ static void np_timer_isr(const void *arg)
4546
{
4647
ARG_UNUSED(arg);
4748

48-
uint64_t now = hwm_get_time();
49+
uint64_t now = nsi_hws_get_time();
4950
int32_t elapsed_ticks = (now - last_tick_time)/tick_period;
5051

5152
last_tick_time += elapsed_ticks*tick_period;
@@ -104,7 +105,7 @@ void sys_clock_set_timeout(int32_t ticks, bool idle)
104105
*/
105106
uint32_t sys_clock_elapsed(void)
106107
{
107-
return (hwm_get_time() - last_tick_time)/tick_period;
108+
return (nsi_hws_get_time() - last_tick_time)/tick_period;
108109
}
109110

110111
/**
@@ -128,7 +129,7 @@ static int sys_clock_driver_init(void)
128129

129130
tick_period = 1000000ul / CONFIG_SYS_CLOCK_TICKS_PER_SEC;
130131

131-
last_tick_time = hwm_get_time();
132+
last_tick_time = nsi_hws_get_time();
132133
hwtimer_enable(tick_period);
133134

134135
IRQ_CONNECT(TIMER_TICK_IRQ, 1, np_timer_isr, 0, 0);

0 commit comments

Comments
 (0)