GIE = 1; /* enable global interrupts */
}
+void btn_pben()
+{
+ ndi();
+ IOCBP0 = 1; IOCBN0 = 1; IOCBF0 = 0;
+ nei();
+}
+
+/* Disable the pushbutton from user code */
+void btn_pbdis()
+{
+ ndi();
+ IOCBP0 = 0; IOCBN0 = 0; IOCBF0 = 0;
+ nei();
+}
+
+/* Enable the rocker switch from user code */
+void btn_rsen()
+{
+ ndi();
+ IOCBP4 = 1; IOCBN4 = 1; IOCBF4 = 0;
+ IOCBP5 = 1; IOCBN5 = 1; IOCBF5 = 0;
+ nei();
+}
+
+/* Disable the rocker switch from user code */
+void btn_rsdis()
+{
+ ndi();
+ IOCBP4 = 0; IOCBN4 = 0; IOCBF4 = 0;
+ IOCBP5 = 0; IOCBN5 = 0; IOCBF5 = 0;
+ nei();
+}
+
void btn_isr()
{
if (IOCIF) {
if (IOCBF0) {
- _btn_pbdis();
- tmr_start(TMR_BTN_PB, 1);
+ btn_pbdis();
+ tmr_start(TMR_BTN_PB, 2);
}
if (IOCBF4) {
- _btn_rsdis();
- tmr_start(TMR_BTN_RS, 1);
+ btn_rsdis();
+ tmr_start(TMR_BTN_RS, 2);
}
if (IOCBF5) {
- _btn_rsdis();
- tmr_start(TMR_BTN_RS, 1);
+ btn_rsdis();
+ tmr_start(TMR_BTN_RS, 2);
}
}
if (tmr_fired(TMR_BTN_PB))
- _task_post(TASK_BTN_PB);
+ task_post(TASK_BTN_PB);
if (tmr_fired(TMR_BTN_RS))
- _task_post(TASK_BTN_RS);
+ task_post(TASK_BTN_RS);
}