changing circuitry to disable RTC, update initialization to match
[fw/openalt] / eints / eints.c
1 #include "FreeRTOS.h"
2 #include "task.h"
3 #include "queue.h"
4
5 #include "eints.h"
6 #include "eintsISR.h"
7
8 //
9 //
10 //
11 void eintsInit (void)
12 {
13   portENTER_CRITICAL ();
14
15   PCB_PINSEL1 |= PCB_PINSEL1_P016_EINT0;
16   PCB_PINSEL0 |= PCB_PINSEL0_P015_EINT2;
17
18   SCB_EXTPOLAR &= ~(SCB_EXTPOLAR_EINT0 | SCB_EXTPOLAR_EINT2);
19   SCB_EXTMODE  |=  (SCB_EXTMODE_EINT0  | SCB_EXTMODE_EINT2);
20   SCB_EXTINT   |=  (SCB_EXTINT_EINT0   | SCB_EXTINT_EINT2);
21
22   VIC_IntSelect &= ~(VIC_IntSelect_EINT0 | VIC_IntSelect_EINT2);
23   VIC_VectAddr4 = (portLONG) eintsISR_EINT0;
24   VIC_VectCntl4 = VIC_VectCntl_ENABLE | VIC_Channel_EINT0;
25   VIC_VectAddr5 = (portLONG) eintsISR_EINT2;
26   VIC_VectCntl5 = VIC_VectCntl_ENABLE | VIC_Channel_EINT2;
27   VIC_IntEnable = VIC_IntEnable_EINT0 | VIC_IntEnable_EINT2;
28
29   portEXIT_CRITICAL ();
30 }