From 9b53feb9da61cad5fb1407db6211277d12b160dd Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 18 Jan 2019 10:18:47 +1100 Subject: [PATCH] More compatibility for the modular arch setup --- speeduino/auxiliaries.h | 2 ++ speeduino/auxiliaries.ino | 4 ++-- speeduino/globals.h | 3 +++ speeduino/src/boards/stm32.h | 0 speeduino/src/boards/teensy35.h | 0 5 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 speeduino/src/boards/stm32.h create mode 100644 speeduino/src/boards/teensy35.h diff --git a/speeduino/auxiliaries.h b/speeduino/auxiliaries.h index ef4b6232..93926e16 100644 --- a/speeduino/auxiliaries.h +++ b/speeduino/auxiliaries.h @@ -71,6 +71,7 @@ void fanControl(); #define N2O_STAGE2_PIN_HIGH() *n2o_stage2_pin_port |= (n2o_stage2_pin_mask) #define READ_N2O_ARM_PIN() ((*n2o_arming_pin_port & n2o_arming_pin_mask) ? true : false) +#if not defined(CORE_SAMD21) volatile byte *boost_pin_port; volatile byte boost_pin_mask; volatile byte *vvt_pin_port; @@ -83,6 +84,7 @@ volatile byte *n2o_stage2_pin_port; volatile byte n2o_stage2_pin_mask; volatile byte *n2o_arming_pin_port; volatile byte n2o_arming_pin_mask; +#endif volatile bool boost_pwm_state; unsigned int boost_pwm_max_count; //Used for variable PWM frequency diff --git a/speeduino/auxiliaries.ino b/speeduino/auxiliaries.ino index 2b48c08e..34856357 100644 --- a/speeduino/auxiliaries.ino +++ b/speeduino/auxiliaries.ino @@ -292,7 +292,7 @@ void boostDisable() //The interrupt to control the Boost PWM #if defined(CORE_AVR) ISR(TIMER1_COMPA_vect) -#elif defined (CORE_TEENSY) || defined(CORE_STM32) +#else static inline void boostInterrupt() //Most ARM chips can simply call a function #endif { @@ -314,7 +314,7 @@ void boostDisable() //The interrupt to control the VVT PWM #if defined(CORE_AVR) ISR(TIMER1_COMPB_vect) -#elif defined (CORE_TEENSY) || defined(CORE_STM32) +#else static inline void vvtInterrupt() //Most ARM chips can simply call a function #endif { diff --git a/speeduino/globals.h b/speeduino/globals.h index b2e8021b..a2b4c3e3 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -12,15 +12,18 @@ #define BOARD_NR_GPIO_PINS 62 #define LED_BUILTIN 13 #define CORE_AVR + #define BOARD_H "src/boards/avr2560.h" //#define TIMER5_MICROS #elif defined(CORE_TEENSY) #define BOARD_DIGITAL_GPIO_PINS 34 #define BOARD_NR_GPIO_PINS 34 + #define BOARD_H "src/boards/teensy35.h" #elif defined(STM32_MCU_SERIES) || defined(ARDUINO_ARCH_STM32) || defined(__STM32F1__) || defined(STM32F4) || defined(STM32) #define CORE_STM32 + #define BOARD_H "src/boards/stm32.h" #ifndef word #define word(h, l) ((h << 8) | l) //word() function not defined for this platform in the main library #endif diff --git a/speeduino/src/boards/stm32.h b/speeduino/src/boards/stm32.h new file mode 100644 index 00000000..e69de29b diff --git a/speeduino/src/boards/teensy35.h b/speeduino/src/boards/teensy35.h new file mode 100644 index 00000000..e69de29b