4#if defined(STM32_CORE_VERSION_MAJOR) 
    5#include <HardwareTimer.h> 
    6#include <HardwareSerial.h> 
   12    #error "USBCON must be defined in boards.txt" 
   15    #error "USBD_USE_CDC must be defined in boards.txt" 
   20  #include "stm32f1xx_ll_tim.h" 
   22  #include "stm32f3xx_ll_tim.h" 
   24  #include "stm32f4xx_ll_tim.h" 
   25  #if defined(STM32F407xx) && !defined(HAL_CAN_MODULE_ENABLED) 
   26    #warning "CAN module is not enabled. Internal CAN will NOT be available" 
   29  #include "stm32f4xx_ll_tim.h" 
   35#define COMPARE_TYPE uint16_t 
   36#define SERIAL_BUFFER_SIZE 517  
   37#define FPU_MAX_SIZE 32  
   38#define TIMER_RESOLUTION 4 
   46  #define word(h, l) ((h << 8) | l)  
   49#if defined(ARDUINO_BLUEPILL_F103C8) || defined(ARDUINO_BLUEPILL_F103CB) \ 
   50  || defined(ARDUINO_BLACKPILL_F401CC) || defined(ARDUINO_BLACKPILL_F411CE) 
   52  #ifndef NUM_DIGITAL_PINS 
   53    #define NUM_DIGITAL_PINS 35 
   56    #define LED_BUILTIN PB1  
   58#elif defined(STM32F407xx) 
   59  #ifndef NUM_DIGITAL_PINS 
   60    #define NUM_DIGITAL_PINS 75 
   65#if defined(MCU_STM32F103C8) || defined(MCU_STM32F103CB) 
   66  #define SMALL_FLASH_MODE 
   69#define BOARD_MAX_DIGITAL_PINS NUM_DIGITAL_PINS 
   70#define BOARD_MAX_IO_PINS NUM_DIGITAL_PINS 
   74#ifndef digitalPinToInterrupt 
   79  #define EEPROM_RESET_PIN USER_BTN  
   82#if defined(STM32F407xx) 
   87#if defined(SD_LOGGING) 
   91  #define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SD_SCK_MHZ(50), &SD_SPI) 
   97#if SERIAL_UART_INSTANCE==2 
  109#if defined(ARDUINO_BLUEPILL_F103C8) || defined(ARDUINO_BLUEPILL_F103CB) \ 
  110 || defined(ARDUINO_BLACKPILL_F401CC) || defined(ARDUINO_BLACKPILL_F411CE) 
  111  #define pinIsReserved(pin)  ( ((pin) == PA11) || ((pin) == PA12) || ((pin) == PC14) || ((pin) == PC15) ) 
  126  #ifdef USE_SPI_EEPROM 
  127    #define pinIsReserved(pin)  ( ((pin) == PA11) || ((pin) == PA12) || ((pin) == PB3) || ((pin) == PB4) || ((pin) == PB5) || ((pin) == USE_SPI_EEPROM) )  
  129    #define pinIsReserved(pin)  ( ((pin) == PA11) || ((pin) == PA12) || ((pin) == PB3) || ((pin) == PB4) || ((pin) == PB5) || ((pin) == PB0) )  
  133#define PWM_FAN_AVAILABLE 
  136  #define LED_BUILTIN PA7 
  143#if defined(SRAM_AS_EEPROM) 
  144    #define EEPROM_LIB_H "src/BackupSram/BackupSramAsEEPROM.h" 
  146    #include EEPROM_LIB_H 
  149#elif defined(USE_SPI_EEPROM) 
  150    #define EEPROM_LIB_H "src/SPIAsEEPROM/SPIAsEEPROM.h" 
  152    #include EEPROM_LIB_H 
  160#elif defined(FRAM_AS_EEPROM)  
  161    #define EEPROM_LIB_H "src/FRAM/Fram.h" 
  163    #include EEPROM_LIB_H 
  164    #if defined(STM32F407xx) 
  171  #define EEPROM_LIB_H "src/SPIAsEEPROM/SPIAsEEPROM.h" 
  173  #include EEPROM_LIB_H 
  175  #if defined(STM32F401xC) 
  176    #define SMALL_FLASH_MODE 
  181#define RTC_LIB_H "STM32RTC.h" 
  200#define MAX_TIMER_PERIOD 262140UL  
  201#define uS_TO_TIMER_COMPARE(uS1) ((uS1) >> 2)  
  203#define FUEL1_COUNTER (TIM3)->CNT 
  204#define FUEL2_COUNTER (TIM3)->CNT 
  205#define FUEL3_COUNTER (TIM3)->CNT 
  206#define FUEL4_COUNTER (TIM3)->CNT 
  208#define FUEL1_COMPARE (TIM3)->CCR1 
  209#define FUEL2_COMPARE (TIM3)->CCR2 
  210#define FUEL3_COMPARE (TIM3)->CCR3 
  211#define FUEL4_COMPARE (TIM3)->CCR4 
  213#define IGN1_COUNTER  (TIM2)->CNT 
  214#define IGN2_COUNTER  (TIM2)->CNT 
  215#define IGN3_COUNTER  (TIM2)->CNT 
  216#define IGN4_COUNTER  (TIM2)->CNT 
  218#define IGN1_COMPARE (TIM2)->CCR1 
  219#define IGN2_COMPARE (TIM2)->CCR2 
  220#define IGN3_COMPARE (TIM2)->CCR3 
  221#define IGN4_COMPARE (TIM2)->CCR4 
  223#define FUEL5_COUNTER (TIM5)->CNT 
  224#define FUEL6_COUNTER (TIM5)->CNT 
  225#define FUEL7_COUNTER (TIM5)->CNT 
  226#define FUEL8_COUNTER (TIM5)->CNT 
  228#define FUEL5_COMPARE (TIM5)->CCR1 
  229#define FUEL6_COMPARE (TIM5)->CCR2 
  230#define FUEL7_COMPARE (TIM5)->CCR3 
  231#define FUEL8_COMPARE (TIM5)->CCR4 
  233#define IGN5_COUNTER  (TIM4)->CNT 
  234#define IGN6_COUNTER  (TIM4)->CNT 
  235#define IGN7_COUNTER  (TIM4)->CNT 
  236#define IGN8_COUNTER  (TIM4)->CNT 
  238#define IGN5_COMPARE (TIM4)->CCR1 
  239#define IGN6_COMPARE (TIM4)->CCR2 
  240#define IGN7_COMPARE (TIM4)->CCR3 
  241#define IGN8_COMPARE (TIM4)->CCR4 
  289#define ENABLE_BOOST_TIMER()  (TIM1)->SR = ~TIM_FLAG_CC2; (TIM1)->DIER |= TIM_DIER_CC2IE; (TIM1)->CR1 |= TIM_CR1_CEN;   
  290#define DISABLE_BOOST_TIMER() (TIM1)->DIER &= ~TIM_DIER_CC2IE 
  292#define ENABLE_VVT_TIMER()    (TIM1)->SR = ~TIM_FLAG_CC3; (TIM1)->DIER |= TIM_DIER_CC3IE; (TIM1)->CR1 |= TIM_CR1_CEN;   
  293#define DISABLE_VVT_TIMER()   (TIM1)->DIER &= ~TIM_DIER_CC3IE 
  295#define ENABLE_FAN_TIMER()  (TIM1)->SR = ~TIM_FLAG_CC1; (TIM1)->DIER |= TIM_DIER_CC1IE; (TIM1)->CR1 |= TIM_CR1_CEN;   
  296#define DISABLE_FAN_TIMER() (TIM1)->DIER &= ~TIM_DIER_CC1IE 
  298#define BOOST_TIMER_COMPARE   (TIM1)->CCR2 
  299#define BOOST_TIMER_COUNTER   (TIM1)->CNT 
  300#define VVT_TIMER_COMPARE     (TIM1)->CCR3 
  301#define VVT_TIMER_COUNTER     (TIM1)->CNT 
  302#define FAN_TIMER_COMPARE     (TIM1)->CCR1 
  303#define FAN_TIMER_COUNTER     (TIM1)->CNT 
  309#define IDLE_COUNTER   (TIM1)->CNT 
  310#define IDLE_COMPARE   (TIM1)->CCR4 
  312#define IDLE_TIMER_ENABLE()  (TIM1)->SR = ~TIM_FLAG_CC4; (TIM1)->DIER |= TIM_DIER_CC4IE; (TIM1)->CR1 |= TIM_CR1_CEN; 
  313#define IDLE_TIMER_DISABLE() (TIM1)->DIER &= ~TIM_DIER_CC4IE 
  324#if !defined(ARDUINO_BLUEPILL_F103C8) && !defined(ARDUINO_BLUEPILL_F103CB)  
  333#if ((STM32_CORE_VERSION_MINOR<=8) & (STM32_CORE_VERSION_MAJOR==1))  
  340#if (INJ_CHANNELS >= 5) 
  343#if (INJ_CHANNELS >= 6) 
  346#if (INJ_CHANNELS >= 7) 
  349#if (INJ_CHANNELS >= 8) 
  359#if (IGN_CHANNELS >= 5) 
  362#if (IGN_CHANNELS >= 6) 
  365#if (IGN_CHANNELS >= 7) 
  368#if (IGN_CHANNELS >= 8) 
  377#if defined(HAL_CAN_MODULE_ENABLED) 
  378#define NATIVE_CAN_AVAILABLE 
  379#include <src/STM32_CAN/STM32_CAN.h> 
  384#if defined(STM32GENERIC)  
  385  #define SECONDARY_SERIAL_T SerialUART 
  387  #define SECONDARY_SERIAL_T HardwareSerial 
void vvtInterrupt(void)
Definition auxiliaries.cpp:1150
void boostInterrupt(void)
Definition auxiliaries.cpp:1120
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:348
void idleInterrupt(void)
Definition idle.cpp:761
void fuelSchedule1Interrupt()
Definition scheduler.cpp:370
void fuelSchedule3Interrupt()
Definition scheduler.cpp:390
void fuelSchedule2Interrupt()
Definition scheduler.cpp:380
void fuelSchedule4Interrupt()
Definition scheduler.cpp:400
void ignitionSchedule1Interrupt(void)
Definition scheduler.cpp:493
void oneMSInterval(void)
Definition timers.cpp:76