17# if defined(USING_ARDUINO_IDE) || (defined(ARDUINO) && !defined(PLATFORMIO))
72# define IS_DOXYGEN false
79#define MAJOR_VERSION 20
80#define MINOR_VERSION 0
81#define PATCH_VERSION 0
83#define CORE_ENABLE_auto 2
84#define CORE_ENABLE_true 1
85#define CORE_ENABLE_false 0
87#define CORE_ENABLE_AUTO 2
88#define CORE_ENABLE_TRUE 1
89#define CORE_ENABLE_FALSE 0
91#if (defined(WANT_POWERSAVING) && (WANT_POWERSAVING == true))
92# define ENABLE_POWERSAVING
95#if (defined(WANT_UPDATER) && (WANT_UPDATER == true))
96# define ENABLE_UPDATER
99#if (defined(WANT_NEOPIXEL) && (WANT_NEOPIXEL == true))
100# define ENABLE_NEOPIXEL
103#if (CORE_ARC == CORE_ENABLE_TRUE) || ((CORE_ARC == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
107#if (CORE_ATARI == CORE_ENABLE_TRUE) || ((CORE_ATARI == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
111#if (CORE_COLV == CORE_ENABLE_TRUE) || ((CORE_COLV == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
115#if (CORE_FAIRCHILD == CORE_ENABLE_TRUE) || ((CORE_FAIRCHILD == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
116# define ENABLE_FAIRCHILD
119#if (CORE_FLASH == CORE_ENABLE_TRUE) || ((CORE_FLASH == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
123#if (CORE_FLASH16 == CORE_ENABLE_TRUE) || ((CORE_FLASH16 == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
124# define ENABLE_FLASH16
127#if (CORE_GBX == CORE_ENABLE_TRUE) || (CORE_GBX == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
131#if (CORE_INTV == CORE_ENABLE_TRUE) || ((CORE_INTV == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
135#if (CORE_LOOPY == CORE_ENABLE_TRUE) || ((CORE_LOOPY == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
139#if (CORE_MD == CORE_ENABLE_TRUE) || (CORE_MD == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
143#if (CORE_MSX == CORE_ENABLE_TRUE) || ((CORE_MSX == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
147#if (CORE_N64 == CORE_ENABLE_TRUE) || (CORE_N64 == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
151#if (CORE_NES == CORE_ENABLE_TRUE) || (CORE_NES == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
155#if (CORE_NGP == CORE_ENABLE_TRUE) || ((CORE_NGP == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
159#if (CORE_ODY2 == CORE_ENABLE_TRUE) || ((CORE_ODY2 == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
163#if (CORE_PCE == CORE_ENABLE_TRUE) || ((CORE_PCE == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
167#if (CORE_PCW == CORE_ENABLE_TRUE) || ((CORE_PCW == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
171#if (CORE_POKE == CORE_ENABLE_TRUE) || ((CORE_POKE == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
175#if (CORE_SFM == CORE_ENABLE_TRUE) || ((CORE_SFM == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
179#if (CORE_SMS == CORE_ENABLE_TRUE) || (CORE_SMS == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
183#if (CORE_SNES == CORE_ENABLE_TRUE) || (CORE_SNES == CORE_ENABLE_AUTO) || (IS_DOXYGEN)
187#if (CORE_SUPERACAN == CORE_ENABLE_TRUE) || ((CORE_SUPERACAN == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
188# define ENABLE_SUPERACAN
191#if (CORE_SV == CORE_ENABLE_TRUE) || ((CORE_SV == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
195#if (CORE_VBOY == CORE_ENABLE_TRUE) || ((CORE_VBOY == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
199#if (CORE_WATARASV == CORE_ENABLE_TRUE) || ((CORE_WATARASV == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
200# define ENABLE_WATARASV
203#if (CORE_WONDERSWAN == CORE_ENABLE_TRUE) || ((CORE_WONDERSWAN == CORE_ENABLE_AUTO) && (HW_VERSION > 6)) || (IS_DOXYGEN)
204# define ENABLE_WONDERSWAN
207# if (WANT_VSELECT == true) || (IS_DOXYGEN)
208# define ENABLE_VSELECT
211# if (WANT_3V3FIX == true) || (IS_DOXYGEN)
212# define ENABLE_3V3FIX
215# if (WANT_RTC == true) || (IS_DOXYGEN)
219# if (WANT_RTC == true) || (IS_DOXYGEN)
220# define ENABLE_CONFIG
223# if (WANT_CLOCKGEN == true) || (IS_DOXYGEN)
224# define ENABLE_CLOCKGEN
227# if (USING_ONBOARD_ATMEGA == true) || (IS_DOXYGEN)
228# define ENABLE_ONBOARD_ATMEGA
231#define VERSION_STRING NUM2STR(MAJOR_VERSION) "." NUM2STR(MINOR_VERSION) "." NUM2STR(PATCH_VERSION)
233#pragma region Dependencies
271# if defined(ENABLE_CPS3)
272# if !defined(NEEDS_FLASH8)
275# if !defined(NEEDS_FLASH16)
276# define NEEDS_FLASH16
285# if defined(ENABLE_SFM) || defined(ENABLE_SV) || defined(ENABLE_ST) || defined(ENABLE_GPC)
286# if !defined(NEEDS_FLASH8)
296# if defined(ENABLE_SNES) && defined(ENABLE_FLASH)
297# if !defined(NEEDS_FLASH8)
308#if defined(ENABLE_FLASH16) && !defined(ENABLED_FLASH8)
309# define ENABLED_FLASH8
312#if defined(NEEDS_FLASH16) && !defined(NEEDS_FLASH8)
320#pragma region HAS Flags
327# if defined(ENABLE_GBX) || defined(NEEDS_GBX)
333# if defined(ENABLE_N64) || defined(NEEDS_N64)
339# if defined(ENABLE_SNES) || defined(NEEDS_SNES)
345# if defined(ENABLE_SFM) || defined(NEEDS_SFM)
351# if defined(ENABLE_FLASH) || defined(NEEDS_FLASH)
357# if defined(ENABLE_FLASH8) || defined(NEEDS_FLASH8)
363# if defined(ENABLE_FLASH16) || defined(NEEDS_FLASH16)
364# define HAS_FLASH16 1
366# define HAS_FLASH16 0
369# if defined(ENABLE_MD) || defined(NEEDS_MD)
375# if defined(ENABLE_PCE) || defined(NEEDS_PCE)
381# if defined(ENABLE_SV) || defined(NEEDS_SV)
387# if defined(ENABLE_NES) || defined(NEEDS_NES)
393# if defined(ENABLE_SMS) || defined(NEEDS_SMS)
399# if defined(ENABLE_WS) || defined(NEEDS_WS)
405# if defined(ENABLE_NGP) || defined(NEEDS_NGP)
411# if defined(ENABLE_INTV) || defined(NEEDS_INTV)
417# if defined(ENABLE_COLV) || defined(NEEDS_COLV)
423# if defined(ENABLE_VBOY) || defined(NEEDS_VBOY)
429# if defined(ENABLE_WSV) || defined(NEEDS_WSV)
435# if defined(ENABLE_PCW) || defined(NEEDS_PCW)
441# if defined(ENABLE_ODY2) || defined(NEEDS_ODY2)
447# if defined(ENABLE_ARC) || defined(NEEDS_ARC)
453# if defined(ENABLE_FAIRCHILD) || defined(NEEDS_FAIRCHILD)
454# define HAS_FAIRCHILD 1
456# define HAS_FAIRCHILD 0
459# if defined(ENABLE_SUPRACAN) || defined(NEEDS_SUPRACAN)
460# define HAS_SUPRACAN 1
462# define HAS_SUPRACAN 0
465# if defined(ENABLE_MSX) || defined(NEEDS_MSX)
471# if defined(ENABLE_POKE) || defined(NEEDS_POKE)
477# if defined(ENABLE_LOOPY) || defined(NEEDS_LOOPY)
483# if defined(ENABLE_C64) || defined(NEEDS_C64)
489# if defined(ENABLE_2600) || defined(NEEDS_2600)
495# if defined(ENABLE_5200) || defined(NEEDS_5200)
501# if defined(ENABLE_7800) || defined(NEEDS_7800)
507# if defined(ENABLE_JAGUAR) || defined(NEEDS_JAGUAR)
513# if defined(ENABLE_LYNX) || defined(NEEDS_LYNX)
519# if defined(ENABLE_VECTREX) || defined(NEEDS_VECTREX)
520# define HAS_VECTREX 1
522# define HAS_VECTREX 0
525# if defined(ENABLE_ST) || defined(NEEDS_ST)
531# if defined(ENABLE_GPC) || defined(NEEDS_GPC)
537# if defined(ENABLE_ATARI8) || defined(NEEDS_ATARI8)
543# if defined(ENABLE_BALLY) || defined(NEEDS_BALLY)
549# if defined(ENABLE_LJ) || defined(NEEDS_LJ)
555# if defined(ENABLE_LJPRO) || defined(NEEDS_LJPRO)
561# if defined(ENABLE_PV1000) || defined(NEEDS_PV1000)
567# if defined(ENABLE_VIC20) || defined(NEEDS_VIC20)
573# if defined(ENABLE_LEAP) || defined(NEEDS_LEAP)
579# if defined(ENABLE_RCA) || defined(NEEDS_RCA)
585# if defined(ENABLE_TI99) || defined(NEEDS_TI99)
591# if defined(ENABLE_PYUUTA) || defined(NEEDS_PYUUTA)
597# if defined(ENABLE_TRS80) || defined(NEEDS_TRS80)
603# if defined(ENABLE_VSMILE) || defined(NEEDS_VSMILE)
609# if defined(ENABLE_CPS3) || defined(NEEDS_CPS3)
615# if defined(ENABLE_SELFTEST) || defined(NEEDS_SELFTEST)
616# define HAS_SELFTEST 1
618# define HAS_SELFTEST 0
621# if defined(NEEDS_UTIL_BITSET_TEMPLATE)
622# define HAS_UTIL_BITSET_TEMPLATE 1
630# if defined(ENABLE_UPDATER)
631# define HAS_UPDATER 1
633# define HAS_UPDATER 0
636# if defined(ENABLE_CONFIG)
642# if defined(ENABLE_CLOCKGEN)
643# define HAS_CLOCKGEN 1
645# define HAS_CLOCKGEN 0
648# if defined(ENABLE_VSELECT)
649# define HAS_VSELECT 1
651# define HAS_VSELECT 0
654# if defined(ENABLE_RTC)
660# if defined(ENABLE_ONBOARD_ATMEGA)
661# define HAS_ONBOARD_ATMEGA 1
663# define HAS_ONBOARD_ATMEGA 0
666# if defined(ENABLE_3V3FIX)
667# define HAS_STABILITYFIX 1
669# define HAS_STABILITYFIX 0
672# if defined(ENABLE_POWERSAVING)
673# define HAS_POWERSAVING 1
675# define HAS_POWERSAVING 0
678# if defined(OPTION_CLOCKGEN_CALIBRATION)
679# define HAS_CLOCKGEN_CALIBRATION 1
681# define HAS_CLOCKGEN_CALIBRATION 0
684# if defined(OPTION_CLOCKGEN_USE_CALIBRATION)
685# define HAS_CLOCKGEN_CALIBRATED 1
687# define HAS_CLOCKGEN_CALIBRATED 0
693#pragma region Presets
695# if !defined(OPTION_SERIAL_OUTPUT)
696# define OPTION_SERIAL_OUTPUT SERIAL_ASCII
699# if !defined(OPTION_LCD_RGB)
700# define OPTION_LCD_RGB 1
703#define OPTION_LCD_BG_RED 100
704#define OPTION_LCD_BG_GREEN 0
705#define OPTION_LCD_BG_BLUE 100
707#define OPTION_LCD_NOTIF_RED 100
708#define OPTION_LCD_NOTIF_GREEN 100
709#define OPTION_LCD_NOTIF_BLUE 0
711#define OPTION_LCD_ERROR_RED 100
712#define OPTION_LCD_ERROR_GREEN 0
713#define OPTION_LCD_ERROR_BLUE 0
715#pragma region Core Defaults
722# define OPTION_SMS_ADAPTER_MAX 3
723# define OPTION_GG_ADAPTER_MAX 2
724# define OPTION_SG1000_ADAPTER_MAX 1
728#pragma region Defaults
730# if defined(ENABLE_CONFIG)
731# define CONFIG_FILE "config.txt"
734# define CONFIG_KEY_MAX 32
735# define CONFIG_VALUE_MAX 32
740# if !defined(OSCR_REGION)
741# define OSCR_REGION REGN_AUTO
748# if !defined(OPTION_UNIQUE_DIRECTORY_METHOD)
749# define OPTION_UNIQUE_DIRECTORY_METHOD UNQDIR_AUTO
750# elif ISEMPTY(OPTION_UNIQUE_DIRECTORY_METHOD)
751# undef OPTION_UNIQUE_DIRECTORY_METHOD
752# define OPTION_UNIQUE_DIRECTORY_METHOD UNQDIR_AUTO
755# if (OPTION_UNIQUE_DIRECTORY_METHOD == UNQDIR_AUTO)
756# undef OPTION_UNIQUE_DIRECTORY_METHOD
757# if defined(ENABLE_RTC)
758# define OPTION_UNIQUE_DIRECTORY_METHOD UNQDIR_RTC
760# define OPTION_UNIQUE_DIRECTORY_METHOD UNQDIR_INCREMENT
768# if defined(ENABLE_POWERSAVING)
770# if WANT_POWERSAVING_DISPLAY_DIM == true
771# define HAS_POWERSAVING_DISPLAY_DIM POWERSAVING_DISPLAY_DIM
773# define HAS_POWERSAVING_DISPLAY_DIM 0
776# if WANT_POWERSAVING_DISPLAY_OFF == true
777# define HAS_POWERSAVING_DISPLAY_OFF POWERSAVING_DISPLAY_OFF
779# define HAS_POWERSAVING_DISPLAY_OFF 0
782# if WANT_POWERSAVING_SLOWCLOCK == true
783# define HAS_POWERSAVING_SLOWCLOCK POWERSAVING_SLOWCLOCK
785# define HAS_POWERSAVING_SLOWCLOCK 0
788# if ISEMPTY(ENABLE_POWERSAVING)
789# undef ENABLE_POWERSAVING
790# define ENABLE_POWERSAVING 1
793# if !defined(OPTION_POWERSAVING_METHOD)
794# define OPTION_POWERSAVING_METHOD (HAS_POWERSAVING_DISPLAY_DIM | HAS_POWERSAVING_DISPLAY_OFF | HAS_POWERSAVING_SLOWCLOCK)
797# if !defined(OPTION_POWERSAVING_IDLE_DIM) || ISEMPTY(OPTION_POWERSAVING_IDLE_DIM)
798# define OPTION_POWERSAVING_IDLE_DIM 30000
799# elif (ISEMPTY(OPTION_POWERSAVING_IDLE_DIM) || OPTION_POWERSAVING_IDLE_DIM < 1000)
800# undef OPTION_POWERSAVING_IDLE_DIM
801# define OPTION_POWERSAVING_IDLE_DIM 30000
804# if !defined(OPTION_POWERSAVING_IDLE_SLEEP)
805# define OPTION_POWERSAVING_IDLE_SLEEP 60000
806# elif (ISEMPTY(OPTION_POWERSAVING_IDLE_SLEEP) || OPTION_POWERSAVING_IDLE_SLEEP < 1000)
807# undef OPTION_POWERSAVING_IDLE_SLEEP
808# define OPTION_POWERSAVING_IDLE_SLEEP 60000
811# elif defined(OPTION_POWERSAVING_METHOD)
812# undef OPTION_POWERSAVING_METHOD
813# define OPTION_POWERSAVING_METHOD (0)
815# define OPTION_POWERSAVING_METHOD (0)
818# if !defined(OPTION_VOLTAGE_SPECIFIER)
819# define OPTION_VOLTAGE_SPECIFIER VLTSPC_PROMPT
827# if HARDWARE_OUTPUT_TYPE == OUTPUT_OS12864
832# define UI_PAGE_SIZE ((uint8_t)7)
838# define UI_PAGE_ENTRY_LENTH_MAX ((uint8_t)30)
844# define UI_PAGE_ENTRY_LENTH_MIN ((uint8_t)2)
846# if defined(OPTION_LCD_TYPE) && OPTION_LCD_TYPE == 0
847# undef OPTION_LCD_TYPE
850# if !defined(OPTION_LCD_TYPE) || OPTION_LCD_TYPE == 0
851# define OPTION_LCD_TYPE LCD_MKS
854# if defined(OPTION_NEOPIXEL_ORDER) && OPTION_NEOPIXEL_ORDER == NPXL_AUTO
855# undef OPTION_NEOPIXEL_ORDER
858# if OPTION_LCD_TYPE == 1
859# if !defined(OPTION_NEOPIXEL_ORDER)
860# define OPTION_NEOPIXEL_ORDER NPXL_NORMAL
862# elif OPTION_LCD_TYPE == 2
863# if !defined(OPTION_NEOPIXEL_ORDER)
864# define OPTION_NEOPIXEL_ORDER NPXL_REVERSE
866# if !defined(NO_OPTION_BTN_PULLUP) && !defined(OPTION_BTN_PULLUP_DISABLE)
867# define OPTION_BTN_PULLUP
870# error !!! INVALID VALUE FOR OPTION_LCD_TYPE !!!
873# elif HARDWARE_OUTPUT_TYPE == OUTPUT_SSD1306
882# define UI_PAGE_SIZE ((uint8_t)7)
888# define UI_PAGE_ENTRY_LENTH_MAX ((uint8_t)20)
894# define UI_PAGE_ENTRY_LENTH_MIN ((uint8_t)2)
896# elif HARDWARE_OUTPUT_TYPE == OUTPUT_SERIAL
905# define UI_PAGE_SIZE ((uint8_t)32)
911# define UI_PAGE_ENTRY_LENTH_MAX ((uint8_t)31)
917# define UI_PAGE_ENTRY_LENTH_MIN ((uint8_t)2)
923# define UI_INPUT_SERIAL_NEXT 'n'
929# define UI_INPUT_SERIAL_BACK 'b'
935# define UI_INPUT_SERIAL_CONFIRM 'c'
941# define UI_INPUT_SERIAL_CONFIRM_SHORT 'x'
947# define UI_INPUT_SERIAL_CONFIRM_LONG 'z'
953# define UI_INPUT_SERIAL_ANSI_NEXT 0x42
959# define UI_INPUT_SERIAL_ANSI_BACK 0x41
965# define UI_INPUT_SERIAL_ANSI_CONFIRM 0x43
967# if (OPTION_SERIAL_OUTPUT == 1)
968# define ENABLE_SERIAL_OUTPUT
969# define ENABLE_SERIAL_ASCII
970# elif (OPTION_SERIAL_OUTPUT == 2)
971# define ENABLE_SERIAL_OUTPUT
972# define ENABLE_SERIAL_ANSI
984# define BANKSET_MIN_SUPPORTED_BANKS 4
986#pragma region Sanity Checks
991# if (HW_VERSION < 1) || (HW_VERSION > 5)
992# error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!!
998# if defined(ALLOW_UNSAFE_CONFIG)
1000# if defined(GITHUB_CI)
1001# error !! UNSAFE CONFIGURATIONS ARE ALLOWED !! -- This should not be enabled on the repository!
1003# warning !! UNSAFE CONFIGURATIONS ARE ALLOWED !! -- Unless you are a developer this probably is not something you want set.
1009# if ((OPTION_UNIQUE_DIRECTORY_METHOD < UNQDIR_INCREMENT) || (OPTION_UNIQUE_DIRECTORY_METHOD > UNQDIR_BOTH))
1010# error Unique directory method is invalid.
1011# elif ((OPTION_UNIQUE_DIRECTORY_METHOD == UNQDIR_RTC) || (OPTION_UNIQUE_DIRECTORY_METHOD == UNQDIR_BOTH))
1012# if (!defined(ENABLE_RTC))
1013# error Unique directory method is set to use the datetime, but RTC is not enabled.
1019# if !defined(OSCR_LANGUAGE)
1020# error !!! PLEASE CHOOSE A LANGUAGE !!!
1023# if ((OSCR_LANGUAGE < LANG_MIN) || (OSCR_LANGUAGE > LANG_MAX))
1024# error The language specified in Config.h is invalid.
1029# if defined(OSCR_REGION)
1030# if ((OSCR_REGION < REGN_MIN) || (OSCR_REGION > REGN_MAX))
1031# error The region specified in Config.h is invalid.
1037# if defined(ENABLE_POWERSAVING)
1038# if (((OPTION_POWERSAVING_METHOD) & (POWERSAVING_DISPLAY_DIM | POWERSAVING_DISPLAY_OFF)) && (OPTION_POWERSAVING_IDLE_SLEEP <= OPTION_POWERSAVING_IDLE_DIM))
1039# error Power save sleep timeout must be greater than the dim timeout.
1045# if defined(ENABLE_3V3FIX) && !defined(ENABLE_VSELECT)
1046# warning Using 3V3FIX is best with VSELECT.
1052# if defined(OPTION_VOLTAGE_MONITOR_METHOD)
1055# if !(OPTION_VOLTAGE_MONITOR_METHOD >= 0 && OPTION_VOLTAGE_MONITOR_METHOD <= 3)
1056# error !!! VALUE OF OPTION_VOLTAGE_MONITOR_METHOD IS INVALID !!!
1064# if defined(ENABLE_VSELECT)
1066# if ISEMPTY(ENABLE_VSELECT)
1067# undef ENABLE_VSELECT
1068# define ENABLE_VSELECT 1
1072# if (HW_VERSION < 4)
1073# if defined(ALLOW_UNSAFE_CONFIG)
1074# define IS_UNSAFE_CONFIG
1075# warning Using VSELECT with hardware revisions other than 4 or 5 is not supported.
1077# error Using VSELECT with hardware revisions other than 4 or 5 is not supported. \
1078 If you understand what you are doing you can define ALLOW_UNSAFE_CONFIG in Config.h to allow compiling.
1084# if defined(ALLOW_UNSAFE_CONFIG)
1085# define IS_UNSAFE_CONFIG
1086# warning Using VSELECT with HW4 is untested. Verification with a multimeter before use is strongly recommended. Please remember to report back with your findings.
1088# error Using VSELECT with HW4 is untested. Verification with a multimeter before use is strongly recommended. \
1089 Define ALLOW_UNSAFE_CONFIG in Config.h to allow compiling. Please report back with your findings after testing!
1097# if !defined(NEEDS_UTIL_BITSET_TEMPLATE) && (defined(NEEDS_UTIL_BITSET_TEMPLATE_16) || defined(NEEDS_UTIL_BITSET_TEMPLATE_32) || defined(NEEDS_UTIL_BITSET_TEMPLATE_64))
1098# define NEEDS_UTIL_BITSET_TEMPLATE
1103# if defined(ENABLE_NEOPIXEL)
1104# if !defined(OPTION_NEOPIXEL_ORDER)
1105# error !!! A VALUE FOR OPTION_NEOPIXEL_ORDER IS REQUIRED !!!
1108# if (!((OPTION_NEOPIXEL_ORDER >= NPXL_AUTO) && (OPTION_NEOPIXEL_ORDER <= NPXL_REVERSE)))
1109# error !!! INVALID VALUE FOR OPTION_NEOPIXEL_ORDER !!!
1117# if !(HW_VERSION == 5 || HW_VERSION == 3)
1118# undef ENABLE_UPDATER
1123# if defined(OPTION_VOLTAGE_SPECIFIER)
1124# if defined(ENABLE_VSELECT)
1125# undef OPTION_VOLTAGE_SPECIFIER
1126# define OPTION_VOLTAGE_SPECIFIER VLTSPC_NONE
1127# elif ISEMPTY(OPTION_VOLTAGE_SPECIFIER)
1128# error !!! OPTION_VOLTAGE_SPECIFIER CANNOT BE EMPTY !!!
1129# elif ((OPTION_VOLTAGE_SPECIFIER < 0) || (OPTION_VOLTAGE_SPECIFIER > 3))
1130# error !!! INVALID VALUE FOR OPTION_VOLTAGE_SPECIFIER !!!
1136#pragma region Core Sanity Checks
1139# if defined(ENABLE_SMS)
1141# if !defined(OPTION_SMS_ADAPTER)
1142# define OPTION_SMS_ADAPTER 0
1143# elif !(OPTION_SMS_ADAPTER >= 0 && OPTION_SMS_ADAPTER <= OPTION_SMS_ADAPTER_MAX)
1144# error !!! INVALID VALUE FOR OPTION_SMS_ADAPTER !!!
1147# if !defined(OPTION_GG_ADAPTER)
1148# define OPTION_GG_ADAPTER 0
1149# elif !(OPTION_GG_ADAPTER >= 0 && OPTION_GG_ADAPTER <= OPTION_GG_ADAPTER_MAX)
1150# error !!! INVALID VALUE FOR OPTION_GG_ADAPTER !!!
1153# if !defined(OPTION_SG1000_ADAPTER)
1154# define OPTION_SG1000_ADAPTER 0
1155# elif !(OPTION_SG1000_ADAPTER >= 0 && OPTION_SG1000_ADAPTER <= OPTION_SG1000_ADAPTER_MAX)
1156# error !!! INVALID VALUE FOR OPTION_SG1000_ADAPTER !!!
1163# if defined(OPTION_PERFORMANCE_FLAGS)
1164# if (OPTION_PERFORMANCE_FLAGS & PRFOPT_CRC32)
1165# define __optimize_crc32 __attribute__((always_inline))
1167# if (OPTION_PERFORMANCE_FLAGS & PRFOPT_FILEWR)
1168# define __optimize_file_write __attribute__((always_inline))
1170# if (OPTION_PERFORMANCE_FLAGS & PRFOPT_FILERD)
1171# define __optimize_file_read __attribute__((always_inline))
1173# if (OPTION_PERFORMANCE_FLAGS & PRFOPT_SHRDFILE)
1174# define __optimize_shared_file __attribute__((always_inline))
1176# if (OPTION_PERFORMANCE_FLAGS & PRFOPT_SPEEDORDEATH)
1177# define OPTION_CRC32_LUT 1
1181# if !defined(__optimize_crc32)
1182# define __optimize_crc32
1184# if !defined(__optimize_file_read)
1185# define __optimize_file_read
1187# if !defined(__optimize_file_write)
1188# define __optimize_file_write
1190# if !defined(__optimize_shared_file)
1191# define __optimize_shared_file
1193# if !defined(OPTION_CRC32_LUT)
1194# define OPTION_CRC32_LUT 0
Configuration file for the Arduino IDE.
Define flags for various features/options.