Redefining an Interrupt Handler | Cypress Semiconductor
Redefining an Interrupt Handler
I am looking for help with redefining a PSoC 4 interrupt handler that is generated automatically by PSoC Creator. Specifically, I would like to redefine the auto-generated interrupt handler for the UART wakeup from Deep Sleep. The code for this interrupt is below.
/* Clear interrupt source: the event becomes multi triggered and is
* only disabled by UART_1_UartRestoreConfig() call.
#endif /* (UART_1_MOSI_SCL_RX_WAKE_PIN) */
#endif /* (UART_1_UART_RX_WAKE_PIN) */
#endif /* (UART_1_SCB_MODE_UNCONFIG_CONST_CFG) */
The main part of what I want to do is to get the returned uint8 value back from UART_1_rx_wake_ClearInterrupt(). It returns a "1" if the UART was what woke the chip up, and a "0" otherwise. Additionally, I would like to include a header at the top of the file, so that I have access to an external variable to store the value. In summary, I would like the code to look like this:
#include "sleep.h" // My own custom file
WakeSourceIsUart = UART_1_rx_wake_ClearInterrupt(); // Store the value for my own use
Currently, if I include this code, the compiler removes it when I clean and build. I would like to keep it in this file every time I compile, or, alternately, I would like to write an entirely new interrupt handler function.
I am programming on a CYBLE-022001-00 chip, using PSoC Creator 3.2. Any help would be appreciated!