Skip to content

Commit

Permalink
Fix: LRW expected working counter is wrong. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
leducp committed Oct 21, 2021
1 parent d2d16bb commit 1fa3866
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Bus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ namespace kickcat

auto process = [pi_frame](DatagramHeader const*, uint8_t const* data, uint16_t wkc)
{
if (wkc != pi_frame.inputs.size())
if (wkc != (pi_frame.inputs.size() + pi_frame.outputs.size() * 2))
{
DEBUG_PRINT("Invalid working counter\n");
return DatagramState::INVALID_WKC;
Expand Down
2 changes: 1 addition & 1 deletion unit/bus-t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ TEST_F(BusTest, logical_cmd)
logical_write = 0x1716151413121110;
std::memcpy(slave.output.data, &logical_write, sizeof(int64_t));
checkSendFrame(Command::LRW, logical_write);
handleReply<int64_t>({logical_read});
handleReply<int64_t>({logical_read}, 3);
bus.processDataReadWrite([](DatagramState const&){});

for (int i = 0; i < 8; ++i)
Expand Down

0 comments on commit 1fa3866

Please sign in to comment.