mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #10881 from AGlass0fMilk/fix-nrf52-critical-region-api
Fix Nordic/Mbed Critical Section API Inconsistency (In Builds w/o Softdevice)pull/10928/head
commit
d71db32154
|
@ -4,6 +4,8 @@ components/libraries
|
||||||
|
|
||||||
# Modifications
|
# Modifications
|
||||||
|
|
||||||
|
* Modified util/app_util_platform.c to retarget critical section enter/exit calls to Mbed's HAL API so they both share the same nested critical regions counter. This only applies in builds without `SOFTDEVICE_PRESENT` defined.
|
||||||
|
|
||||||
Only essential folders have been copied over.
|
Only essential folders have been copied over.
|
||||||
|
|
||||||
Removed:
|
Removed:
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
*/
|
*/
|
||||||
#include "app_util_platform.h"
|
#include "app_util_platform.h"
|
||||||
|
|
||||||
|
#include "mbed_critical.h"
|
||||||
|
|
||||||
#ifdef SOFTDEVICE_PRESENT
|
#ifdef SOFTDEVICE_PRESENT
|
||||||
/* Global nvic state instance, required by nrf_nvic.h */
|
/* Global nvic state instance, required by nrf_nvic.h */
|
||||||
nrf_nvic_state_t nrf_nvic_state;
|
nrf_nvic_state_t nrf_nvic_state;
|
||||||
|
@ -71,8 +73,13 @@ void app_util_critical_region_enter(uint8_t *p_nested)
|
||||||
/* return value can be safely ignored */
|
/* return value can be safely ignored */
|
||||||
(void) sd_nvic_critical_region_enter(p_nested);
|
(void) sd_nvic_critical_region_enter(p_nested);
|
||||||
#else
|
#else
|
||||||
app_util_disable_irq();
|
/** Mbed modification
|
||||||
|
* Retarget nRF SDK to use Mbed critical section API
|
||||||
|
*/
|
||||||
|
//app_util_disable_irq();
|
||||||
|
core_util_critical_section_enter();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void app_util_critical_region_exit(uint8_t nested)
|
void app_util_critical_region_exit(uint8_t nested)
|
||||||
|
@ -85,7 +92,11 @@ void app_util_critical_region_exit(uint8_t nested)
|
||||||
/* return value can be safely ignored */
|
/* return value can be safely ignored */
|
||||||
(void) sd_nvic_critical_region_exit(nested);
|
(void) sd_nvic_critical_region_exit(nested);
|
||||||
#else
|
#else
|
||||||
app_util_enable_irq();
|
/** Mbed modification
|
||||||
|
* Retarget nRF SDK to use Mbed critical section API
|
||||||
|
*/
|
||||||
|
//app_util_enable_irq();
|
||||||
|
core_util_critical_section_exit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue