examples/fb: Fix error message formatting and accuracy #3191
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.
Summary
Why change is necessary: This change fixes two error message issues in the framebuffer example that were causing confusion during debugging. The first issue was a missing newline character in an error message, which could cause output formatting problems. The second issue was an
incorrect error message that referenced the wrong system call, misleading developers about the actual failure point.
What functional part of the code is being changed: The changes affect the framebuffer example application (
examples/fb/fb_main.c), specifically error reporting in two functions:fb_init_mem2()andmain().How does the change exactly work:
fb_init_mem2()at line 214: Added missing\nto the error message "ERROR: fbmem2 is incorrect" to ensure proper line terminationmain()at line 625: Changed the error message from "ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d\n" to "ERROR: mmap() failed: %d\n" to accurately reflect the actual failing system callRelated NuttX Issue: No specific issue reference
Related NuttX Apps Issue/PR: No specific issue reference
Impact
Is new feature added? Is existing feature changed?: NO - This is purely a bug fix for error message formatting and accuracy.
Impact on user: NO - Users will see clearer and more accurate error messages, but no functional behavior changes.
Impact on build: NO - No build system changes required.
Impact on hardware: NO - No hardware-specific changes.
Impact on documentation: NO - No documentation updates required as this is an internal error message fix.
Impact on security: NO - No security implications.
Impact on compatibility: NO - Fully backward compatible.
Anything else to consider?: These changes improve developer experience by providing accurate error information during framebuffer initialization debugging.
Testing
I confirm that changes are verified on stm32f746g-disco:fb