nrf52_bsim: Add replacement for nrfx's nrfx_coredep_delay_us()
Provide a replacement for this board for the nordic HAL nrfx nrfx_coredep_delay_us() This function is a busy wait, which in the HAL relies on the ARM DWT or assembler, but which in this board can just utilize the same busy_wait mechanism provided for k_busy_wait() Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
032b3d121d
commit
4b50281fca
|
@ -30,6 +30,7 @@ zephyr_library_sources(
|
|||
time_machine.c
|
||||
trace_hook.c
|
||||
cmsis.c
|
||||
soc/nrfx_coredep.c
|
||||
)
|
||||
|
||||
zephyr_library_include_directories(
|
||||
|
|
23
boards/posix/nrf52_bsim/soc/nrfx_coredep.c
Normal file
23
boards/posix/nrf52_bsim/soc/nrfx_coredep.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <kernel_internal.h>
|
||||
|
||||
/*
|
||||
* Replacement for the nrfx nrfx_coredep_delay_us()
|
||||
* which busy waits for the given number of microseconds.
|
||||
*
|
||||
* This function will replace at *link* time the
|
||||
* nrfx one which had been marked as weak.
|
||||
*/
|
||||
void nrfx_coredep_delay_us(uint32_t time_us)
|
||||
{
|
||||
if (time_us == 0) {
|
||||
return;
|
||||
}
|
||||
arch_busy_wait(time_us);
|
||||
}
|
Loading…
Reference in a new issue