Commit 4b50281f authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Carles Cufi
Browse files

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: default avatarAlberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
parent 032b3d12
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ zephyr_library_sources(
	time_machine.c
	trace_hook.c
	cmsis.c
	soc/nrfx_coredep.c
)

zephyr_library_include_directories(
+23 −0
Original line number Diff line number Diff line
/*
 * 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);
}