Temporary fix to STM32 driver

This commit is contained in:
Pavel Kirienko 2015-07-02 22:19:12 +03:00
parent 8d00058307
commit 19cd458ae6

View File

@ -551,7 +551,10 @@ void CanIface::discardTimedOutTxMailboxes(uavcan::MonotonicTime current_time)
bool CanIface::isTxBufferFull() const
{
return (can_->TSR & (bxcan::TSR_TME0 | bxcan::TSR_TME1 | bxcan::TSR_TME2)) == 0; // Interrupts enabled
// TODO FIXME HACK: Implement proper arbitration instead of a one-by-one transmission.
// This function can be executed outside of a critical section.
static const uavcan::uint32_t TME = bxcan::TSR_TME0 | bxcan::TSR_TME1 | bxcan::TSR_TME2;
return (can_->TSR & TME) != TME; // All empty!
}
bool CanIface::isRxBufferEmpty() const