This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 4080f942f babblesim: Fix build errors
4080f942f is described below
commit 4080f942f185fe5f52dff7fa5cb6169dfc29769d
Author: Magdalena Kasenberg <[email protected]>
AuthorDate: Tue Jan 23 16:12:54 2024 +0100
babblesim: Fix build errors
that occurred after recent updates (nordic-nrfx v3.3.0.)
---
babblesim/core/include/core_cm4.h | 2 ++
babblesim/core/src/main_config.c | 4 +++-
babblesim/edtt/hci_test/src/main.c | 13 ++-----------
babblesim/hw/mcu/nordic/nrf52_bsim/src/hal_timer.c | 4 +++-
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/babblesim/core/include/core_cm4.h
b/babblesim/core/include/core_cm4.h
index ef8f9c3fb..8b35f4a51 100644
--- a/babblesim/core/include/core_cm4.h
+++ b/babblesim/core/include/core_cm4.h
@@ -17,6 +17,8 @@
extern void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority);
extern void NVIC_EnableIRQ(IRQn_Type IRQn);
extern void NVIC_DisableIRQ(IRQn_Type IRQn);
+extern void NVIC_SetPendingIRQ(IRQn_Type IRQn);
+extern void NVIC_ClearPendingIRQ(IRQn_Type IRQn);
void __WFI(void);
diff --git a/babblesim/core/src/main_config.c b/babblesim/core/src/main_config.c
index 467ae6234..39a03c3cd 100644
--- a/babblesim/core/src/main_config.c
+++ b/babblesim/core/src/main_config.c
@@ -23,6 +23,8 @@
uint global_device_nbr;
struct nrf52_bsim_args_t *args;
+extern int mynewt_main(int argc, char **argv);
+
void
bst_tick(bs_time_t time)
{
@@ -46,7 +48,7 @@ main_clean_up_trace_wrap(void)
return inner_main_clean_up(0);
}
-void
+int
main(int argc, char** argv)
{
setvbuf(stdout, NULL, _IOLBF, 512);
diff --git a/babblesim/edtt/hci_test/src/main.c
b/babblesim/edtt/hci_test/src/main.c
index 0ca152cfc..43ef62126 100644
--- a/babblesim/edtt/hci_test/src/main.c
+++ b/babblesim/edtt/hci_test/src/main.c
@@ -22,8 +22,8 @@
#include "os/mynewt.h"
#include "ble_hci_edtt.h"
-static int
-main_fn(int argc, char **argv)
+int
+mynewt_main(int argc, char **argv)
{
sysinit();
@@ -34,12 +34,3 @@ main_fn(int argc, char **argv)
}
return 0;
}
-
-int
-main(int argc, char **argv)
-{
- extern void bsim_init(int argc, char** argv, void *main_fn);
- bsim_init(argc, argv, main_fn);
-
- return 0;
-}
diff --git a/babblesim/hw/mcu/nordic/nrf52_bsim/src/hal_timer.c
b/babblesim/hw/mcu/nordic/nrf52_bsim/src/hal_timer.c
index 0e3d914c9..a847e9b68 100644
--- a/babblesim/hw/mcu/nordic/nrf52_bsim/src/hal_timer.c
+++ b/babblesim/hw/mcu/nordic/nrf52_bsim/src/hal_timer.c
@@ -663,7 +663,9 @@ hal_timer_config(int timer_num, uint32_t freq_hz)
nrf_timer_task_trigger(hwtimer, NRF_TIMER_TASK_CLEAR);
/* Put the timer in timer mode using 32 bits. */
- nrf_timer_mode_set(hwtimer, NRF_TIMER_MODE_TIMER);
+ hwtimer->MODE = (hwtimer->MODE & ~TIMER_MODE_MODE_Msk) |
+ ((NRF_TIMER_MODE_TIMER << TIMER_MODE_MODE_Pos) &
+ TIMER_MODE_MODE_Msk);
hwtimer->BITMODE = TIMER_BITMODE_BITMODE_32Bit;
/* Set the pre-scalar */