Closed brtchip-gdm closed 8 months ago
This could also apply to the RTC interrupt_0 handler on FT90x Rev B.
We could also add functions to sys.c
to enable the RTC alarms, sleep and wake the system:
SYS->PMCFG_L
bit MASK_SYS_PMCFG_RTC_ALARM_IRQ_EN
SYS->PMCFG_L
bits MASK_SYS_PMCFG_PM_PWRDN
and MASK_SYS_PMCFG_PM_PWRDN_MODE
These are only used in the RTC Example 2 project.
Done.
The USBD source file can have a function which can be called from a power management (PM) interrupt service routine (ISR). The PM routine is usually called from an interrupt when one of the PM interrupts are pending. It is setup with a line like this:
Most applications that use the USB device will have the following code to handle the transitions of PM when the device is suspended, resumed, connected or disconnected.
Unless there is special handling of these conditions then the code can be added to the USBD API. A function is proposed which can be called from the PM ISR. It is proposed to call it
USBD_power_change(void)
or similar.The ISR would therefore look like this after the addition: