| 838 | } |
| 839 | |
| 840 | void CANIface::handleTxCompleteInterrupt(const uint64_t timestamp_us) |
| 841 | { |
| 842 | for (uint8_t i = 0; i < NumTxMailboxes; i++) { |
| 843 | if ((can_->TXBTO & (1UL << i))) { |
| 844 | |
| 845 | if (!pending_tx_[i].pushed) { |
| 846 | stats.tx_success++; |
| 847 | stats.last_transmit_us = timestamp_us; |
| 848 | if (pending_tx_[i].canfd_frame) { |
| 849 | stats.fdf_tx_success++; |
| 850 | } |
| 851 | pending_tx_[i].pushed = true; |
| 852 | } else { |
| 853 | continue; |
| 854 | } |
| 855 | |
| 856 | if (pending_tx_[i].loopback && had_activity_) { |
| 857 | CanRxItem rx_item; |
| 858 | rx_item.frame = pending_tx_[i].frame; |
| 859 | rx_item.timestamp_us = timestamp_us; |
| 860 | rx_item.flags = AP_HAL::CANIface::Loopback; |
| 861 | add_to_rx_queue(rx_item); |
| 862 | } |
| 863 | stats.num_events++; |
| 864 | if (sem_handle != nullptr) { |
| 865 | sem_handle->signal_ISR(); |
| 866 | } |
| 867 | } |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | bool CANIface::readRxFIFO(uint8_t fifo_index) |
| 872 | { |
no test coverage detected