]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmp.c
Version 2.3.3: port to Stellaris ARM Cortex M4
[irmp.git] / irmp.c
diff --git a/irmp.c b/irmp.c
index ab3d59f7c0626ce90abc79b434f784545eeb4343..c8bc29f0acce60f7a951c36d44a5056a6e86b970 100644 (file)
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
  *\r
  * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.c,v 1.130 2012/11/06 10:19:41 fm Exp $\r
+ * $Id: irmp.c,v 1.131 2012/11/18 17:51:26 fm Exp $\r
  *\r
  * ATMEGA88 @ 8 MHz\r
  *\r
@@ -1292,6 +1292,15 @@ irmp_init (void)
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;\r
  #endif\r
    GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
+#elif defined(STELLARIS_ARM_CORTEX_M4)\r
+     // Enable the GPIO port\r
+     ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH);\r
+\r
+     // Set as an input\r
+     ROM_GPIODirModeSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_DIR_MODE_IN);\r
+     ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN,\r
+                          GPIO_STRENGTH_2MA,\r
+                          GPIO_PIN_TYPE_STD_WPU);\r
 #else                                                                   // AVR\r
     IRMP_PORT &= ~(1<<IRMP_BIT);                                        // deactivate pullup\r
     IRMP_DDR &= ~(1<<IRMP_BIT);                                         // set pin to input\r
@@ -3235,6 +3244,12 @@ irmp_ISR (void)
             }\r
         }\r
     }\r
+\r
+#if defined(STELLARIS_ARM_CORTEX_M4)\r
+    // Clear the timer interrupt\r
+    TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);\r
+#endif\r
+\r
     return (irmp_ir_detected);\r
 }\r
 \r