English
Language : 

AN91184 Datasheet, PDF (21/36 Pages) Ramtron International Corporation – Designing BLE Applications
PSoC® 4 BLE – Designing BLE Applications
4.2 Configure the Firmware
Figure 25 shows the firmware flow for the Health Thermometer application.
Figure 25. System Flowchart
Application Firmware Flow
Reset or Wakeup from
Hibernate
- Initialize ADC
- Provide Thermistor
reference
- Initialize BLE
- Register Generic
Event Handler
BLE Event Handler
BLE-Init
Success?
N
Error Handling
Y
Register Health
Thermometer Event
Handler
- Configure wakeup pin
- Go to Hibernate
Process Events
Device
Connected?
Y
N
WDT event?
N
N
Y
Measurement
Interval expired?
Y
Measure Temperature
Stack ON?
Y
Start Advertising
N
Device
Connected?
N
Device
Disconnected?
N
Advertising
Timeout?
Retrieve Connection
Y Handle
Initialize WDT
Y
- Configure wakeup pin
- Go to Hibernate
Y
- Configure wakeup pin
- Go to Hibernate
N
Return from Generic
event handler
N
Indication
Enabled?
Y
Send Indication
BLESS =
Initializing?
N
Put BLESS in Deep
Sleep mode
Get BLESS state
Y
Rx/Tx
Complete?
N
BLESS in
Deep Sleep
Y
N
Put System in Sleep
mode
Y
BLESS =
Deep Sleep or
N
ECO_ON
Y
Put System in Deep
Sleep mode
Indication
Enabled?
Y
N
Indication
Disabled?
Y
N
Measurement
Interval Write?
Y
N
Return from Generic
event handler
Start Indication
Disable Indication
Update Measurement
Interval
www.cypress.com
Document No. 001-91184 Rev. *B
21