mirror of https://github.com/ArduPilot/ardupilot
AP_IOMCU: correct TCIE setting and add more debug
This commit is contained in:
parent
ae8a2d9513
commit
07f0bfc8c9
|
@ -646,8 +646,8 @@ bool AP_IOMCU::read_registers(uint8_t page, uint8_t offset, uint8_t count, uint1
|
|||
|
||||
// wait for the expected number of reply bytes or timeout
|
||||
if (!uart.wait_timeout(count*2+4, 10)) {
|
||||
debug("t=%lu timeout read page=%u offset=%u count=%u\n",
|
||||
AP_HAL::millis(), page, offset, count);
|
||||
debug("t=%lu timeout read page=%u offset=%u count=%u avail=%u\n",
|
||||
AP_HAL::millis(), page, offset, count, uart.available());
|
||||
protocol_fail_count++;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ static void setup_tx_dma(hal_uart_driver* uart)
|
|||
dmaStreamSetMode(uart->dmatx, uart->dmatxmode | STM32_DMA_CR_DIR_M2P |
|
||||
STM32_DMA_CR_MINC | STM32_DMA_CR_TCIE);
|
||||
// enable transmission complete interrupt
|
||||
uart->usart->SR = ~USART_SR_TC;
|
||||
uart->usart->SR &= ~USART_SR_TC;
|
||||
uart->usart->CR1 |= USART_CR1_TCIE;
|
||||
|
||||
dmaStreamEnable(uart->dmatx);
|
||||
|
|
Loading…
Reference in New Issue