+int\r
+main (void)\r
+{\r
+ IRMP_DATA irmp_data;\r
+\r
+ irmp_init(); // initialize irmp\r
+ timer1_init(); // initialize timer1\r
+ sei (); // enable interrupts\r
+\r
+ for (;;)\r
+ {\r
+ if (irmp_get_data (&irmp_data))\r
+ {\r
+ // ir signal decoded, do something here...\r
+ // irmp_data.protocol is the protocol, see irmp.h\r
+ // irmp_data.address is the address/manufacturer code of ir sender\r
+ // irmp_data.command is the command code\r
+ // irmp_protocol_names[irmp_data.protocol] is the protocol name (if enabled, see irmpconfig.h)\r
+ }\r
+ }\r
+}\r
+\r
+/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ * LM4F120 Launchpad (ARM Cortex M4):\r
+ *---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ */\r
+#elif defined(STELLARIS_ARM_CORTEX_M4)\r
+\r
+void\r
+timer1_init (void)\r
+{\r
+ SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);\r
+ TimerConfigure(TIMER1_BASE, TIMER_CFG_32_BIT_PER);\r
+\r
+ TimerLoadSet(TIMER1_BASE, TIMER_A, (F_CPU / F_INTERRUPTS) -1);\r
+ IntEnable(INT_TIMER1A);\r
+ TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);\r
+ TimerEnable(TIMER1_BASE, TIMER_A);\r
+ // Important: Timer1IntHandler has to be configured in startup_ccs.c !\r
+}\r
+\r
+void\r
+Timer1IntHandler(void) // Timer1 Interrupt Handler\r
+{\r
+ (void) irmp_ISR(); // call irmp ISR\r
+ // call other timer interrupt routines...\r
+}\r