Add more sanity checks to OSCR.h

This commit is contained in:
Ancyker 2025-01-27 13:41:57 -05:00
parent 3ccab84048
commit 61c17b2c80
No known key found for this signature in database
GPG Key ID: 841A6B28CD25A744

View File

@ -15,10 +15,16 @@
#include "Config.h"
/*==== SANITY CHECKS ==============================================*/
// Error if no hardware version is enabled
# if !(defined(HW1) || defined(HW2) || defined(HW3) || defined(HW4) || defined(HW5) || defined(SERIAL_MONITOR))
# error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!!
# endif
// Error if more than one hardware version is enabled
# if (defined(HW1) + defined(HW2) + defined(HW3) + defined(HW4) + defined(HW5) + defined(SERIAL_MONITOR)) > 1
# error !!! PLEASE CHOOSE ONLY ONE HARDWARE VERSION IN CONFIG.H !!!
# endif
// Let user know unsafe configs are allowed
# if defined(ALLOW_UNSAFE_CONFIG)
// Error if defined during GitHub CI tests. This should not happen unless someone accidentally committed their Config.h
@ -67,6 +73,26 @@
# endif /* ENABLE_VSELECT */
// ENABLE_SERIAL && ENABLE_3V3FIX are incompatible options
# if defined(ENABLE_SERIAL) && defined(ENABLE_3V3FIX)
# if defined(ALLOW_UNSAFE_CONFIG)
# warning Using a configuration with ENABLE_SERIAL and ENABLE_3V3FIX is incompatible.
# else /* !defined(ALLOW_UNSAFE_CONFIG) */
# error Using a configuration with ENABLE_SERIAL and ENABLE_3V3FIX is incompatible. \
If you are a developer trying to make this work you can define ALLOW_UNSAFE_CONFIG in Config.h to allow compiling.
# endif /* ALLOW_UNSAFE_CONFIG */
# endif /* ENABLE_SERIAL && ENABLE_3V3FIX */
// ENABLE_SERIAL && ENABLE_UPDATER are incompatible options
# if defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
# if defined(ALLOW_UNSAFE_CONFIG)
# warning Using a configuration with ENABLE_SERIAL and ENABLE_UPDATER is incompatible.
# else /* !defined(ALLOW_UNSAFE_CONFIG) */
# error Using a configuration with ENABLE_SERIAL and ENABLE_UPDATER is incompatible. \
If you are a developer trying to make this work you can define ALLOW_UNSAFE_CONFIG in Config.h to allow compiling.
# endif /* ALLOW_UNSAFE_CONFIG */
# endif /* ENABLE_SERIAL && ENABLE_UPDATER */
/*==== CONSTANTS ==================================================*/
/**
* String Constants