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
Martin Kojtal 2019-07-01 09:18:10 +01:00 committed by GitHub
commit d71db32154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -4,6 +4,8 @@ components/libraries
# 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.
Removed:

View File

@ -39,6 +39,8 @@
*/
#include "app_util_platform.h"
#include "mbed_critical.h"
#ifdef SOFTDEVICE_PRESENT
/* Global nvic state instance, required by nrf_nvic.h */
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 */
(void) sd_nvic_critical_region_enter(p_nested);
#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
}
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 */
(void) sd_nvic_critical_region_exit(nested);
#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
}