summaryrefslogtreecommitdiff
path: root/irmpsystem.h
diff options
context:
space:
mode:
authorLeo C2017-04-16 14:24:12 +0200
committerLeo C2017-04-16 14:24:12 +0200
commit4d08a2f77cb136eeac9a0ec3bc5caf9fbba94c52 (patch)
treeabccf6ca11c511c8a77956db811e52c9ceedc1ab /irmpsystem.h
parent30d1689ddd3c91f22ee9f79ae4cd6c897b7badbb (diff)
downloadirmp-4d08a2f77cb136eeac9a0ec3bc5caf9fbba94c52.zip
Add support for libopencm3 (STM32F1)
Diffstat (limited to 'irmpsystem.h')
-rw-r--r--irmpsystem.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/irmpsystem.h b/irmpsystem.h
index 25bacb2..e1fbc97 100644
--- a/irmpsystem.h
+++ b/irmpsystem.h
@@ -26,6 +26,9 @@
# define PIC_C18
#elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC compiler
# define PIC_CCS
+#elif defined(STM32F1) // ARM STM32 with libopencm3
+# define ARM_OPENCM3
+# define F_CPU (SysCtlClockGet())
#elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD) // ARM STM32
# include <stm32l1xx.h>
# define ARM_STM32
@@ -133,6 +136,15 @@ typedef unsigned short uint16_t;
# define PROGMEM
# define memcpy_P memcpy
+#elif defined(ARM_OPENCM3)
+
+# include <libopencm3/cm3/nvic.h>
+# include <libopencm3/stm32/rcc.h>
+# include <libopencm3/stm32/gpio.h>
+# include <libopencm3/stm32/timer.h>
+# define PROGMEM
+# define memcpy_P memcpy
+
#elif defined(SDCC_STM8)
# include "stm8s.h"