3#if defined(NATIVE_BOARD)
8#include "../lib/ArduinoFake/SoftwareTimer.h"
25constexpr auto ticksToMicros = software_timer_t::ticksToMicros;
27#define FPU_MAX_SIZE 32
32#define TS_SERIAL_BUFFER_SIZE 517
34#define BOARD_MAX_DIGITAL_PINS NUM_DIGITAL_PINS
35#define BOARD_MAX_IO_PINS NUM_DIGITAL_PINS
37static inline bool pinIsReserved(uint8_t pin) {
return pin==0U; }
39#define PWM_FAN_AVAILABLE
45#define DEFINE_TIMER_VARS(Prefix, index, array) \
46 static inline void Prefix##index##_TIMER_ENABLE(void) { array[index-1].enableTimer(); } \
47 static inline void Prefix##index##_TIMER_DISABLE(void) { array[index-1].disableTimer(); } \
48 static std::atomic<software_timer_t::counter_t>& Prefix##index##_COUNTER = array[index-1].counter; \
49 static std::atomic<software_timer_t::counter_t>& Prefix##index##_COMPARE = array[index-1].compare;
51extern std::array<software_timer_t, INJ_CHANNELS> fuelTimers;
53DEFINE_TIMER_VARS(FUEL, 1, fuelTimers)
54DEFINE_TIMER_VARS(FUEL, 2, fuelTimers)
55DEFINE_TIMER_VARS(FUEL, 3, fuelTimers)
56DEFINE_TIMER_VARS(FUEL, 4, fuelTimers)
57DEFINE_TIMER_VARS(FUEL, 5, fuelTimers)
58DEFINE_TIMER_VARS(FUEL, 6, fuelTimers)
59DEFINE_TIMER_VARS(FUEL, 7, fuelTimers)
60DEFINE_TIMER_VARS(FUEL, 8, fuelTimers)
62extern std::array<software_timer_t, IGN_CHANNELS> ignitionTimers;
64DEFINE_TIMER_VARS(IGN, 1, ignitionTimers)
65DEFINE_TIMER_VARS(IGN, 2, ignitionTimers)
66DEFINE_TIMER_VARS(IGN, 3, ignitionTimers)
67DEFINE_TIMER_VARS(IGN, 4, ignitionTimers)
68DEFINE_TIMER_VARS(IGN, 5, ignitionTimers)
69DEFINE_TIMER_VARS(IGN, 6, ignitionTimers)
70DEFINE_TIMER_VARS(IGN, 7, ignitionTimers)
71DEFINE_TIMER_VARS(IGN, 8, ignitionTimers)
78extern software_timer_t boostTimer;
79#define ENABLE_BOOST_TIMER() boostTimer.enableTimer()
80#define DISABLE_BOOST_TIMER() boostTimer.disableTimer()
81#define BOOST_TIMER_COMPARE boostTimer.compare
82#define BOOST_TIMER_COUNTER boostTimer.counter
84extern software_timer_t vvtTimer;
85#define ENABLE_VVT_TIMER() vvtTimer.enableTimer()
86#define DISABLE_VVT_TIMER() vvtTimer.disableTimer()
87#define VVT_TIMER_COMPARE vvtTimer.compare
88#define VVT_TIMER_COUNTER vvtTimer.counter
90extern software_timer_t fanTimer;
91#define ENABLE_FAN_TIMER() fanTimer.enableTimer()
92#define DISABLE_FAN_TIMER() fanTimer.disableTimer()
93#define FAN_TIMER_COMPARE fanTimer.compare
94#define FAN_TIMER_COUNTER fanTimer.counter
100extern software_timer_t idleTimer;
101#define IDLE_TIMER_ENABLE() idleTimer.enableTimer()
102#define IDLE_TIMER_DISABLE() idleTimer.disableTimer()
103#define IDLE_COUNTER idleTimer.counter
104#define IDLE_COMPARE idleTimer.compare
108 struct { TickEventGuard guard; uint8_t done = 1; } loopGuard; \
109 loopGuard.done; loopGuard.done = 0U )
112template<
typename _Tp>
113constexpr const _Tp& max(
const _Tp& __a,
const _Tp& __b) {
121template<
typename _Tp>
122constexpr const _Tp& min(
const _Tp& __a,
const _Tp& __b) {
134#define SECONDARY_SERIAL_T decltype(Serial)
136#define RTC_LIB_H <time.h>
144constexpr uint8_t
ANALOG_PINS[] = { _ANALOG_PINS_A0_A14 };
uint16_t COMPARE_TYPE
The timer overflow type.
Definition board_avr2560.h:32
static bool pinIsReserved(uint8_t pin)
Definition board_avr2560.h:62
fastInputPin_t boardInputPin_t
Definition board_avr2560.h:174
constexpr uint16_t BLOCKING_FACTOR
Definition board_avr2560.h:60
static constexpr uint32_t ticksToMicros(COMPARE_TYPE ticks)
Convert timer ticks to µS.
Definition board_avr2560.h:48
fastOutputPin_t boardOutputPin_t
Definition board_avr2560.h:176
constexpr uint8_t SERIAL_BUFFER_THRESHOLD
When the serial buffer is filled to greater than this threshold value, the serial processing operatio...
Definition board_avr2560.h:185
constexpr uint8_t ANALOG_PINS[]
Analog pin mapping.
Definition board_avr2560.h:179
constexpr uint16_t TABLE_BLOCKING_FACTOR
Definition board_avr2560.h:61
static constexpr COMPARE_TYPE uS_TO_TIMER_COMPARE(uint32_t micros)
Convert µS to timer ticks.
Definition board_avr2560.h:40