Getting Started With EZ-
BLE™ PRoC™ Module
www.cypress.com
Document No.: 001-96841 Rev. **
41
Figure 52. Main Loop Flowchart
Figure 53. Firmware Main Loop
Process BLE Events
Device
Connected
?
Y
BLE Idle
?
Go to deep sleep mode
-
Configure wakeup pin
-
Go to Hibernate
Y
-
Execute deep sleep
wakeup sequence
-
Sleep till ECO
stabilizes
N
N
Alert Level Updated
Y
N
Process the LED status
System
Nor
mal
O
pera
tio
n
System
Lo
w
Po
w
er O
pera
tio
n
for
(;;)
{
/* Single API call to service all the BLE stack events. Must be
* called at least once in a BLE connection interval */
CyBle_ProcessEvents();
if
(CYBLE_STATE_CONNECTED == CyBle_GetState())
{
static
uint8
blinkTimeout = BLINK_TIMEOUT;
/* Update Alert LED status */
switch
(alertLevel)
{
case
NO_ALERT:
Alert_LED_Write(LED_OFF);
break
;