Merge pull request #137 from aykevl/function-pointer-types

porting: Use real function pointer types for ISR functions
This commit is contained in:
Andrzej Kaczmarek
2018-10-19 13:09:07 +02:00
committed by GitHub
7 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -334,7 +334,7 @@ ble_hw_rng_init(ble_rng_isr_cb_t cb, int bias)
#if MYNEWT
NVIC_SetVector(RNG_IRQn, (uint32_t)ble_rng_isr);
#else
ble_npl_hw_set_isr(RNG_IRQn, (uint32_t)ble_rng_isr);
ble_npl_hw_set_isr(RNG_IRQn, ble_rng_isr);
#endif
NVIC_EnableIRQ(RNG_IRQn);
g_ble_rng_isr_cb = cb;
+1 -1
View File
@@ -1448,7 +1448,7 @@ ble_phy_init(void)
#if MYNEWT
NVIC_SetVector(RADIO_IRQn, (uint32_t)ble_phy_isr);
#else
ble_npl_hw_set_isr(RADIO_IRQn, (uint32_t)ble_phy_isr);
ble_npl_hw_set_isr(RADIO_IRQn, ble_phy_isr);
#endif
NVIC_EnableIRQ(RADIO_IRQn);
+1 -1
View File
@@ -157,7 +157,7 @@ void ble_npl_time_delay(ble_npl_time_t ticks);
#if NIMBLE_CFG_CONTROLLER
void ble_npl_hw_set_isr(int irqn, uint32_t addr);
void ble_npl_hw_set_isr(int irqn, void (*addr)(void));
#endif
+1 -1
View File
@@ -503,7 +503,7 @@ hal_timer_init(int timer_num, void *cfg)
#if MYNEWT
NVIC_SetVector(irq_num, (uint32_t)irq_isr);
#else
ble_npl_hw_set_isr(irq_num, (uint32_t)irq_isr);
ble_npl_hw_set_isr(irq_num, irq_isr);
#endif
return 0;
@@ -272,7 +272,7 @@ ble_npl_time_delay(ble_npl_time_t ticks)
#if NIMBLE_CFG_CONTROLLER
static inline void
ble_npl_hw_set_isr(int irqn, uint32_t addr)
ble_npl_hw_set_isr(int irqn, void (*addr)(void))
{
npl_freertos_hw_set_isr(irqn, addr);
}
@@ -65,7 +65,7 @@ ble_npl_error_t npl_freertos_time_ms_to_ticks(uint32_t ms,
ble_npl_error_t npl_freertos_time_ticks_to_ms(ble_npl_time_t ticks,
uint32_t *out_ms);
void npl_freertos_hw_set_isr(int irqn, uint32_t addr);
void npl_freertos_hw_set_isr(int irqn, void (*addr)(void));
uint32_t npl_freertos_hw_enter_critical(void);
+7 -7
View File
@@ -19,30 +19,30 @@
#include "cpu.h"
static uint32_t radio_isr_addr;
static uint32_t rng_isr_addr;
static uint32_t rtc0_isr_addr;
static void (*radio_isr_addr)(void);
static void (*rng_isr_addr)(void);
static void (*rtc0_isr_addr)(void);
void
isr_radio(void)
{
((void (*)(void))radio_isr_addr)();
radio_isr_addr();
}
void
isr_rng(void)
{
((void (*)(void))rng_isr_addr)();
rng_isr_addr();
}
void
isr_rtc0(void)
{
((void (*)(void))rtc0_isr_addr)();
rtc0_isr_addr();
}
void
ble_npl_hw_set_isr(int irqn, uint32_t addr)
ble_npl_hw_set_isr(int irqn, void (*addr)(void))
{
switch (irqn) {
case RADIO_IRQn: