BMP180_ERROR=255 was an in-band sentinel returned by uint16_t I/O helpers
(read16, readRawTemperature) on I2C failure. 255 is also a valid uint16
register reading (0x00FF appears across the calibration block and is
reachable as a raw temperature/pressure sample), so a sensor failure was
indistinguishable from a real reading.
getTemperature() additionally narrowed the uint16_t raw read to int16_t
before passing to computeB5(). Raw bit-patterns >= 0x8000 (reachable across
the BMP180 -40..+85 C operating window) flipped to negative int16_t and
sign-extended into computeB5(), producing temperature errors of order
100s of C (e.g. -347 C instead of +51 C for raw UT = 0x8000).
Fix:
- Internal I/O helpers (read8/read16/readRawTemperature/readRawPressure)
now return bool and pass the value through an out-param. None of the
new sentinels collide with valid sensor output:
* getTemperature -> NaN on error
* getPressure -> INT32_MIN on error
* getSeaLevelPressure -> INT32_MIN on error
- getTemperature() keeps raw as uint16_t and widens value-preservingly
via (int32_t)raw before computeB5().
- readRawPressure() reads XLSB through the bool-out-param contract;
previously OR'd in 0xFF on I2C fail, silently corrupting the LSB.
Verification: test_audit_c17_bmp180_sentinel_and_cast 4/4 PASS, including
datasheet UT=27898 -> 15.0 C reproduction and 64/64 finite outputs across
a full uint16 sweep (vs 32/32 collapses in the upper half under the buggy
narrowing). Full MCU regression 32/32 PASS.
Caller-side: no external code references BMP180_ERROR; main.cpp's existing
range check at the health-watchdog catches INT32_MIN via the < 30000.0
branch.
42 lines
962 B
Plaintext
42 lines
962 B
Plaintext
# Build artifacts
|
|
*.o
|
|
*.dSYM/
|
|
|
|
# Test binaries (built by Makefile)
|
|
# TESTS_WITH_REAL
|
|
test_bug1_timed_sync_init_ordering
|
|
test_bug3_timed_sync_noop
|
|
test_bug4_phase_shift_before_check
|
|
test_bug5_fine_phase_gpio_only
|
|
test_bug9_platform_ops_null
|
|
test_bug10_spi_cs_not_toggled
|
|
test_bug15_htim3_dangling_extern
|
|
|
|
# TESTS_MOCK_ONLY
|
|
test_bug2_ad9523_double_setup
|
|
test_bug6_timer_variable_collision
|
|
test_bug7_gpio_pin_conflict
|
|
test_bug8_uart_commented_out
|
|
test_bug14_diag_section_args
|
|
test_gap3_emergency_stop_rails
|
|
|
|
# TESTS_STANDALONE
|
|
test_bug12_pa_cal_loop_inverted
|
|
test_bug13_dac2_adc_buffer_mismatch
|
|
test_audit_c17_bmp180_sentinel_and_cast
|
|
test_gap3_iwdg_config
|
|
test_gap3_temperature_max
|
|
test_gap3_idq_periodic_reread
|
|
test_gap3_emergency_state_ordering
|
|
test_gap3_overtemp_emergency_stop
|
|
test_gap3_health_watchdog_cold_start
|
|
|
|
# TESTS_WITH_PLATFORM
|
|
test_bug11_platform_spi_transmit_only
|
|
|
|
# TESTS_WITH_CXX
|
|
test_agc_outer_loop
|
|
|
|
# Manual / one-off test builds
|
|
test_um982_gps
|