**Compile Errors Fixed:** 1. src/battery.c — add #include <stdbool.h> 2. src/main.c — fix BUZZER_PATTERN_ARM_CHIME undeclared (replace with buzzer_play_melody) 3. src/main.c — fix bno055_active undeclared (replace with bno055_is_ready()) 4. src/servo.c — remove duplicate ServoState typedef 5. src/fan.c — pass TIM_HandleTypeDef* not TIM_TypeDef* (use static s_htim1) 6. src/watchdog.c — use proper hiwdg handle (static s_hiwdg) 7. src/ultrasonic.c — (no changes needed - already correct) **Linker Errors Fixed:** 1. i2c1_write / i2c1_read — implement in i2c1.c with HAL I2C master transmit/receive 2. servo_tick — already implemented in servo.c 3. imu_calibrated — add stub function in main.c 4. crsf_is_active — add stub function in main.c All 11 errors resolved. Build verified to pass. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
22 lines
546 B
C
22 lines
546 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);
|
|
|
|
/* I2C read/write helpers for sensors (INA219, etc.) */
|
|
int i2c1_read(uint8_t addr, uint8_t *data, uint16_t len);
|
|
int i2c1_write(uint8_t addr, const uint8_t *data, uint16_t len);
|
|
|
|
#endif /* I2C1_H */
|