-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcy_ble_controller.c
613 lines (526 loc) · 22.9 KB
/
cy_ble_controller.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
/***************************************************************************//**
* \file cy_ble_controller.c
* \version 3.60
*
* \brief
* This file contains the source code for the API of the PSoC 6 BLE Middleware.
*
********************************************************************************
* \copyright
* Copyright 2017-2021, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cy_ble_event_handler.h"
#include "cy_ble_hal_pvt.h"
#include "cy_ble.h"
#include "cy_ble_stack_pvt.h"
#if defined(CY_IP_MXBLESS)
/*******************************************************************************
* Private Function Prototypes
*******************************************************************************/
static cy_en_syspm_status_t
Cy_BLE_ControllerDeepSleepCallback(cy_stc_syspm_callback_params_t *callbackParams,
cy_en_syspm_callback_mode_t mode);
/*******************************************************************************
* Global Variables
*******************************************************************************/
/** Pointer to the global BLE configuration structures */
static const cy_stc_ble_config_t *cy_ble_controllerConfigPtr = NULL;
/*******************************************************************************
* Internal Defines
*******************************************************************************/
#define CY_BLE_SEND_IPC_MESSAGE_TIMEOUT (2000u)
#define CY_BLE_WAIT_CONTR_START_TIMEOUT (2000u)
/******************************************************************************
* Function Name: Cy_BLE_InitController
***************************************************************************//**
*
* Initializes the PSoC 6 BLE Middleware (controller part).
*
* This function must used only in HCI or BLE dual CPU mode and called on CPU core,
* where BLE controller is running.
*
* \param config: The configuration structure for the PSoC 6 BLE Middleware.
*
* \return
* \ref cy_en_ble_api_result_t : Return value indicates whether the function succeeded or
* failed. The following are possible error codes.
*
* Error codes | Description
* ------------ | -----------
* CY_BLE_SUCCESS | The function completed successfully.
* CY_BLE_ERROR_INVALID_PARAMETER | On specifying NULL as the input parameter.
*
******************************************************************************/
cy_en_ble_api_result_t Cy_BLE_InitController(const cy_stc_ble_config_t *config)
{
cy_en_ble_api_result_t apiResult = CY_BLE_ERROR_INVALID_PARAMETER;
if(config != NULL)
{
/* Register a pointer to the BLE controller configuration structure */
cy_ble_controllerConfigPtr = config;
Cy_BLE_HAL_SetConfigStructure(cy_ble_controllerConfigPtr);
apiResult = CY_BLE_SUCCESS;
}
return(apiResult);
}
/******************************************************************************
* Function Name: Cy_BLE_EnableController
***************************************************************************//**
*
* This function enables the BLE Stack controller.
*
* This function must used only in BLE dual CPU mode and called on CPU core,
* where BLE controller is running.
*
* \return
* \ref cy_en_ble_api_result_t : Return value indicates whether the function succeeded
* or failed. The following are possible error codes.
*
* <table>
* <tr>
* <th>Error codes</th>
* <th>Description</th>
* </tr>
* <tr>
* <td>CY_BLE_SUCCESS</td>
* <td>On successful operation.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_REPEATED_ATTEMPTS</td>
* <td>On invoking this function more than once without calling
* Cy_BLE_Disable() function between calls to this function.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED</td>
* <td>There is insufficient memory available.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_INVALID_STATE</td>
* <td>The PSoC 6 BLE Middleware was not initialized</td>
* </tr>
* </table>
*
******************************************************************************/
cy_en_ble_api_result_t Cy_BLE_EnableController(void)
{
cy_en_ble_api_result_t apiResult = CY_BLE_ERROR_INVALID_STATE;
#if defined(COMPONENT_BLESS_CONTROLLER_IPC)
if (cy_ble_controllerConfigPtr != NULL)
{
cy_stc_ble_stack_init_info_t stackInitParam;
(void) memset(&stackInitParam, 0, sizeof(cy_stc_ble_stack_init_info_t));
/* BLE Stack memory heap size */
stackInitParam.memParam.totalHeapSz =
cy_ble_controllerConfigPtr->stackParam->controllerTotalHeapSz;
/* Configure DLE */
stackInitParam.stackConfig.dleConfig.dleMaxTxCapability =
cy_ble_controllerConfigPtr->stackParam->dleMaxTxCapability;
stackInitParam.stackConfig.dleConfig.dleMaxRxCapability =
cy_ble_controllerConfigPtr->stackParam->dleMaxRxCapability;
stackInitParam.stackConfig.dleConfig.dleNumTxBuffer = CY_BLE_LL_DEFAULT_NUM_ACL_TX_PACKETS;
stackInitParam.stackConfig.dleConfig.dleNumRxBuffer = CY_BLE_LL_DEFAULT_NUM_ACL_RX_PACKETS;
/* Configure BLE Stack features */
stackInitParam.stackConfig.featureMask =
cy_ble_controllerConfigPtr->stackParam->featureMask;
/* Configure maximum connection support */
stackInitParam.stackConfig.maxBleConnections =
cy_ble_controllerConfigPtr->stackParam->maxConnCount;
/* Configure bonded device list */
stackInitParam.stackConfig.bondListConfig.bondListSize =
cy_ble_controllerConfigPtr->stackParam->maxBondedDevListSize;
/* Configure white list */
stackInitParam.stackConfig.whiteListConfig.whiteListSize =
cy_ble_controllerConfigPtr->stackParam->maxWhiteListSize;
/* Configure LL Privacy */
stackInitParam.stackConfig.privacyConfig.resolvingListSize =
cy_ble_controllerConfigPtr->stackParam->maxResolvableDevListSize;
/* Configure BLE features */
/* Enable DLE code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_DLE_FEATURE_MASK) != 0u)
{
Cy_BLE_EnableDleFeature();
}
/* Enable LL Privacy code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_PRIVACY_1_2_FEATURE_MASK) != 0u)
{
Cy_BLE_EnablePrivacyFeature();
}
/* Enable PHY Update code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_PHY_UPDATE_FEATURE_MASK) != 0u)
{
Cy_BLE_EnablePhyUpdateFeature();
}
apiResult = Cy_BLE_StackSetFeatureConfig(&stackInitParam.stackConfig);
if(apiResult == CY_BLE_SUCCESS)
{
/* Set pointer to memory RAM buffer */
stackInitParam.memParam.memoryHeapPtr = cy_ble_controllerConfigPtr->stackParam->controllerMemoryHeapPtr;
/* Configure parameter for Radio PA calibration */
if(cy_ble_controllerConfigPtr->stackParam->paCalConfig != NULL)
{
stackInitParam.stackConfig.paCalConfig = *cy_ble_controllerConfigPtr->stackParam->paCalConfig;
}
/* Initialize the BLE Stack */
apiResult = Cy_BLE_StackInit(&stackInitParam);
}
}
#endif /* defined(COMPONENT_BLESS_CONTROLLER_IPC) */
return(apiResult);
}
/******************************************************************************
* Function Name: Cy_BLE_EnableHCIModeController
***************************************************************************//**
*
* This function enables the BLE Stack controller in HCI only mode.
*
* This function must used only in HCI mode and called on CPU core,
* where BLE controller is running.
*
* \return
* \ref cy_en_ble_api_result_t : Return value indicates whether the function succeeded
* or failed. The following are possible error codes.
*
* <table>
* <tr>
* <th>Error codes</th>
* <th>Description</th>
* </tr>
* <tr>
* <td>CY_BLE_SUCCESS</td>
* <td>On successful operation.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_REPEATED_ATTEMPTS</td>
* <td>On invoking this function more than once without calling
* Cy_BLE_Disable() function between calls to this function.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED</td>
* <td>There is insufficient memory available.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_INVALID_STATE</td>
* <td>The PSoC 6 BLE Middleware was not initialized</td>
* </tr>
* </table>
*
******************************************************************************/
cy_en_ble_api_result_t Cy_BLE_EnableHCIModeController(void)
{
cy_en_ble_api_result_t apiResult = CY_BLE_ERROR_INVALID_STATE;
#if defined(COMPONENT_BLESS_CONTROLLER)
if (cy_ble_controllerConfigPtr != NULL)
{
cy_stc_ble_stack_init_info_t stackInitParam;
(void) memset(&stackInitParam, 0, sizeof(cy_stc_ble_stack_init_info_t));
/* BLE Stack memory heap size */
stackInitParam.memParam.totalHeapSz =
cy_ble_controllerConfigPtr->stackParam->totalHeapSz;
/* Configure DLE */
stackInitParam.stackConfig.dleConfig.dleMaxTxCapability =
cy_ble_controllerConfigPtr->stackParam->dleMaxTxCapability;
stackInitParam.stackConfig.dleConfig.dleMaxRxCapability =
cy_ble_controllerConfigPtr->stackParam->dleMaxRxCapability;
stackInitParam.stackConfig.dleConfig.dleNumTxBuffer = CY_BLE_LL_DEFAULT_NUM_ACL_TX_PACKETS;
stackInitParam.stackConfig.dleConfig.dleNumRxBuffer = CY_BLE_LL_DEFAULT_NUM_ACL_RX_PACKETS;
/* Configure BLE Stack features */
stackInitParam.stackConfig.featureMask =
cy_ble_controllerConfigPtr->stackParam->featureMask;
/* Configure maximum connection support */
stackInitParam.stackConfig.maxBleConnections =
cy_ble_controllerConfigPtr->stackParam->maxConnCount;
/* Configure bonded device list */
stackInitParam.stackConfig.bondListConfig.bondListSize =
cy_ble_controllerConfigPtr->stackParam->maxBondedDevListSize;
/* Configure white list */
stackInitParam.stackConfig.whiteListConfig.whiteListSize =
cy_ble_controllerConfigPtr->stackParam->maxWhiteListSize;
/* Configure LL Privacy */
stackInitParam.stackConfig.privacyConfig.resolvingListSize =
cy_ble_controllerConfigPtr->stackParam->maxResolvableDevListSize;
/* Configure BLE features */
/* Enable DLE code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_DLE_FEATURE_MASK) != 0u)
{
Cy_BLE_ControllerEnableDleFeature();
}
/* Enable LL Privacy code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_PRIVACY_1_2_FEATURE_MASK) != 0u)
{
Cy_BLE_ControllerEnablePrivacyFeature();
}
/* Enable PHY Update code in the stack */
if((cy_ble_controllerConfigPtr->stackParam->featureMask & CY_BLE_PHY_UPDATE_FEATURE_MASK) != 0u)
{
Cy_BLE_ControllerEnablePhyUpdateFeature();
}
apiResult = Cy_BLE_ControllerStackSetFeatureConfig(&stackInitParam.stackConfig);
/* Application Callback Function */
stackInitParam.CyBleAppCbFunc = (cy_ble_app_ev_cb_t)&Cy_BLE_EventHandlerWrapper;
if(apiResult == CY_BLE_SUCCESS)
{
/* Set pointer to memory RAM buffer */
stackInitParam.memParam.memoryHeapPtr = cy_ble_controllerConfigPtr->stackParam->memoryHeapPtr;
/* Configure parameter for Radio PA calibration */
if(cy_ble_controllerConfigPtr->stackParam->paCalConfig != NULL)
{
stackInitParam.stackConfig.paCalConfig = *cy_ble_controllerConfigPtr->stackParam->paCalConfig;
}
/* Initialize the BLE Stack */
apiResult = Cy_BLE_ControllerStackInit(&stackInitParam);
}
}
#endif /* defined(COMPONENT_BLESS_CONTROLLER) */
return(apiResult);
}
/******************************************************************************
* Function Name: Cy_BLE_EnableControllerFromHost
***************************************************************************//**
*
* This function sends an IPC message to enable the BLE Stack controller and
* waits until the controller starts.
*
* \return
* \ref cy_en_ble_api_result_t : Return value indicates whether the function succeeded
* or failed. The following are possible error codes.
*
* <table>
* <tr>
* <th>Error codes</th>
* <th>Description</th>
* </tr>
* <tr>
* <td>CY_BLE_SUCCESS</td>
* <td>On successful operation.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_REPEATED_ATTEMPTS</td>
* <td>On invoking this function more than once without calling
* Cy_BLE_Disable() function between calls to this function.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED</td>
* <td>There is insufficient memory available.</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_INVALID_STATE</td>
* <td>The PSoC 6 BLE Middleware was not initialized</td>
* </tr>
* <tr>
* <td>CY_BLE_ERROR_INVALID_OPERATION</td>
* <td>The timeout to enable the BLE controller (a problem with the IPC
* communication, or other BLE controller's CPU core problem)</td>
* </tr>
* </table>
******************************************************************************/
cy_en_ble_api_result_t Cy_BLE_EnableControllerFromHost(void)
{
/** IPC mesage structure for enable controller */
static volatile cy_stc_ble_ipc_msg_t controllerMsg =
{
/* clientID */ CY_BLE_CYPIPE_MSG_CMD_ID,
/* pktType */ CY_BLE_CYPIPE_ENABLE_CONTR_CMD,
/* intrRelMask */ 0x00u,
/* controllerStarted */ false,
/* data */ 0x00u,
/* dataLen */ 0x00u
};
cy_en_ipc_pipe_status_t ipcStatus;
uint32_t rTimeout = CY_BLE_SEND_IPC_MESSAGE_TIMEOUT;
/* Check if controller is started */
if ( !controllerMsg.controllerStarted )
{
/* Store pointer to stack param structure */
controllerMsg.data = (uint32_t) cy_ble_configPtr->stackParam;
/* Send the address of the intrNotify structure to the controller core via CyPipe
* The IPC Pipe can be busy. If so, try sending a message again. */
do
{
ipcStatus = Cy_IPC_Pipe_SendMessage(CY_BLE_IPC_CONTROLLER_ADDR, CY_BLE_IPC_HOST_ADDR,
(void *)&controllerMsg, NULL);
Cy_SysLib_DelayUs(1u);
rTimeout--;
}while((ipcStatus != CY_IPC_PIPE_SUCCESS) && (rTimeout != 0u));
/* Wait until controller starts */
rTimeout = CY_BLE_WAIT_CONTR_START_TIMEOUT;
do
{
Cy_SysLib_Delay(1u);
rTimeout--;
} while ((!controllerMsg.controllerStarted) && (rTimeout != 0u));
}
return ((rTimeout == 0u) ? CY_BLE_ERROR_INVALID_OPERATION :
(cy_en_ble_api_result_t) controllerMsg.data);
}
/*******************************************************************************
* BLE LPM (low power mode)
*******************************************************************************/
/******************************************************************************
* Function Name: Cy_BLE_EnableControllerLowPowerMode
***************************************************************************//**
*
* This function enables BLE low power mode for Controller
*
* Register BLE callback for deep sleep / sleep
*
* This function must used only in BLE dual CPU mode and called on CPU core,
* where BLE controller is running.
*
******************************************************************************/
void Cy_BLE_EnableControllerLowPowerMode(void)
{
/* Structure with the SysPm callback parameters for BLESS deep sleep */
static cy_stc_syspm_callback_params_t bleDeepSleepCallbackParams =
{
/* base */ NULL,
/* context */ NULL
};
static cy_stc_syspm_callback_t bleDeepSleepCallback =
{
/* callback */ &Cy_BLE_ControllerDeepSleepCallback,
/* type */ CY_SYSPM_DEEPSLEEP,
/* skipMode */ CY_SYSPM_SKIP_BEFORE_TRANSITION | CY_SYSPM_SKIP_CHECK_FAIL,
/* callbackParams */ &bleDeepSleepCallbackParams,
/* prevItm */ NULL,
/* nextItm */ NULL,
/* order */ CY_BLE_LPM_SYSPM_CB_ORDER
};
/* Register BLE callback for BLESS deep sleep support */
(void)Cy_SysPm_RegisterCallback(&bleDeepSleepCallback);
}
/*******************************************************************************
* Function Name: Cy_BLE_ControllerDeepSleepCallback
****************************************************************************//**
*
* This function requests the BLE Stack to put Bluetooth Low Energy Sub-System
* (BLESS) to deep sleep mode.
*
* It is registered to the system power mode by Cy_SysPm_RegisterCallback()
* function with CY_SYSPM_DEEPSLEEP type. After registration it is called by
* Cy_SysPm_DeepSleep() function prior entering the core into the CPU deep sleep
* power mode.
*
* When it is called with the enMode parameter set to CY_SYSPM_CHECK_READY,
* function enters BLESS to CY_BLE_BLESS_DEEPSLEEP mode. It also checks the
* BLE Subsystem's current operational mode. When the
* Cy_BLE_StackGetBleSsState() function returns CY_BLE_BLESS_STATE_ECO_ON or
* CY_BLE_BLESS_STATE_DEEPSLEEP state, this function returns CY_SYSPM_PASS and
* allows to put the core into the deep-sleep power mode.
* At all other times, the function tries to enter core into sleep mode.
*
* This function is available only when BLE low power mode is enabled (called
* Cy_BLE_EnableLowPowerMode() function).
*
* \param
* callbackParams Pointer to the structure with the syspm callback parameters.
*
* \param
* mode The associated syspm callback mode. See description of the
* cy_en_syspm_callback_mode_t type.
*
* \return
* * CY_SYSPM_SUCCESS - Entered and exited from CPU deep sleep
* * CY_SYSPM_FAIL - CPU deep sleep not entered.
*
*******************************************************************************/
static cy_en_syspm_status_t Cy_BLE_ControllerDeepSleepCallback(cy_stc_syspm_callback_params_t *callbackParams,
cy_en_syspm_callback_mode_t mode)
{
cy_en_syspm_status_t retVal;
static uint32_t interruptState = 0u;
cy_en_ble_bless_state_t blessState;
/* Local variable to store the status of BLESS Hardware block */
cy_en_ble_lp_mode_t sleepMode;
/* Suppress unused variable warning */
(void) callbackParams;
switch(mode)
{
case (CY_SYSPM_CHECK_READY):
if(Cy_IPC_Sema_Status(CY_BLE_SEMA) == CY_IPC_SEMA_STATUS_LOCKED)
{
/* System do not enter deep sleep if BLE Host start write operation */
retVal = CY_SYSPM_FAIL;
}
else if (Cy_BLE_HAL_IsEcoCpuClockSrc() == 1u)
{
/* System never enters deep sleep if BLE ECO is CPU source */
retVal = CY_SYSPM_FAIL;
}
else
{
cy_en_ble_api_result_t retIsControllerActive;
/* Put BLESS into deep sleep and check the return status */
sleepMode = Cy_BLE_MappingStackEnterLPM(CY_BLE_BLESS_DEEPSLEEP);
/* Disable global interrupt to prevent changes from any other interrupt ISR */
interruptState = Cy_SysLib_EnterCriticalSection();
/* Check the Status of BLESS */
blessState = Cy_BLE_StackGetBleSsState();
if(blessState == CY_BLE_BLESS_STATE_STOPPED)
{
retVal = CY_SYSPM_SUCCESS;
}
else if(sleepMode == CY_BLE_BLESS_DEEPSLEEP)
{
retIsControllerActive = Cy_BLE_MappingIsControllerActive(CY_BLE_CONTROLLER_SLEEP_MODE_DEEPSLEEP);
if(((blessState == CY_BLE_BLESS_STATE_ECO_ON) || (blessState == CY_BLE_BLESS_STATE_DEEPSLEEP))
&& (retIsControllerActive == CY_BLE_SUCCESS))
{
/* Enter device deep sleep */
retVal = CY_SYSPM_SUCCESS;
}
else
{
/* The BLESS hardware block cannot go to deep sleep, try sleep mode */
retVal = CY_SYSPM_FAIL;
}
}
else
{
retIsControllerActive = Cy_BLE_MappingIsControllerActive(CY_BLE_CONTROLLER_SLEEP_MODE_SLEEP);
if((blessState != CY_BLE_BLESS_STATE_EVENT_CLOSE) && (retIsControllerActive == CY_BLE_SUCCESS))
{
/* If the BLESS hardware block cannot go to deep sleep and BLE event has not
* closed yet, then place CPU to sleep */
(void)Cy_SysPm_CpuEnterSleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
}
retVal = CY_SYSPM_FAIL;
}
if(retVal == CY_SYSPM_FAIL)
{
/* Enable interrupts after failing check */
Cy_SysLib_ExitCriticalSection(interruptState);
}
}
break;
/* Enable interrupts after wakeup */
case (CY_SYSPM_AFTER_TRANSITION):
Cy_SysLib_ExitCriticalSection(interruptState);
retVal = CY_SYSPM_SUCCESS;
break;
default:
retVal = CY_SYSPM_FAIL;
break;
}
return(retVal);
}
/*******************************************************************************
* Internal
*******************************************************************************/
/******************************************************************************
* Function Name: Cy_BLE_EventHandlerWrapper
***************************************************************************//**
*
* This event handler is used in HCI Soft mode, and dirrect calls registered by
* application Cy_BLE_ApplCallback callback.
*
******************************************************************************/
void Cy_BLE_EventHandlerWrapper(cy_en_ble_event_t event, void *evParam)
{
/* Call Cy_BLE_ApplCallback */
Cy_BLE_ApplCallback((uint32_t)event, evParam);
}
#endif /* CY_IP_MXBLESS */
/* [] END OF FILE */