diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/st/typec/typec_stm32.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/portable/st/typec/typec_stm32.c b/src/portable/st/typec/typec_stm32.c index fe9275245..d7e622925 100644 --- a/src/portable/st/typec/typec_stm32.c +++ b/src/portable/st/typec/typec_stm32.c @@ -342,8 +342,10 @@ void tcd_int_handler(uint8_t rhport) { // flag will remain set and re-enter the ISR immediately if (sr & UCPD_SR_RXHRSTDET) { TU_LOG3("Hard Reset received\r\n"); - dma_stop(rhport, true); - tcd_msg_receive(rhport, _rx_buf, _rx_buf_len); + if (_rx_buf != NULL && _rx_buf_len > 0) { + dma_stop(rhport, true); + tcd_msg_receive(rhport, _rx_buf, _rx_buf_len); + } UCPD1->ICR = UCPD_ICR_RXHRSTDETCF; } |
