Add live sensor summary display with data-driven updates - #10
Merged
Conversation
…d update display line definitions
- Formatting module: 4-line layout (headline, T/RH, accel, gyro) with 14-char per-line bounds - Multi-line write API in display_minimal HAL with bounds validation - Display thread dual Zbus subscriptions (env_data_chan, imu_data_chan) with ACTIVE-only gating - 10 new unit tests (format, multi-line API, thread integration); all 143/143 passing - Eliminated -Wformat-truncation warnings via intermediate buffer pattern Build: 133 KB flash, 34 KB RAM, zero warnings Task: TG 4.2 - Display Live Sensor Summary Dependencies: TG 1.0 ✅, TG 3.0 ✅, TG 2.0 ✅, TG 2.1 ✅
Bug: Display thread was blocking indefinitely on display_cmd_sub with K_FOREVER, never checking display_data_sub for incoming sensor data messages. Manual commands worked, but automatic data-driven display updates never triggered because the event loop was stuck waiting for commands. Root cause: First wait call on display_cmd_sub blocks the entire loop; sensor data arriving on env_data_chan/imu_data_chan doesn't wake display_cmd_sub, so data handler code after the first wait never executes. Fix: Restructure event loop to: 1. Check data messages first (non-blocking K_NO_WAIT) 2. Wait for command messages with timeout (K_MSEC(250)) instead of K_FOREVER 3. This ensures data is polled regularly while remaining responsive to commands Result: Display now updates automatically when sensors send data in ACTIVE state. Manual commands still work. Polling interval ~250ms matches 1Hz sensor rate. All tests pass: 143/143, zero warnings Build: 133 KB flash, 34 KB RAM
Issue: Console output flooded with verbose debug messages from display functions (init, on/off, write_lines) every ~250ms during data-driven updates. Fix: Removed all generic debug/info printk statements: - display_minimal_init(): Keep only errors, remove init progress messages - display_minimal_on(): Keep only errors, remove status messages - display_minimal_off(): Keep only errors, remove status messages - display_minimal_write_line(): Keep only errors, remove progress messages - display_minimal_write_lines(): Keep only errors, remove per-line debug output Retained ERROR and WARNING messages for actual failures. Result: Clean console output, display continues working correctly. Code reduction: 132 KB flash (was 133 KB) Tests: 143/143 passing Build: Zero warnings
…or summary display with data-driven updates
…y and display_thread_handle_data_update functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement a multi-line display function for sensor data, enhancing the display formatting and handling data updates efficiently. Introduce unit tests to ensure functionality and reliability, while cleaning up debug output for better console readability. Complete the task for TG 4.2, confirming all tests pass successfully.