Skip to content

Commit ea5dcca

Browse files
committed
FUTURE_SEQUANA deep sleep fixes:
- fixed feature rename (from DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER) in all missed places - disabled power manager callback for serial driver
1 parent 172abab commit ea5dcca

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int i2c_convert_status(cy_en_scb_i2c_status_t status)
264264
/*
265265
* Callback function to handle into and out of deep sleep state transitions.
266266
*/
267-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
267+
#if DEVICE_SLEEP && DEVICE_LPTICKER
268268
static cy_en_syspm_status_t i2c_pm_callback(cy_stc_syspm_callback_params_t *callback_params)
269269
{
270270
cy_stc_syspm_callback_params_t params = *callback_params;
@@ -273,7 +273,7 @@ static cy_en_syspm_status_t i2c_pm_callback(cy_stc_syspm_callback_params_t *call
273273

274274
return Cy_SCB_I2C_DeepSleepCallback(&params);
275275
}
276-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
276+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
277277

278278

279279
void i2c_init(i2c_t *obj_in, PinName sda, PinName scl)
@@ -300,7 +300,7 @@ void i2c_init(i2c_t *obj_in, PinName sda, PinName scl)
300300
i2c_init_clock(obj, I2C_DEFAULT_SPEED);
301301
i2c_init_pins(obj);
302302
i2c_init_peripheral(obj);
303-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
303+
#if DEVICE_SLEEP && DEVICE_LPTICKER
304304
obj->pm_callback_handler.callback = i2c_pm_callback;
305305
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
306306
obj->pm_callback_handler.skipMode = 0;
@@ -310,7 +310,7 @@ void i2c_init(i2c_t *obj_in, PinName sda, PinName scl)
310310
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
311311
error("PM callback registration failed!");
312312
}
313-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
313+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
314314
} else {
315315
error("I2C pinout mismatch. Requested pins Rx and Tx can't be used for the same I2C communication.");
316316
}

targets/TARGET_Cypress/TARGET_PSOC6/objects.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct serial_s {
8686
bool tx_pending;
8787
cy_israddress async_handler;
8888
#endif // DEVICE_SERIAL_ASYNCH
89-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
89+
#if DEVICE_SLEEP && DEVICE_LPTICKER
9090
cy_stc_syspm_callback_params_t pm_callback_params;
9191
cy_stc_syspm_callback_t pm_callback_handler;
9292
#endif
@@ -124,7 +124,7 @@ struct spi_s {
124124
void *tx_buffer;
125125
uint32_t tx_buffer_size;
126126
#endif // DEVICE_SPI_ASYNCH
127-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
127+
#if DEVICE_SLEEP && DEVICE_LPTICKER
128128
cy_stc_syspm_callback_params_t pm_callback_params;
129129
cy_stc_syspm_callback_t pm_callback_handler;
130130
#endif
@@ -160,7 +160,7 @@ struct i2c_s {
160160
uint16_t events;
161161
uint32_t handler;
162162
#endif // DEVICE_I2C_ASYNCH
163-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
163+
#if DEVICE_SLEEP && DEVICE_LPTICKER
164164
cy_stc_syspm_callback_params_t pm_callback_params;
165165
cy_stc_syspm_callback_t pm_callback_handler;
166166
#endif
@@ -178,7 +178,7 @@ struct pwmout_s {
178178
uint32_t period;
179179
uint32_t pulse_width;
180180
uint32_t prescaler;
181-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
181+
#if DEVICE_SLEEP && DEVICE_LPTICKER
182182
cy_stc_syspm_callback_params_t pm_callback_params;
183183
cy_stc_syspm_callback_t pm_callback_handler;
184184
#endif

targets/TARGET_Cypress/TARGET_PSOC6/pwmout_api.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void pwm_start(pwmout_t *obj, uint32_t new_period, uint32_t new_pulse_wid
120120
/*
121121
* Callback handler to restart the timer after deep sleep.
122122
*/
123-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
123+
#if DEVICE_SLEEP && DEVICE_LPTICKER
124124
static cy_en_syspm_status_t pwm_pm_callback(cy_stc_syspm_callback_params_t *callback_params)
125125
{
126126
pwmout_t *obj = (pwmout_t *)callback_params->context;
@@ -145,7 +145,7 @@ static cy_en_syspm_status_t pwm_pm_callback(cy_stc_syspm_callback_params_t *call
145145

146146
return CY_SYSPM_SUCCESS;
147147
}
148-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
148+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
149149

150150

151151
void pwmout_init(pwmout_t *obj, PinName pin)
@@ -198,17 +198,17 @@ void pwmout_init(pwmout_t *obj, PinName pin)
198198
obj->period = 0;
199199
obj->pulse_width = 0;
200200
obj->prescaler = 0;
201-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
201+
#if DEVICE_SLEEP && DEVICE_LPTICKER
202202
obj->pm_callback_handler.callback = pwm_pm_callback;
203203
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
204-
obj->pm_callback_handler.skipMode = CY_SYSPM_SKIP_CHECK_READY | CY_SYSPM_SKIP_CHECK_FAIL;
204+
obj->pm_callback_handler.skipMode = 0;
205205
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
206206
obj->pm_callback_params.base = obj->base;
207207
obj->pm_callback_params.context = obj;
208208
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
209209
error("PM callback registration failed!");
210210
}
211-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
211+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
212212

213213
} else {
214214
error("PWM OUT pinout mismatch.");

targets/TARGET_Cypress/TARGET_PSOC6/serial_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static void serial_init_peripheral(serial_obj_t *obj)
345345
Cy_SCB_UART_Enable(obj->base);
346346
}
347347

348-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
348+
#if DEVICE_SLEEP && DEVICE_LPTICKER && SERIAL_PM_CALLBACK_ENABLED
349349
static cy_en_syspm_status_t serial_pm_callback(cy_stc_syspm_callback_params_t *params)
350350
{
351351
serial_obj_t *obj = (serial_obj_t *)params->context;
@@ -393,7 +393,7 @@ static cy_en_syspm_status_t serial_pm_callback(cy_stc_syspm_callback_params_t *p
393393
}
394394
return status;
395395
}
396-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
396+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
397397

398398
void serial_init(serial_t *obj_in, PinName tx, PinName rx)
399399
{
@@ -425,7 +425,7 @@ void serial_init(serial_t *obj_in, PinName tx, PinName rx)
425425
//Cy_GPIO_Write(Cy_GPIO_PortToAddr(CY_PORT(P13_6)), CY_PIN(P13_6), 1);
426426
serial_init_pins(obj);
427427
//Cy_GPIO_Write(Cy_GPIO_PortToAddr(CY_PORT(P13_6)), CY_PIN(P13_6), 0);
428-
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
428+
#if DEVICE_SLEEP && DEVICE_LPTICKER && SERIAL_PM_CALLBACK_ENABLED
429429
obj->pm_callback_handler.callback = serial_pm_callback;
430430
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
431431
obj->pm_callback_handler.skipMode = 0;
@@ -435,7 +435,7 @@ void serial_init(serial_t *obj_in, PinName tx, PinName rx)
435435
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
436436
error("PM callback registration failed!");
437437
}
438-
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
438+
#endif // DEVICE_SLEEP && DEVICE_LPTICKER
439439
if (is_stdio) {
440440
memcpy(&stdio_uart, obj_in, sizeof(serial_t));
441441
stdio_uart_inited = true;

0 commit comments

Comments
 (0)