Skip to content

First attempt at porting to c800x480 resolution#295

Open
Amigache wants to merge 6 commits intoyaapu:masterfrom
Amigache:screen-color-800x480
Open

First attempt at porting to c800x480 resolution#295
Amigache wants to merge 6 commits intoyaapu:masterfrom
Amigache:screen-color-800x480

Conversation

@Amigache
Copy link
Copy Markdown

This PR attempts to be a basic approach for adapting the new resolution of the TX16S MK3 transmitters. Various adjustments have been made to offsets, coordinates, and resizing of some bitmaps. Validation of the various available configurations is still required.

- Adjusted positioning of battery voltage and current displays in right_dualbatt_def.lua, right_hybrid_def.lua, right_nocellv_def.lua, and right_tether_def.lua for improved alignment.
- Updated the drawing coordinates for various text and graphical elements to enhance visual clarity across multiple widget definitions.
- Modified the main.lua to reposition RSSI and telemetry information for better readability and consistency.
- Increased the height of the menu bar and adjusted text positions in menu.lua to accommodate new layout requirements.
- Removed unnecessary touch event handling code to streamline the menu interaction process.
@Amigache
Copy link
Copy Markdown
Author

Amigache commented Mar 7, 2026

I've continued making some adjustments for those who are impatient. It's possible you might encounter CPU limit issues; the code has only been superficially ported to 800x480.

image image

@colinmac61
Copy link
Copy Markdown

Awesome effort! I just got my MK3 only to discover the 480x272 would not work on the 800x480 screen, no surprise. :-(
Thanks Again!

@Amigache
Copy link
Copy Markdown
Author

Last Commit Summary

Fixes a runtime crash when switching to newly introduced or unmapped flight modes (e.g. AUTOLAND) and corrects vehicle-arrow centering in the 800x480 map view.

Fixes Included

  • Added a defensive nil check before string.upper(...) in flight-mode transition logic to prevent:
    • ERROR in refresh(): bad argument #1 to upper (string expected got nil)
  • Extended Plane flight mode tables to support additional ArduPlane modes:
    • 26 -> LoiterAltQLand
    • 27 -> Autoland
  • Fixed map centering for 800x480 by replacing a fixed horizontal tile offset with a dynamic center-tile calculation (for a 7x3 map grid), so the vehicle arrow remains visually centered.

Impact

  • Prevents refresh() crashes with new/unknown flight modes.
  • Improves compatibility with newer ArduPlane mode sets.
  • Fixes map alignment behavior specifically on 800x480 layouts.

Validation

  • Syntax/error checks on modified files report no issues.
  • Expected behavior after this PR:
    • No crash when entering AUTOLAND.
    • Correct vehicle-arrow centering on the 800x480 map screen.

@Amigache
Copy link
Copy Markdown
Author

Fix: CPU limit error on HUD screen (EdgeTX c800x480, H7)

Root cause: drawFullScreen() called backgroundTasks(widget, 15) with a
hardcoded value, ignoring the telemetryPopLoops variable that loadConfig()
already adjusts per protocol (CRSF → 8). On the 800×480 canvas (~2.7× larger
than other variants) this consistently hit the EdgeTX CPU watchdog.

Fixes applied across c800x480 / c480x272 / c480x320:

  • main.lua: use backgroundTasks(widget, telemetryPopLoops) instead of hardcoded 15; lower base value to 10 on c800x480; cache lcd.RGB(140,140,140) in drawMessagesTelemetryBar
  • hud_def.lua: reduce lineCount 8→6 on c800x480; move lcd.RGB(10,20,30) (airspeed box) to panel.init; declare varioY as local
  • layoutlib.lua: cache getFieldInfo("tx-voltage") id (resolve once); cache formatted time string, regenerate only on second change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants