From 64bfe73c06d6da0c3f1c4976f063f0190c07ad43 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Thu, 9 Oct 2025 00:33:50 +0800 Subject: [PATCH] fix: Move `#include "variant.h"` to top of file (fixes #8276) (#8278) * Force coverage tests to run in simulation mode * Revert "Force coverage tests to run in simulation mode" This reverts commit e4ec719e6f888c47ee3a1cc78afd2b96d5f196d1. * fix: Move `#include "variant.h"` to top of file (fixes #8276) The original line being further down the file causes any #ifdef/defined() checks for definitions in variant.h to silently skip. This was noticed when `USE_GC1109_PA` in Heltec v4 and Heltec Wireless Tracker failed to correct program TX_GAIN_LORA, but will also affect any variant.h-dependent configurations in this file, if they would have been defined above where the `#include` previously was. --------- Co-authored-by: Austin Lane Co-authored-by: Ben Meadors --- src/configuration.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index e67f0b8e5..c6c8d673c 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -33,6 +33,9 @@ along with this program. If not, see . #include "pcf8563.h" #endif +/* Offer chance for variant-specific defines */ +#include "variant.h" + // ----------------------------------------------------------------------------- // Version // ----------------------------------------------------------------------------- @@ -260,9 +263,6 @@ along with this program. If not, see . // convert 24-bit color to 16-bit (56K) #define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) -/* Step #1: offer chance for variant-specific defines */ -#include "variant.h" - #if defined(VEXT_ENABLE) && !defined(VEXT_ON_VALUE) // Older variant.h files might not be defining this value, so stay with the old default #define VEXT_ON_VALUE LOW