FW: fix issues exposed by codechecker - #256
Conversation
|
Build output available: |
CodeChecker static analysis✅ No non-style issues found. |
|
Build output available: |
2a83a4d to
fa9f7c5
Compare
|
Build output available: |
|
Build output available: |
e509194 to
5c96030
Compare
|
Build output available: |
|
Build output available: |
|
Build output available: |
fc1d581 to
102bf62
Compare
|
Build output available: |
102bf62 to
376d6e2
Compare
|
Build output available: |
376d6e2 to
1a71b9f
Compare
|
Build output available: |
1a71b9f to
afe5f09
Compare
|
Build output available: |
afe5f09 to
dcd8df4
Compare
|
Build output available: |
Include the standard and project headers that declare functions used by each translation unit. This lets Clang analyze the files independently instead of relying on transitive includes.
Document the intended loss of precision when storing sensor and parsed values in 32-bit fields. Match variadic format arguments to the unsigned integer type expected by %X while preserving the existing lower-32-bit output.
Call std::fabs for the battery-capacity difference so overload resolution is explicit and the comparison remains in floating-point arithmetic.
The connection callback returns void, so stop processing with a plain return after a parameter-update failure instead of attempting to return the error value.
Initialize the application LED state and BMP388 FIFO sample data before they are passed to downstream code. This prevents uninitialized fields from being observed on valid error and partial-frame paths.
Only adjust and consume the FIFO length after reading it successfully. This avoids updating FIFO state or issuing a read with an undefined length after an I/O failure.
Return before selecting the Earable button when the callback does not contain its pin. This prevents dereferencing an uninitialized button pointer for an unexpected interrupt mask.
Reuse the released TX buffer when no alternative buffer is available so tx_buf cannot remain null before memset().
Validate the stereo channel count before consuming both channel pointers. If encoding fails, drop the frame instead of entering the fatal error path, log once until recovery, and never send stale encoded data.
Initialize the conditionally compiled scan parameter to NULL and describe the chip-ID copy in terms of its actual alignment and aliasing constraints.
Continue through volume and mute restoration when a codec step fails, return the first error, and only persist the requested mode after all hardware operations succeed.
dcd8df4 to
db967f9
Compare
|
Build output available: |
Track the rare I2S underrun fallback where no alternate TX buffer is available and the released TX buffer is reused as silence. Log the first occurrence and then rate-limit later warnings so this recovery path does not fail silently during testing.
|
Build output available: |
o-bagge
left a comment
There was a problem hiding this comment.
I made some changes to improve audio and bluetooth robustness by making failure paths explicit instead of silent.
The encoder path now drops transient encode failures safely, logs failures and recovery, and treats persistent or non-recoverable codec errors as fatal. I2S underrun recovery now logs when a released TX buffer is reused as silence, making rare fallback behavior visible during testing. BLE scan parsing was tightened to avoid reading past odd-length service data, and audio mode GATT writes now report codec mode switch failures back to the client.
|
what does "treat as fatal" mean? |
The old code logged encoder errors and silently dropped frames. Now, on certain error codes, or after 100 consecutive failures it invokes the fatal handler and crashes/reboots the firmware. I changed it in 2f77711 |
Fix issues exposed by CodeChecker workflow
Some CodeChecker findings were intentionally silenced while preserving existing behavior instead of redesigning the underlying error handling. For example, several ignored driver return values were made explicit with
(void)casts.Possible follow-up issues:
(void).bmp3_init()failures and ensure FIFO pressure compensation only uses valid temperature data.