43 static void _putc(
void *p,
char c)
89 float diff_press(0.0), as_temp(0.0);
93 uint32_t last_print = 0;
109 double seconds =
millis()/1000.0;
117 for (
int i =0;
i < 3;
i++) mag_data[
i] = 0.0;
129 if (
pressure == 0.0 || baro_temp == 0.0 || mag_data[0] == 0.0)
134 if (
millis() > last_print + 20)
136 if (count++ % 10 == 0)
139 printf(
"t: %.2f\t", seconds);
140 printf(
"baro: %d Pa, %.2f K\t", (int32_t)
pressure, (
double)baro_temp);
141 printf(
"mag: %d, %d, %d\t",(int32_t)(mag_data[0]),(int32_t)(mag_data[1]),(int32_t)(mag_data[2]));
volatile uint32_t millis(void)
void init(GPIO_TypeDef *gpio_port, uint16_t pin)
void init(const i2c_hardware_struct_t *c)
void put_byte(uint8_t ch) override
static void _putc(void *p, char c)
void init_printf(void *putp, void(*putf)(void *, char))
bool read(float mag_data[])
const i2c_hardware_struct_t i2c_config[NUM_I2C]
void read(float *press, float *temp)