Skip to content

Commit

Permalink
Fixes bugs in the stm32 railcom sender.
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Jul 11, 2021
1 parent 0e812a8 commit ce00406
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/freertos_drivers/st/Stm32RailcomSender.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void Stm32RailcomSender::middle_cutout()
// Nothing to send or came too late and should not be sent.
return;
}
if (__HAL_UART_GET_IT(&uartHandle, UART_IT_TXE)) {
if (!__HAL_UART_GET_IT(&uartHandle, UART_IT_TXE)) {
// Transmission is not complete yet. That's weird.
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/freertos_drivers/st/Stm32RailcomSender.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ private:
/// Called after the cutout is over.
void end_cutout() override {
// We throw away the packets that we got given.
ch1Pkt_ = nullptr;
ch2Pkt_ = nullptr;
//ch1Pkt_ = nullptr;
//ch2Pkt_ = nullptr;
}
/// Called instead of start/mid/end-cutout at the end of the current packet
/// if there was no cutout requested.
void no_cutout() override
{
// We throw away the packets that we got given.
ch1Pkt_ = nullptr;
ch2Pkt_ = nullptr;
//ch1Pkt_ = nullptr;
//ch2Pkt_ = nullptr;
}
/// Feedback key is set by the DCC decoder driver. The feedback packet must
/// carry the same feedback key or else it will not be transmitted.
Expand Down

0 comments on commit ce00406

Please sign in to comment.