57 lines
1.9 KiB
Diff
57 lines
1.9 KiB
Diff
--- keypad.c.orig 2025-07-01 12:00:00.000000000 +0000
|
|
+++ keypad.c 2025-07-01 12:05:00.000000000 +0000
|
|
@@ /* P1/P2 share PORT1_VECTOR */
|
|
#pragma vector=PORT1_VECTOR
|
|
__interrupt void PORT1_ISR(void)
|
|
{
|
|
uint16_t status = GPIO_getInterruptStatus(GPIO_PORT_P2, colPin[COL3]);
|
|
if (status & colPin[COL3]) {
|
|
- handleColumnInterrupt(COL3);
|
|
- GPIO_clearInterrupt(GPIO_PORT_P2, colPin[COL3]);
|
|
+ handleColumnInterrupt(COL3);
|
|
+ /* wake main out of LPM0 */
|
|
+ __bic_SR_register_on_exit(LPM0_bits);
|
|
+ GPIO_clearInterrupt(GPIO_PORT_P2, colPin[COL3]);
|
|
}
|
|
}
|
|
|
|
@@ /** P3/P4 share PORT3_VECTOR **/
|
|
-#pragma vector=PORT3_VECTOR
|
|
+/* P3/P4 share the *second* port vector on FR2 devices */
|
|
+#pragma vector=PORT2_VECTOR
|
|
__interrupt void PORT3_ISR(void)
|
|
{
|
|
uint16_t status = GPIO_getInterruptStatus(GPIO_PORT_P3, colPin[COL2]);
|
|
if (status & colPin[COL2]) {
|
|
- handleColumnInterrupt(COL2);
|
|
- GPIO_clearInterrupt(GPIO_PORT_P3, colPin[COL2]);
|
|
+ handleColumnInterrupt(COL2);
|
|
+ /* wake main out of LPM0 */
|
|
+ __bic_SR_register_on_exit(LPM0_bits);
|
|
+ GPIO_clearInterrupt(GPIO_PORT_P3, colPin[COL2]);
|
|
}
|
|
}
|
|
|
|
@@ /** P5/P6 share PORT5_VECTOR **/
|
|
-#pragma vector=PORT5_VECTOR
|
|
+/* P5/P6 share the *third* port vector on FR2 devices */
|
|
+#pragma vector=PORT3_VECTOR
|
|
__interrupt void PORT5_ISR(void)
|
|
{
|
|
uint16_t mask = colPin[COL0] | colPin[COL1];
|
|
uint16_t status = GPIO_getInterruptStatus(GPIO_PORT_P6, mask);
|
|
if (status & colPin[COL0]) {
|
|
- handleColumnInterrupt(COL0);
|
|
+ handleColumnInterrupt(COL0);
|
|
+ /* wake main out of LPM0 */
|
|
+ __bic_SR_register_on_exit(LPM0_bits);
|
|
}
|
|
if (status & colPin[COL1]) {
|
|
- handleColumnInterrupt(COL1);
|
|
+ handleColumnInterrupt(COL1);
|
|
+ /* wake main out of LPM0 */
|
|
+ __bic_SR_register_on_exit(LPM0_bits);
|
|
}
|
|
GPIO_clearInterrupt(GPIO_PORT_P6, mask);
|
|
}
|