Fix after merge.

This commit is contained in:
David Given
2021-01-09 00:02:14 +01:00
parent bb806e3853
commit c2c51bbe33
4 changed files with 268 additions and 251 deletions

View File

@@ -45,7 +45,10 @@ public:
usbSetDrive(_drive, high_density, indexMode);
std::cerr << "Measuring rotational speed... " << std::flush;
_oneRevolution = usbGetRotationalPeriod(hardSectorCount);
_hardSectorThreshold = _oneRevolution * 3 / (4 * hardSectorCount);
if (hardSectorCount != 0)
_hardSectorThreshold = _oneRevolution * 3 / (4 * hardSectorCount);
else
_hardSectorThreshold = 0;
std::cerr << fmt::format("{}ms\n", _oneRevolution / 1e6);
}