Index: firmware/App/Drivers/CPLD.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r1095b811053729187a2c7535251c4a33c5d22ab5 --- firmware/App/Drivers/CPLD.c (.../CPLD.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Drivers/CPLD.c (.../CPLD.c) (revision 1095b811053729187a2c7535251c4a33c5d22ab5) @@ -62,6 +62,30 @@ #define CLR_GREEN() {mibspiREG5->PC3 &= ~GREEN_SPI5_PORT_MASK;} ///< Macro to set green alarm lamp signal state low. #define CLR_BLUE() {mibspiREG5->PC3 &= ~BLUE_SPI5_PORT_MASK;} ///< Macro to set blue alarm lamp signal state low. #define CLR_RED() {mibspiREG5->PC3 &= ~RED_SPI5_PORT_MASK;} ///< Macro to set red alarm lamp signal state low. + +#ifdef RM46_EVAL_BOARD_TARGET + // for RM46 eval board, user button B uses the MIBSPI1_nCS[4] pin, so need to re-purpose that pin as GPIO to see the button + #define USER_BUTTON_MASK 0x00000010 // (nCS[4] + #define GET_USER_BUTTON() (PIN_SIGNAL_STATE_T)(((mibspiREG1->PC2 & USER_BUTTON_MASK) == 0 ? PIN_SIGNAL_LOW : PIN_SIGNAL_HIGH)) + PIN_SIGNAL_STATE_T getUserButtonState( void ) + { + PIN_SIGNAL_STATE_T result = GET_USER_BUTTON(); + + return result; + } + // for RM46 eval board, user LED A uses the same GPIO pin that CPLD uses for watchdog pet. Had to disable watchdog pet to use as LED. + void setUserLED( BOOL on ) + { + if ( on == TRUE ) + { + SET_WD_PET(); + } + else + { + CLR_WD_PET(); + } + } +#endif /*********************************************************************//** * @brief