sl-perception created pull request seb/saltylab-firmware#673

sl-perception
Tue, 17 Mar 2026 18:35:53 -0400

673#feat: BME280 baro pressure & ambient temp (Issue #672)#

Summary

New baro module reads BME280/BMP280 at 1 Hz on I2C1 (Mamba F722S), computes ISA pressure altitude, publishes JLINK_TLM_BARO (0x8D) to Orin — fully Mamba-local, no Orin dependency

New JLink telemetry frame 0x8D (jlink_tlm_baro_t, 12 bytes packed): pressure_pa, temp_x10, alt_cm, humidity_pct_x10 (-1 on BMP280)

baro_get_alt_cm() exposes altitude for slope compensation in the balance PID

Wired into main.c: baro_init() after bmp280_init(), baro_tick(now) each ms (self-rate-limits to 1 Hz)

Test plan

Build: gcc -I include -I test/stubs -DTEST_HOST -lm -o /tmp/test_baro test/test_baro.c && /tmp/test_baro -> 31/31 pass

Flash to Mamba, confirm JLINK_TLM_BARO frames appear on JLink at 1 Hz

Verify pressure_pa ~101325 Pa at bench, temp_x10 within +-50 of ambient

Verify alt_cm reasonable at test site elevation

On BME280: confirm humidity_pct_x10 in 200-900 range; on BMP280: confirm -1

Existing test_slope_estimator.c unaffected: 35/35 pass

Generated with Claude Code