20 #define SERIAL_BUFFER_SIZE 517 //Size of the serial buffer used by new comms protocol. For SD transfers this must be at least 512 + 1 (flag) + 4 (sector)
21 #define FPU_MAX_SIZE 32 //Size of the FPU buffer. 0 means no FPU.
22 #define BOARD_MAX_DIGITAL_PINS 54
23 #define BOARD_MAX_IO_PINS 54
24 #define BOARD_MAX_ADC_PINS 17 //Number of analog pins
28 #define SD_LOGGING //SD logging enabled by default for Teensy 4.1 as it has the slot built in
29 #define RTC_LIB_H "TimeLib.h"
30 #define SD_CONFIG SdioConfig(FIFO_SDIO) //Set Teensy to use SDIO in FIFO mode. This is the fastest SD mode on Teensy as it offloads most of the writes
126 #define MAX_TIMER_PERIOD 55923UL //Time per tick = 0.8533333
127 #define uS_TO_TIMER_COMPARE(uS) ((uS * 75UL) >> 6) //Converts a given number of uS into the required number of timer ticks until that time has passed.
128 #elif F_CPU == 528000000
129//Bus Clock is 132Mhz @ 528 Mhz CPU.
130 #define MAX_TIMER_PERIOD 63549UL //Time per tick = 0.96969696
131 #define uS_TO_TIMER_COMPARE(uS) ((uS * 66UL) >> 6) //Converts a given number of uS into the required number of timer ticks until that time has passed.
132 #elif F_CPU == 450000000
133//Bus Clock is 150Mhz @ 450 Mhz CPU.
134 #define MAX_TIMER_PERIOD 55923UL //Time per tick = 0.8533333
135 #define uS_TO_TIMER_COMPARE(uS) ((uS * 75UL) >> 6) //Converts a given number of uS into the required number of timer ticks until that time has passed.
136 #elif F_CPU == 396000000
137//Bus Clock is 132Mhz @ 396 Mhz CPU.
138 #define MAX_TIMER_PERIOD 63549UL //Time per tick = 0.96969696
139 #define uS_TO_TIMER_COMPARE(uS) ((uS * 66UL) >> 6) //Converts a given number of uS into the required number of timer ticks until that time has passed.
140 #elif F_CPU == 150000000
141//Bus Clock is 75Mhz @ 150 Mhz CPU.
142 #define MAX_TIMER_PERIOD 111846UL //Time per tick = 1.706666
143 #define uS_TO_TIMER_COMPARE(uS) ((uS * 75UL) >> 7) //Converts a given number of uS into the required number of timer ticks until that time has passed.
144 #else
145 #error Unsupported CPU frequency.
146 #endif
147/*
148 To calculate the above uS_TO_TIMER_COMPARE
149 Choose number of bit of precision. Eg: 6
150 Divide 2^6 by the time per tick (0.853333) = 75
151 Multiply and bitshift back by the precision: (uS * 75) >> 6