Skip to content

Fix OLED input selection for low-voltage solar configurations - #143

Open
Solarboaters wants to merge 2 commits into
LibreSolar:mainfrom
Solarboaters:fix/oled-low-voltage-solar
Open

Solarboaters wants to merge 2 commits into
LibreSolar:mainfrom
Solarboaters:fix/oled-low-voltage-solar

Conversation

@Solarboaters

@Solarboaters Solarboaters commented Nov 12, 2026 •

Copy link
Copy Markdown

With CONFIG_UEXT_OLED_DISPLAY=y and CONFIG_LV_TERMINAL_SOLAR=y, oled_update() does not select solar_terminal. If the HV terminal is a battery, compilation fails because in_terminal is undeclared. If the HV terminal is a nanogrid, it instead selects grid_terminal and displays grid power, voltage and daily energy in the solar input fields.

Include CONFIG_LV_TERMINAL_SOLAR in the existing solar-input condition. Both LV solar combinations are permitted by app/Kconfig, and setup.cpp already maps solar_terminal to lv_terminal for this configuration.

Validation: compiled and ran the actual extracted oled_update() function in a host C++ harness with simulated display and terminal interfaces. Before the fix, LV solar + HV battery failed to compile and LV solar + HV nanogrid displayed the wrong terminal. After the fix, both selected solar readings correctly. Existing HV solar, PWM solar and nanogrid-only selections also passed. Distinct solar (123 W) and grid (789 W) inputs verified the selected data. git diff --check passed.

This is an isolated function test. The full Zephyr firmware build and physical OLED hardware have not been tested.

Evidence audit — 17 November 2026

Public revision 15a2c0a now includes tests/host/test_oled.py. Run python3 tests/host/test_oled.py with g++ installed. Five display configurations pass, including low-voltage solar with either high-voltage battery or grid. The old source either failed to compile in the former configuration or displayed grid power in the latter.

The harness compiles the actual production function with hardware/display stand-ins. It is not a firmware or physical-device test. The combined native Zephyr suite also passes 103 tests, but this native configuration does not exercise this display/LED function; only the stated host harness does.

This branch has not been deployed

No deployments
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.

1 participant