42 static void _putc(
void *p,
char c)
71 if (!airspeed.
init(&i2c1))
78 float diff_press(0),
temp(0);
79 uint32_t last_print_ms = 0;
86 airspeed.
read(&diff_press, &temp);
94 if (
millis() > last_print_ms + 50)
97 printf(
"%d.%dPa, %d.%dC\n",
98 (int32_t)(diff_press), (int32_t)(diff_press*1000)%1000,
99 (int32_t)(temp), (int32_t)(temp*1000)%1000);
volatile uint32_t millis(void)
void init(GPIO_TypeDef *gpio_port, uint16_t pin)
void init(const i2c_hardware_struct_t *c)
static volatile int16_t temp
void put_byte(uint8_t ch) override
static void _putc(void *p, char c)
void init_printf(void *putp, void(*putf)(void *, char))
void read(float *differential_pressure, float *temp)
const i2c_hardware_struct_t i2c_config[NUM_I2C]