sl-firmware e80b157092 fix: resolve all compile/linker errors (Issue #337)
Fixed 7 critical errors preventing firmware build:
- watchdog.c: Store IWDG handle in WatchdogState struct (fixes &IWDG lvalue error)
- servo.c: Remove duplicate ServoState typedef, use anonymous struct
- ultrasonic.c: Add static TIM_HandleTypeDef for ISR access, fix HAL macro calls
- ultrasonic.c: Replace HAL_TIM_IC_Init_Compat with HAL_TIM_IC_ConfigChannel
- main.c: Add bno055_active, imu_calibrated(), crsf_is_active() helper functions
- main.c: Fix buzzer call buzzer_play() -> buzzer_play_melody(MELODY_STARTUP)
- i2c1.c/h: Add i2c1_read() and i2c1_write() functions for sensor support

Build: pio run now passes with [SUCCESS]
Memory: RAM 6.5%, Flash 10.8%

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-03 18:53:15 -05:00

21 lines
490 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, uint16_t len);
int i2c1_read(uint8_t addr, uint8_t *data, uint16_t len);
#endif /* I2C1_H */