From eb9d29729d07775240ea28e40688fad6000e4e77 Mon Sep 17 00:00:00 2001 From: Hein Tibosch Date: Fri, 30 Jun 2023 16:18:33 +0200 Subject: [PATCH 1/2] Atmel SAM driver: let gmac_dev_read() return the proper length --- source/portable/NetworkInterface/DriverSAM/gmac_SAM.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c b/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c index e864e1be72..22317698af 100644 --- a/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c +++ b/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c @@ -621,6 +621,9 @@ uint32_t gmac_dev_read( gmac_device_t * p_gmac_dev, return GMAC_RX_NO_DATA; } + /* Return the number of bytes received. */ + *p_rcv_size = bytesLeft; + /* gmac_dev_poll has confirmed that there is a complete frame at * the current position 'ul_rx_idx' */ @@ -693,8 +696,6 @@ uint32_t gmac_dev_read( gmac_device_t * p_gmac_dev, p_gmac_dev->ul_rx_idx = nextIdx; - *p_rcv_size = bytesLeft; - return GMAC_OK; } @@ -1010,7 +1011,7 @@ void gmac_handler( gmac_device_t * p_gmac_dev ) /*/ @cond 0 */ /**INDENT-OFF**/ #ifdef __cplusplus - } +} #endif /**INDENT-ON**/ /*/ @endcond */ From b8ba86346cf341f2bd3b4160727b224db9d47531 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 30 Jun 2023 20:27:48 +0000 Subject: [PATCH 2/2] Uncrustify: triggered by comment. --- source/portable/NetworkInterface/DriverSAM/gmac_SAM.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c b/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c index 22317698af..81813f6de1 100644 --- a/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c +++ b/source/portable/NetworkInterface/DriverSAM/gmac_SAM.c @@ -1011,7 +1011,7 @@ void gmac_handler( gmac_device_t * p_gmac_dev ) /*/ @cond 0 */ /**INDENT-OFF**/ #ifdef __cplusplus -} + } #endif /**INDENT-ON**/ /*/ @endcond */