Skip to content

Commit 63f6216

Browse files
author
Cruz Monrreal
authored
Merge pull request #7565 from OpenNuvoton/nuc472_emac_rst
Nuvoton: Fix NUC472 SD-Host HW IP reset definition
2 parents f4a804f + 2fcbcf1 commit 63f6216

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

features/netsocket/emac-drivers/TARGET_NUVOTON_EMAC/numaker_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,19 @@ void NUMAKER_EMAC::packet_rx()
220220
*/
221221
bool NUMAKER_EMAC::link_out(emac_mem_buf_t *buf)
222222
{
223-
bool result;
223+
bool result = false;
224224
emac_mem_buf_t *q;
225-
uint8_t *buffer = numaker_eth_get_tx_buf();
225+
uint8_t *buffer = NULL;
226226
uint32_t framelength = 0;
227227
uint32_t bufferoffset = 0;
228228
uint32_t byteslefttocopy = 0;
229229
uint32_t payloadoffset = 0;
230230

231231
/* Get exclusive access */
232232
TXLockMutex.lock();
233+
buffer = numaker_eth_get_tx_buf();
233234
NU_DEBUGF(("%s ... buffer=0x%x\r\n",__FUNCTION__, buffer));
235+
if( buffer == NULL ) goto error;
234236
/* copy frame from buf to driver buffers */
235237
for (q = buf; q != NULL; q = memory_manager->get_next(q)) {
236238

targets/TARGET_NUVOTON/TARGET_NUC472/device/NUC472_442.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24427,8 +24427,11 @@ typedef struct {
2442724427
#define SYS_IPRST0_USBHRST_Pos (4) /*!< SYS IPRST0: USBHRST Position */
2442824428
#define SYS_IPRST0_USBHRST_Msk (0x1ul << SYS_IPRST0_USBHRST_Pos) /*!< SYS IPRST0: USBHRST Mask */
2442924429

24430-
#define SYS_IPRST0_SDHRST_Pos (5) /*!< SYS IPRST0: SDHRST Position */
24431-
#define SYS_IPRST0_SDHRST_Msk (0x1ul << SYS_IPRST0_SDHRST_Pos) /*!< SYS IPRST0: SDHRST Mask */
24430+
#define SYS_IPRST0_EMACRST_Pos (5) /*!< SYS_T::IPRST0: EMACRST Position */
24431+
#define SYS_IPRST0_EMACRST_Msk (0x1ul << SYS_IPRST0_EMACRST_Pos) /*!< SYS_T::IPRST0: EMACRST Mask */
24432+
24433+
#define SYS_IPRST0_SDHRST_Pos (6) /*!< SYS_T::IPRST0: SDHRST Position */
24434+
#define SYS_IPRST0_SDHRST_Msk (0x1ul << SYS_IPRST0_SDHRST_Pos) /*!< SYS_T::IPRST0: SDHRST Mask */
2443224435

2443324436
#define SYS_IPRST0_SDHOST_RST_Pos (6) /*!< SYS IPRST0: SDHOST_RST Position */
2443424437
#define SYS_IPRST0_SDHOST_RST_Msk (0x1ul << SYS_IPRST0_SDHOST_RST_Pos) /*!< SYS IPRST0: SDHOST_RST Mask */

0 commit comments

Comments
 (0)