Skip to content

Commit

Permalink
Rename write_clock to write_clock_ns, because it is. Tweak the defaul…
Browse files Browse the repository at this point in the history
…t value

for correctness.
  • Loading branch information
davidgiven committed Sep 30, 2024
1 parent 6fd98e3 commit 045e5e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/usb/applesauceusb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static Bytes fluxEngineToApplesauceWriteData(
if (!fmr.findEvent(F_BIT_PULSE, ticks))
break;

uint32_t applesauceTicks = ticks * NS_PER_TICK / clock;
uint32_t applesauceTicks = (double)ticks * NS_PER_TICK / clock;
while (applesauceTicks >= 0xffff)
{
bw.write_le16(0xffff);
Expand Down Expand Up @@ -279,7 +279,7 @@ class ApplesauceUsb : public USB
doCommand("disk:wclear");

Bytes asdata =
fluxEngineToApplesauceWriteData(fldata, _config.write_clock());
fluxEngineToApplesauceWriteData(fldata, _config.write_clock_ns());
doCommand(fmt::format("data:>{}", asdata.size()));
_serial->write(asdata);
checkCommandResult(_serial->readLine());
Expand Down
4 changes: 2 additions & 2 deletions lib/usb/usb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ message ApplesauceProto {
[(help) = "Applesauce serial port to use"];
optional bool verbose = 2
[(help) = "Enable verbose protocol logging", default = false];
optional float write_clock = 3
[(help) = "Write clock speed", default = 22.5];
optional float write_clock_ns = 3
[(help) = "Write clock speed", default = 22.45];
}

message UsbProto {
Expand Down

0 comments on commit 045e5e7

Please sign in to comment.