From 716e76c7311497010419650468d788b9a42de8a3 Mon Sep 17 00:00:00 2001 From: Jadon Floyd <167924934+jadonfloyd@users.noreply.github.com> Date: Fri, 27 Nov 2026 22:50:37 -0700 Subject: [PATCH] Make Wio Tracker L1 joystick pins overridable Wrap the JOYSTICK_* pin defines in variants/wio-tracker-l1/variant.h in #ifndef guards so builds can remap them with -D flags, e.g. for enclosures that mount the display rotated 90 degrees relative to the joystick. No change to default behavior. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XZSU585Bf7KxVsYxYZyfun --- variants/wio-tracker-l1/variant.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/variants/wio-tracker-l1/variant.h b/variants/wio-tracker-l1/variant.h index 86ad62ba..433289d1 100644 --- a/variants/wio-tracker-l1/variant.h +++ b/variants/wio-tracker-l1/variant.h @@ -32,11 +32,25 @@ #define PIN_BUTTON5 (28) // Joystick Right #define PIN_BUTTON6 (29) // Joystick Press #define PIN_BACK_BTN PIN_BUTTON1 +// Joystick pins can be overridden from build_flags, e.g. for an enclosure +// that mounts the display rotated 90 degrees relative to the joystick: +// -D JOYSTICK_UP=PIN_BUTTON4 -D JOYSTICK_DOWN=PIN_BUTTON5 +// -D JOYSTICK_LEFT=PIN_BUTTON3 -D JOYSTICK_RIGHT=PIN_BUTTON2 +#ifndef JOYSTICK_UP #define JOYSTICK_UP PIN_BUTTON2 +#endif +#ifndef JOYSTICK_DOWN #define JOYSTICK_DOWN PIN_BUTTON3 +#endif +#ifndef JOYSTICK_LEFT #define JOYSTICK_LEFT PIN_BUTTON4 +#endif +#ifndef JOYSTICK_RIGHT #define JOYSTICK_RIGHT PIN_BUTTON5 +#endif +#ifndef JOYSTICK_PRESS #define JOYSTICK_PRESS PIN_BUTTON6 +#endif #define PIN_USER_BTN PIN_BUTTON6 // Buzzer