@@ -93,12 +93,14 @@ void CyH4TransportDriver::initialize()
93
93
);
94
94
95
95
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
96
- // Register IRQ for Host WAKE
97
- host_wake_pin = new InterruptIn (bt_host_wake_name);
98
- if (host_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
99
- host_wake_pin->fall (callback (this , &CyH4TransportDriver::bt_host_wake_irq_handler));
100
- } else {
101
- host_wake_pin->rise (callback (this , &CyH4TransportDriver::bt_host_wake_irq_handler));
96
+ if (bt_host_wake_name != NC) {
97
+ // Register IRQ for Host WAKE
98
+ host_wake_pin = new InterruptIn (bt_host_wake_name);
99
+ if (host_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
100
+ host_wake_pin->fall (callback (this , &CyH4TransportDriver::bt_host_wake_irq_handler));
101
+ } else {
102
+ host_wake_pin->rise (callback (this , &CyH4TransportDriver::bt_host_wake_irq_handler));
103
+ }
102
104
}
103
105
104
106
#endif
@@ -137,7 +139,9 @@ uint16_t CyH4TransportDriver::write(uint8_t type, uint16_t len, uint8_t *pData)
137
139
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
138
140
void CyH4TransportDriver::on_host_stack_inactivity ()
139
141
{
140
- uart.attach (NULL , SerialBase::RxIrq);
142
+ if (enabled_powersave) {
143
+ uart.attach (NULL , SerialBase::RxIrq);
144
+ }
141
145
}
142
146
#endif
143
147
@@ -158,27 +162,32 @@ void CyH4TransportDriver::on_controller_irq()
158
162
void CyH4TransportDriver::assert_bt_dev_wake ()
159
163
{
160
164
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
161
- if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
162
- bt_device_wake = WAKE_EVENT_ACTIVE_LOW;
163
- } else {
164
- bt_device_wake = WAKE_EVENT_ACTIVE_HIGH;
165
+ if (enabled_powersave) {
166
+ if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
167
+ bt_device_wake = WAKE_EVENT_ACTIVE_LOW;
168
+ } else {
169
+ bt_device_wake = WAKE_EVENT_ACTIVE_HIGH;
170
+ }
165
171
}
166
172
#endif
167
173
}
168
174
169
175
void CyH4TransportDriver::deassert_bt_dev_wake ()
170
176
{
171
177
#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
172
- wait_us (5000 ); /* remove and replace when uart tx transmit complete api is available */
173
- // De-assert bt_device_wake
174
- if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
175
- bt_device_wake = WAKE_EVENT_ACTIVE_HIGH;
176
- } else {
177
- bt_device_wake = WAKE_EVENT_ACTIVE_LOW;
178
+ if (enabled_powersave) {
179
+ wait_us (5000 ); /* remove and replace when uart tx transmit complete api is available */
180
+ // De-assert bt_device_wake
181
+ if (dev_wake_irq_event == WAKE_EVENT_ACTIVE_LOW) {
182
+ bt_device_wake = WAKE_EVENT_ACTIVE_HIGH;
183
+ } else {
184
+ bt_device_wake = WAKE_EVENT_ACTIVE_LOW;
185
+ }
178
186
}
179
187
#endif
180
188
}
181
189
190
+
182
191
void CyH4TransportDriver::update_uart_baud_rate (int baud)
183
192
{
184
193
uart.baud (baud);
0 commit comments