summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2017-04-30 12:42:38 +0200
committerLeo C2017-04-30 12:42:38 +0200
commita8915151dc5ddd5342d4b8db48a563abf4369891 (patch)
tree3f3d9f6937c124bfa02c3bf47886df1b30ed526a
parent13c24737d1698d551d20baa74681021dc2c0c359 (diff)
downloadirmp-a8915151dc5ddd5342d4b8db48a563abf4369891.zip
Rename ARM_OPENCM3 -> LIBOPENCM3, redefine IRMP_BIT as bitmask
-rw-r--r--irmp.c6
-rw-r--r--irmp.h10
-rw-r--r--irmpconfig.h3
-rw-r--r--irmpsystem.h4
4 files changed, 9 insertions, 14 deletions
diff --git a/irmp.c b/irmp.c
index f95410b..c37449c 100644
--- a/irmp.c
+++ b/irmp.c
@@ -2189,14 +2189,12 @@ irmp_init (void)
# endif
GPIO_Init(IRMP_PORT, &GPIO_InitStructure);
-#elif defined (ARM_OPENCM3) // STM32 with libopencm3
+#elif defined (LIBOPENCM3) // STM32 with libopencm3
/* GPIOx clock enable */
rcc_periph_clock_enable(IRMP_PORT_RCC);
-
/* GPIO Configuration */
- gpio_set_mode(IRMP_PORT, GPIO_MODE_INPUT,
- GPIO_CNF_INPUT_FLOAT, 1<<IRMP_BIT);
+ gpio_set_mode(IRMP_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, IRMP_BIT);
#elif defined(STELLARIS_ARM_CORTEX_M4)
// Enable the GPIO port
diff --git a/irmp.h b/irmp.h
index 3efc62c..c0b3c18 100644
--- a/irmp.h
+++ b/irmp.h
@@ -63,17 +63,15 @@
# warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.
# endif
-#elif defined (ARM_OPENCM3)
+#elif defined (LIBOPENCM3)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_PORT CONCAT(GPIO, IRMP_PORT_LETTER)
-# define IRMP_PORT_RCC CONCAT(RCC_GPIO, IRMP_PORT_LETTER)
+# define IRMP_PORT_RCC CONCAT(RCC_GPIO, IRMP_PORT_LETTER)
-# define IRMP_BIT IRMP_BIT_NUMBER
+# define IRMP_BIT CONCAT(GPIO, IRMP_BIT_NUMBER)
# define IRMP_PIN IRMP_PORT // for use with input(x) below
-# define input(x) ((GPIO_IDR(IRMP_PORT) & (1<<IRMP_BIT)) != 0)
-//# define input(x) (BBIO_PERIPH(IRMP_PORT+IDR, IRMP_BIT))
-# define IRMP_TIMER CONCAT(TIM, IRMP_TIMER_NUMBER)
+# define input(x) ((GPIO_IDR(x) & IRMP_BIT) != 0)
#elif defined (STELLARIS_ARM_CORTEX_M4)
# define _CONCAT(a,b) a##b
diff --git a/irmpconfig.h b/irmpconfig.h
index 67c3638..3767de7 100644
--- a/irmpconfig.h
+++ b/irmpconfig.h
@@ -140,10 +140,9 @@
* Change hardware pin here for ARM STM32 with libopencm3
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
-#elif defined (ARM_OPENCM3) // use C13 as IR input on STM32
+#elif defined (LIBOPENCM3)
# define IRMP_PORT_LETTER B
# define IRMP_BIT_NUMBER 4
-# define IRMP_TIMER_NUMBER 3 // Timer to use
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for Stellaris ARM Cortex M4
diff --git a/irmpsystem.h b/irmpsystem.h
index 7300a76..cdb5ffc 100644
--- a/irmpsystem.h
+++ b/irmpsystem.h
@@ -27,7 +27,7 @@
#elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC compiler
# define PIC_CCS
#elif defined(STM32F1) // ARM STM32 with libopencm3
-# define ARM_OPENCM3
+# define LIBOPENCM3
#elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD) // ARM STM32
# include <stm32l1xx.h>
# define ARM_STM32
@@ -135,7 +135,7 @@ typedef unsigned short uint16_t;
# define PROGMEM
# define memcpy_P memcpy
-#elif defined(ARM_OPENCM3)
+#elif defined(LIBOPENCM3)
# include <libopencm3/cm3/nvic.h>
# include <libopencm3/stm32/rcc.h>