sl-firmware c0d946f858
Some checks failed
social-bot integration tests / Lint (flake8 + pep257) (pull_request) Failing after 5s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (pull_request) Has been skipped
social-bot integration tests / Latency profiling (GPU, Orin) (pull_request) Has been cancelled
fix: resolve all compile/linker errors (Issue #337)
Fixed multiple compilation and linker errors:
- watchdog.c: Store IWDG handle in struct for proper refresh calls
- battery.c: Add missing #include <stdbool.h>
- battery.h: Add missing #include <stdbool.h>
- servo.c: Remove duplicate ServoState typedef (moved to static struct)
- ultrasonic.c: Use static TIM handle shared with ISR, fix HAL macro calls
- main.c: Add helper functions for bno055_active, imu_calibrated(), crsf_is_active()
- main.c: Fix buzzer_play() call to buzzer_play_melody(MELODY_STARTUP)
- i2c1.c/h: Add i2c1_write() and i2c1_read() functions

pio run now passes with zero errors.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-03 17:32:09 -05:00

21 lines
480 B
C

#ifndef I2C1_H
#define I2C1_H
#include "stm32f7xx_hal.h"
/*
* Shared I2C1 bus handle — used by baro (BMP280/DPS310) and mag
* (QMC5883L/HMC5883L/IST8310) drivers.
*
* Call i2c1_init() once in main() before any I2C probes.
* PB8 = SCL, PB9 = SDA (AF4_I2C1, open-drain, 100 kHz).
*/
extern I2C_HandleTypeDef hi2c1;
int i2c1_init(void);
int i2c1_write(uint8_t addr, const uint8_t *data, int len);
int i2c1_read(uint8_t addr, uint8_t *data, int len);
#endif /* I2C1_H */