Skip to content
Snippets Groups Projects
Commit b6832e3f authored by schneider's avatar schneider
Browse files

Merge branch 'schneider/ble-critical-section' into 'master'

fix(ble): Reduce scope of cricitcal section when initializing

Closes #203

See merge request !395
parents 4de2d241 4882da8a
No related branches found
No related tags found
1 merge request!395fix(ble): Reduce scope of cricitcal section when initializing
Pipeline #4675 passed
......@@ -64,6 +64,7 @@ static bool log_enabled = false;
static int log_lastflushtick = 0;
/*! \brief Stack initialization for app. */
extern void LlStackInit(void);
extern void StackInit(void);
extern void bleuart_init(void);
extern void bleFileTransfer_init(void);
......@@ -431,12 +432,15 @@ void vBleTask(void *pvParameters)
NVIC_EnableIRQ(RSV11_IRQn);
WsfInit();
taskENTER_CRITICAL();
/* Critical section to prevent a loop in iq_capture2 / meas_freq in
* /home/maxim/Documents/src/BLE/mcbusw/Hardware/Micro/ME14/Firmware/trunk/NDALibraries/BTLE/phy/dbb/prot/ble/pan2g5/afe/max32665/board_config.c:275
* if BHI160 and -Ddebug_prints=true is enabled*/
StackInit();
* if BHI160 and -Ddebug_prints=true is enabled. See #115. */
LlStackInit();
taskEXIT_CRITICAL();
StackInit();
BbBleDrvSetTxPower(0);
setAddress();
......
......@@ -105,16 +105,13 @@ const BbRtCfg_t _bb_cfg = {
/*************************************************************************************************/
/*!
* \brief Initialize stack.
* \brief Initialize link layer part of the stack.
*
* \return None.
*/
/*************************************************************************************************/
void StackInit(void)
void LlStackInit()
{
wsfHandlerId_t handlerId;
/* card10: We do not use the SDMA HCI at the moment. The block below is not compiled. */
#ifndef ENABLE_SDMA
uint32_t memUsed;
......@@ -137,6 +134,18 @@ void StackInit(void)
(unsigned int)LL_MEMORY_FOOTPRINT);
}
#endif
}
/*************************************************************************************************/
/*!
* \brief Initialize stack.
*
* \return None.
*/
/*************************************************************************************************/
void StackInit(void)
{
wsfHandlerId_t handlerId;
SecInit();
SecRandInit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment