]> cloudbase.mooo.com Git - irmp.git/commitdiff
Rename ARM_OPENCM3 -> LIBOPENCM3, redefine IRMP_BIT as bitmask
authorLeo C <erbl259-lmu@yahoo.de>
Sun, 30 Apr 2017 10:42:38 +0000 (12:42 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Sun, 30 Apr 2017 10:42:38 +0000 (12:42 +0200)
irmp.c
irmp.h
irmpconfig.h
irmpsystem.h

diff --git a/irmp.c b/irmp.c
index f95410b195ec99f9a2c2d73e6f9e54203cb77889..c37449cd8564a9e93d52083e5c24888fc29876d8 100644 (file)
--- a/irmp.c
+++ b/irmp.c
@@ -2189,14 +2189,12 @@ irmp_init (void)
 #  endif\r
     GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
 \r
-#elif defined (ARM_OPENCM3)                                             // STM32 with libopencm3\r
+#elif defined (LIBOPENCM3)                                             // STM32 with libopencm3\r
 \r
     /* GPIOx clock enable */\r
     rcc_periph_clock_enable(IRMP_PORT_RCC);\r
-\r
     /* GPIO Configuration */\r
-        gpio_set_mode(IRMP_PORT, GPIO_MODE_INPUT,\r
-         GPIO_CNF_INPUT_FLOAT, 1<<IRMP_BIT);\r
+    gpio_set_mode(IRMP_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, IRMP_BIT);\r
 \r
 #elif defined(STELLARIS_ARM_CORTEX_M4)\r
     // Enable the GPIO port\r
diff --git a/irmp.h b/irmp.h
index 3efc62cb8a33b36fa2ee7de249d035b3ac42602b..c0b3c18cc1c23e22b4fac7ba49f9b203ef465169 100644 (file)
--- a/irmp.h
+++ b/irmp.h
 #    warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.\r
 #  endif\r
 \r
-#elif defined (ARM_OPENCM3)\r
+#elif defined (LIBOPENCM3)\r
 #  define _CONCAT(a,b)                          a##b\r
 #  define CONCAT(a,b)                           _CONCAT(a,b)\r
 #  define IRMP_PORT                             CONCAT(GPIO, IRMP_PORT_LETTER)\r
-#  define IRMP_PORT_RCC                        CONCAT(RCC_GPIO, IRMP_PORT_LETTER)\r
+#  define IRMP_PORT_RCC                         CONCAT(RCC_GPIO, IRMP_PORT_LETTER)\r
 \r
-#  define IRMP_BIT                              IRMP_BIT_NUMBER\r
+#  define IRMP_BIT                              CONCAT(GPIO, IRMP_BIT_NUMBER)\r
 #  define IRMP_PIN                              IRMP_PORT   // for use with input(x) below\r
-#  define input(x)                              ((GPIO_IDR(IRMP_PORT) & (1<<IRMP_BIT)) != 0)\r
-//#  define input(x)                              (BBIO_PERIPH(IRMP_PORT+IDR, IRMP_BIT))\r
-#  define IRMP_TIMER                            CONCAT(TIM, IRMP_TIMER_NUMBER)\r
+#  define input(x)                              ((GPIO_IDR(x) & IRMP_BIT) != 0)\r
 \r
 #elif defined (STELLARIS_ARM_CORTEX_M4)\r
 #  define _CONCAT(a,b)                          a##b\r
index 67c3638f6dbc1d3a02de50f8380dfe0ae5496707..3767de7d399e2545addf8d90deb357fe66908a06 100644 (file)
  * Change hardware pin here for ARM STM32 with libopencm3\r
  *---------------------------------------------------------------------------------------------------------------------------------------------------\r
  */\r
-#elif defined (ARM_OPENCM3)                                             // use C13 as IR input on STM32\r
+#elif defined (LIBOPENCM3)\r
 #  define IRMP_PORT_LETTER                      B\r
 #  define IRMP_BIT_NUMBER                       4\r
-#  define IRMP_TIMER_NUMBER                     3                      // Timer to use\r
 \r
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * Change hardware pin here for Stellaris ARM Cortex M4\r
index 7300a7617a61329f39d191183e8cb89f5c4bc27f..cdb5ffce2f087082e2f239b4d26a7b6b922e1447 100644 (file)
@@ -27,7 +27,7 @@
 #elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__)                      // CCS PIC compiler\r
 #  define PIC_CCS\r
 #elif defined(STM32F1)                                                              // ARM STM32 with libopencm3\r
-#  define ARM_OPENCM3\r
+#  define LIBOPENCM3\r
 #elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD)      // ARM STM32\r
 #  include <stm32l1xx.h>\r
 #  define ARM_STM32\r
@@ -135,7 +135,7 @@ typedef unsigned short                  uint16_t;
 #  define PROGMEM\r
 #  define memcpy_P                      memcpy\r
 \r
-#elif defined(ARM_OPENCM3)\r
+#elif defined(LIBOPENCM3)\r
 \r
 #  include <libopencm3/cm3/nvic.h>\r
 #  include <libopencm3/stm32/rcc.h>\r