mirror of
https://github.com/sanni/cartreader.git
synced 2025-04-11 09:51:21 +02:00
Add more sanity checks to OSCR.h
This commit is contained in:
parent
3ccab84048
commit
61c17b2c80
@ -15,10 +15,16 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
/*==== SANITY CHECKS ==============================================*/
|
/*==== SANITY CHECKS ==============================================*/
|
||||||
|
// Error if no hardware version is enabled
|
||||||
# if !(defined(HW1) || defined(HW2) || defined(HW3) || defined(HW4) || defined(HW5) || defined(SERIAL_MONITOR))
|
# if !(defined(HW1) || defined(HW2) || defined(HW3) || defined(HW4) || defined(HW5) || defined(SERIAL_MONITOR))
|
||||||
# error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!!
|
# error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!!
|
||||||
# endif
|
# 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
|
// Let user know unsafe configs are allowed
|
||||||
# if defined(ALLOW_UNSAFE_CONFIG)
|
# if defined(ALLOW_UNSAFE_CONFIG)
|
||||||
// Error if defined during GitHub CI tests. This should not happen unless someone accidentally committed their Config.h
|
// 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 */
|
# 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 ==================================================*/
|
/*==== CONSTANTS ==================================================*/
|
||||||
/**
|
/**
|
||||||
* String Constants
|
* String Constants
|
||||||
|
Loading…
x
Reference in New Issue
Block a user