Attempt that fix again.

This commit is contained in:
David Given
2021-01-09 00:37:37 +01:00
parent d1e2b0d1f8
commit 5f6d99f138

View File

@@ -233,12 +233,12 @@ public:
Bytes read(int side, bool synced, nanoseconds_t readTime,
nanoseconds_t hardSectorThreshold)
{
hardSectorThreshold += 5e5; /* Round to nearest ms. */
uint8_t threshold_ms = (hardSectorThreshold + 5e5) / 1e6; /* round to nearest ms */
struct read_frame f = {
.f = { .type = F_FRAME_READ_CMD, .size = sizeof(f) },
.side = (uint8_t) side,
.synced = (uint8_t) synced,
.hardsec_threshold_ms = (uint8_t) (hardSectorThreshold / 1e6),
.hardsec_threshold_ms = threshold_ms,
};
uint16_t milliseconds = readTime / 1e6;
((uint8_t*)&f.milliseconds)[0] = milliseconds;