Skip to content

Commit f4710b2

Browse files
committed
Enable a 1PPS input on PixRacer Pro board. Tweaked header structure
1 parent 85fdb3a commit f4710b2

30 files changed

+293
-460
lines changed

boards/varmint_h7/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ cmake_install.cmake
1616
varmint_11x/
1717
varmint_11x_test/
1818
varmint_12x/
19+
Liv4f.*

boards/varmint_h7/common/drivers/Adc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void Adc::endDma(ADC_HandleTypeDef * hadc)
193193
}
194194

195195
p.header.timestamp = drdy_;
196-
p.read_complete = time64.Us();
196+
p.header.complete = time64.Us();
197197
write((uint8_t *) &p, sizeof(p));
198198
ext_read = 0;
199199
int_read = 0;
@@ -206,7 +206,7 @@ bool Adc::display(void)
206206
char name[] = "Adc (adc)";
207207

208208
if (read((uint8_t *) &p, sizeof(p))) {
209-
misc_header(name, p.header.timestamp, p.read_complete );
209+
misc_header(name, p.header);
210210
misc_printf("\n");
211211

212212
misc_printf(" %-8s : ", "STM");

boards/varmint_h7/common/drivers/Adis165xx.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void Adis165xx::endDma(void) // called when DMA data is ready
235235
if (sum == data[10]) {
236236
ImuPacket p;
237237
p.header.timestamp = drdy_;
238-
p.read_complete = time64.Us(); p.header.status = (uint16_t) data[1];
238+
p.header.complete = time64.Us(); p.header.status = (uint16_t) data[1];
239239
p.gyro[0] = -(double) data[2] * 0.001745329251994; // rad/s, or use 0.1 deg/s
240240
p.gyro[1] = -(double) data[3] * 0.001745329251994; // rad/s, or use 0.1 deg/s
241241
p.gyro[2] = (double) data[4] * 0.001745329251994; // rad/s, or use 0.1 deg/s
@@ -258,7 +258,7 @@ void Adis165xx::endDma(void) // called when DMA data is ready
258258
if (sum == data[16]) {
259259
ImuPacket p;
260260
p.header.timestamp = drdy_;
261-
p.read_complete = time64.Us();
261+
p.header.complete = time64.Us();
262262
p.header.status = (uint16_t) data[1];
263263
p.gyro[0] = val(rx + 4) * 0.001745329251994; // rad/s, or use 0.1 deg/s
264264
p.gyro[1] = val(rx + 8) * 0.001745329251994; // rad/s, or use 0.1 deg/s
@@ -310,7 +310,7 @@ bool Adis165xx::display(void)
310310
ImuPacket p;
311311
char name[] = "Adis165xx (imu)";
312312
if (read((uint8_t *) &p, sizeof(p))) {
313-
misc_header(name, p.header.timestamp, p.read_complete );
313+
misc_header(name, p.header );
314314
misc_f32(nan(""), nan(""), p.accel[0] / 9.80665, "ax", "%6.2f", "g");
315315
misc_f32(nan(""), nan(""), p.accel[1] / 9.80665, "ay", "%6.2f", "g");
316316
misc_f32(nan(""), nan(""), p.accel[2] / 9.80665, "az", "%6.2f", "g");

boards/varmint_h7/common/drivers/Auav.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void Auav::endDma(void)
289289
spiState_ = STATUS_IDLE;
290290
if(p.header.status==sensor_status_ready_[AUAV_PITOT]) // PTT uncomment if needed
291291
{
292-
p.read_complete = time64.Us();
292+
p.header.complete = time64.Us();
293293
write2((uint8_t *) &p, sizeof(p), AUAV_PITOT);
294294
}
295295
} else if (spiState_ == STATUS_BARO_READ) { // Done starting Baro
@@ -299,7 +299,7 @@ void Auav::endDma(void)
299299
spiState_ = STATUS_IDLE;
300300
if(p.header.status==sensor_status_ready_[AUAV_BARO]) // PTT uncomment this when we fix the sensor.
301301
{
302-
p.read_complete = time64.Us();
302+
p.header.complete = time64.Us();
303303
write2((uint8_t *) &p, sizeof(p), AUAV_BARO);
304304
}
305305
} else {
@@ -395,7 +395,7 @@ bool Auav::display(void)
395395
PressurePacket p;
396396

397397
if (read2((uint8_t *) &p, sizeof(p), AUAV_BARO)) {
398-
misc_header(name_local_[AUAV_BARO], p.header.timestamp, p.read_complete);
398+
misc_header(name_local_[AUAV_BARO], p.header);
399399

400400
misc_f32(99, 101, p.pressure / 1000., "Press", "%6.2f", "kPa");
401401
misc_f32(18, 50, p.temperature - 273.15, "Temp", "%5.1f", "C");
@@ -407,7 +407,7 @@ bool Auav::display(void)
407407
}
408408

409409
if (read2((uint8_t *) &p, sizeof(p), AUAV_PITOT)) {
410-
misc_header(name_local_[AUAV_PITOT], p.header.timestamp, p.read_complete);
410+
misc_header(name_local_[AUAV_PITOT], p.header );
411411
misc_f32(-5.0, 5.0, p.pressure, "Press", "%6.2f", "Pa");
412412
misc_f32(18, 50, p.temperature - 273.15, "Temp", "%5.1f", "C");
413413
misc_x16(sensorOk(AUAV_PITOT), p.header.status, "Status");

boards/varmint_h7/common/drivers/Bmi088.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ void Bmi088::endDma(void) // DMA complete routine
330330
data = (int16_t) rx[6] << 8 | (int16_t) rx[5];
331331
p.gyro[2] = scale_factor * (double) data;
332332

333-
p.read_complete = time64.Us();
333+
p.header.complete = time64.Us();
334334
p.header.timestamp = drdy_;
335335

336336
rotate(p.gyro);
@@ -383,7 +383,7 @@ bool Bmi088::display(void)
383383
ImuPacket p;
384384
char name[] = "Bmi088 (imu)";
385385
if (read((uint8_t *) &p, sizeof(p))) {
386-
misc_header(name, p.header.timestamp, p.read_complete );
386+
misc_header(name, p.header );
387387
misc_f32(nan(""), nan(""), p.accel[0] / 9.80665, "ax", "%6.2f", "g");
388388
misc_f32(nan(""), nan(""), p.accel[1] / 9.80665, "ay", "%6.2f", "g");
389389
misc_f32(nan(""), nan(""), p.accel[2] / 9.80665, "az", "%6.2f", "g");

boards/varmint_h7/common/drivers/DlhrL20G.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void DlhrL20G::endDma(void)
158158
p.header.status = dlhr_i2c_dma_buf[0];
159159
if (p.header.status == 0x0040) {
160160
p.header.timestamp = drdy_;
161-
p.read_complete = time64.Us();
161+
p.header.complete = time64.Us();
162162
uint32_t i_pressure =
163163
(uint32_t) dlhr_i2c_dma_buf[1] << 16 | (uint32_t) dlhr_i2c_dma_buf[2] << 8 | (uint32_t) dlhr_i2c_dma_buf[3];
164164
uint32_t i_temperature =
@@ -179,7 +179,7 @@ bool DlhrL20G::display(void)
179179
PressurePacket p;
180180
char name[] = "DlhrL20G (pitot)";
181181
if (read((uint8_t *) &p, sizeof(p))) {
182-
misc_header(name, p.header.timestamp, p.read_complete );
182+
misc_header(name, p.header );
183183
misc_f32(-5, 5, p.pressure, "Press", "%6.2f", "Pa");
184184
misc_f32(18, 50, p.temperature - 273.15, "Temp", "%5.1f", "C");
185185
misc_x16(DLHRL20G_OK, p.header.status, "Status");

boards/varmint_h7/common/drivers/Dps310.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void Dps310::endDma(void)
363363
{
364364
if (rx[1] & 0x10) {
365365
p.header.status |= (uint16_t) rx[1];
366-
p.read_complete = time64.Us();
366+
p.header.complete = time64.Us();
367367
}
368368
} else if (spiState_ == DPS310_DRDY_T) // Temperature DRDY
369369
{
@@ -380,7 +380,7 @@ void Dps310::endDma(void)
380380
p.pressure = C00_ + Praw * (C10_ + Praw * (C20_ + Praw * C30_)) + Traw * (C01_ + Praw * (C11_ + Praw * C21_)); // Pa
381381

382382
p.header.timestamp = drdy_;
383-
p.read_complete = time64.Us();
383+
p.header.complete = time64.Us();
384384
if (p.header.status == DPS310_OK) write((uint8_t *) &p, sizeof(p));
385385
p.header.status = 0;
386386
}
@@ -394,7 +394,7 @@ bool Dps310::display(void)
394394
PressurePacket p;
395395

396396
if (read((uint8_t *) &p, sizeof(p))) {
397-
misc_header(name_, p.header.timestamp, p.read_complete );
397+
misc_header(name_, p.header );
398398
misc_f32(98, 101, p.pressure / 1000., "Press", "%6.2f", "kPa");
399399
misc_f32(18, 50, p.temperature - 273.15, "Temp", "%5.1f", "C");
400400
misc_x16(DPS310_OK, p.header.status, "Status");

boards/varmint_h7/common/drivers/Iis2mdc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void Iis2mdc::endDma(void)
220220
if (spiState_ == IIS2MDC_RX_H) // Flux Data and DRDY
221221
{
222222
memset(&p, 0, sizeof(p)); // clear p
223-
p.read_complete = time64.Us();
223+
p.header.complete = time64.Us();
224224
p.header.status = rx[1];
225225

226226
int16_t data = (rx[3] << 8) | rx[2];
@@ -240,7 +240,7 @@ void Iis2mdc::endDma(void)
240240
p.temperature = (double) data / 8.0 + 25.0 + 273.15; // K
241241

242242
p.header.timestamp = drdy_;
243-
p.read_complete = time64.Us();
243+
p.header.complete = time64.Us();
244244
if (p.header.status == IIS2MDC_OK)
245245
{
246246
rotate(p.flux);
@@ -260,7 +260,7 @@ bool Iis2mdc::display()
260260

261261
float total_flux = sqrt(p.flux[0] * p.flux[0] + p.flux[1] * p.flux[1] + p.flux[2] * p.flux[2]);
262262

263-
misc_header(name, p.header.timestamp, p.read_complete );
263+
misc_header(name, p.header );
264264

265265
misc_f32(NAN, NAN, p.flux[0] * 1e6, "hx", "%6.2f", "uT");
266266
misc_f32(NAN, NAN, p.flux[1] * 1e6, "hy", "%6.2f", "uT");

boards/varmint_h7/common/drivers/Ist8308.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void Ist8308::endDma(void)
231231
if (i2cState_ == IST8308_RX) {
232232
MagPacket p;
233233
p.header.timestamp = drdy_;
234-
p.read_complete = time64.Us();
234+
p.header.complete = time64.Us();
235235
p.header.status = ist8308_i2c_dma_buf[0];
236236

237237
if (p.header.status == STAT1_VAL_DRDY)
@@ -259,7 +259,7 @@ bool Ist8308::display()
259259
MagPacket p;
260260
char name[] = "Ist8308 (mag)";
261261
if (read((uint8_t *) &p, sizeof(p))) {
262-
misc_header(name, p.header.timestamp, p.read_complete );
262+
misc_header(name, p.header );
263263

264264
misc_printf("%10.3f %10.3f %10.3f uT ", p.flux[0] * 1e6 + 10.9, p.flux[1] * 1e6 + 45.0, p.flux[2] * 1e6 - 37.5);
265265
misc_printf(" | ");

boards/varmint_h7/common/drivers/Ms4525.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void Ms4525::endDma(void)
135135
p.header.status = ms4525_i2c_dma_buf[0] & 0xC0;
136136

137137
p.header.timestamp = drdy_;
138-
p.read_complete = time64.Us();
138+
p.header.complete = time64.Us();
139139

140140
write((uint8_t *) &p, sizeof(p));
141141
}
@@ -150,7 +150,7 @@ bool Ms4525::display(void)
150150
PressurePacket p;
151151
char name[] = "MS4525 (pitot)";
152152
if (read((uint8_t *) &p, sizeof(p))) {
153-
misc_header(name, p.header.timestamp, p.read_complete );
153+
misc_header(name, p.header );
154154
misc_printf("%10.3f Pa | | "
155155
"%7.1f C | "
156156
" | 0x%04X",

0 commit comments

Comments
 (0)