more accurate SD card rate
This commit is contained in:
parent
13f7eded9a
commit
5b876677d6
|
@ -566,6 +566,7 @@ void mlgLogger() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
systime_t before = chVTGetSystemTime();
|
||||||
|
|
||||||
writeSdLogLine(logBuffer);
|
writeSdLogLine(logBuffer);
|
||||||
|
|
||||||
|
@ -581,8 +582,8 @@ void mlgLogger() {
|
||||||
freq = 1;
|
freq = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto period = 1e6 / freq;
|
systime_t period = CH_CFG_ST_FREQUENCY / freq;
|
||||||
chThdSleepMicroseconds((int)period);
|
chThdSleepUntilWindowed(before, before + period);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue