From 9e59a824ee83e8967287c44baf687a05a2c326fa Mon Sep 17 00:00:00 2001 From: Spence Konde Date: Sun, 24 Sep 2023 09:38:37 -0400 Subject: [PATCH] fix #1002 --- megaavr/cores/megatinycore/core_parameters.h | 59 +++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/megaavr/cores/megatinycore/core_parameters.h b/megaavr/cores/megatinycore/core_parameters.h index 9fa80735..31abc750 100644 --- a/megaavr/cores/megatinycore/core_parameters.h +++ b/megaavr/cores/megatinycore/core_parameters.h @@ -21,10 +21,67 @@ // The whole purpose of this file is largely for for the purpose of being something that can be included anywhere to make sure we know what core we are // which becomes more and more important as more code is shared between the cores. - #define MEGATINYCORE "Unknown 2.6.1+" + #define MEGATINYCORE "Unknown 2.6.9+" #else #if defined(DXCORE) || defined(ATTINYCORE) #error "This is megaTinyCore being compiled, but DXCORE and/or ATTINYCORE is defined already, something is way wrong." #endif #endif + + +/* Check for invalid options, mostly to help point the PIO and other third party IDE users in the right direction */ + +#if defined(MILLIS_USE_TIMERA0) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERA0 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERA1) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERA1 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERB0) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERB0 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERB1) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERB1 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERB2) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERB2 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERB3) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERA0) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERB3 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERD0) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERA0) || defined(MILLIS_USE_TIMERRTC) || defined(MILLIS_USE_TIMERRTC_XTAL)) + #error "MILLIS_USE_TIMERB5 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERRTC) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERA0)) + #error "MILLIS_USE_TIMERE0 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERRTC_XTAL) && (defined(MILLIS_USE_TIMERNONE) || \ + defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || \ + defined(MILLIS_USE_TIMERA1) || defined(MILLIS_USE_TIMERD0) || defined(MILLIS_USE_TIMERA0)) + #error "MILLIS_USE_TIMERF0 and another timer are set as the millis timer. Specify one only. If this occurred on the Arduino IDE, please report it promptly." +#endif +#if defined(MILLIS_USE_TIMERE0) || defined(MILLIS_USE_TIMERF0) + #error "A millis timer not supported on this core was passed. this should only be possible on third party IDEs. " +#endif +#if defined(UARTBAUD5V) || defined(UARTBAUD3V) + #warning "The UARTBAUDxV baud rate correction was removed in 2.3.0 because it had excessive overhead and negligible benefit. The define you specified does nothing." +#endif +#endif + #endif