CYD touch axes flipped and re-compiled and fixed it for the generic CYD_2432S028 variant
Describe the bug
On the cyd_2432s028 hardware configuration variant, the touchscreen inputs are completely inverted on both the X and Y axes. Tapping elements on the screen causes touch actions to register at the opposite ends of the display layout canvas, making the user interface completely unusable on this specific profile.
To Reproduce Steps to reproduce the behavior:
- Compile the firmware using the
cyd_2432s028build configuration target. - Flash the compiled binary onto a Cheap Yellow Display Micro board (ESP32-2432S024C / ST7789 or equivalent variation).
- Power on the device and attempt to click any menu button on the touch screen.
- See error: The button press registers on the completely mirrored/opposite side of where your finger actually pressed.
Expected behavior Touch coordinate variables should perfectly track the position of the finger press across the display boundaries so UI buttons can be reliably selected.
Screenshots (If applicable, drag and drop any photos or short videos of your screen behaving incorrectly here.)
Marauder (please complete the following information if applicable):
- Firmware version: v1.17.0
- Hardware version: cyd_2432s028 (Cheap Yellow Display Micro / ESP32-2432S024C)
Desktop (please complete the following information if applicable):
- OS: N/A
- Browser: N/A
- Version: N/A
Smartphone (please complete the following information if applicable):
- Device: N/A
- OS: N/A
- Browser: N/A
- Version: N/A
Additional context
The issue can be cleanly fixed at the compiler level inside esp32_marauder/Display.cpp. Inside the updateTouch function loop block mapped for the HAS_CYD_TOUCH definition, resolving math lines should be injected right before returning the state:
case 3:
*x = map(p.y, 3800, 240, 1, TFT_WIDTH);
*y = map(p.x, 200, 3700, 1, TFT_HEIGHT);
break;
}
// FIX: Invert both axes using the driver's native resolution flags
*x = TFT_WIDTH - *x;
*y = TFT_HEIGHT - *y;
return 1;
}I successfully tested this fix locally via the build_parallel.yml environment actions matrix pipeline.
I have attached the fully functional, working binary with this exact fix applied below:
Source: justcallmekoko/ESP32Marauder