Skip to content

Commit f1a4e7f

Browse files
committed
[bsp][nuvoton][rsoc] Fix compilation issues with bsp of nuvoton series
1 parent 7506bfc commit f1a4e7f

File tree

11 files changed

+114
-114
lines changed

11 files changed

+114
-114
lines changed

bsp/nuvoton/libraries/m031/rtt_port/drv_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ int rt_hw_adc_init(void)
151151
INIT_BOARD_EXPORT(rt_hw_adc_init);
152152

153153

154-
#endif /*#if defined(BSP_USING_ADC)*/
154+
#endif /* #if defined(BSP_USING_ADC) */

bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define NU_USBHOST_HUB_POLLING_INTERVAL (100)
3030
#endif
3131

32-
#define NU_MAX_USBH_PORT 1 /*USB1.1 port*/
32+
#define NU_MAX_USBH_PORT 1 /* USB1.1 port */
3333
#define NU_MAX_USBH_PIPE 16
3434
#define NU_USBH_THREAD_STACK_SIZE 2048
3535

@@ -60,7 +60,7 @@
6060
#define NU_USBHOST_UNLOCK()
6161
#endif
6262

63-
/* Private typedef --------------------------------------------------------------*/
63+
/* Private typedef -------------------------------------------------------------- */
6464
typedef struct nu_port_dev
6565
{
6666
rt_bool_t bRHParent;
@@ -89,7 +89,7 @@ struct nu_usbh_dev
8989
S_NU_RH_PORT_CTRL asPortCtrl[NU_MAX_USBH_PORT];
9090
};
9191

92-
/* Private variables ------------------------------------------------------------*/
92+
/* Private variables ------------------------------------------------------------ */
9393
static struct nu_usbh_dev s_sUSBHDev;
9494

9595
static S_NU_RH_PORT_CTRL *
@@ -100,13 +100,13 @@ GetRHPortControlFromPipe(
100100
int port;
101101
if (pipe->inst->parent_hub->is_roothub)
102102
{
103-
/*case: device ---> root hub*/
103+
/* case: device ---> root hub */
104104
inst = pipe->inst;
105105
port = inst->port;
106106
}
107107
else
108108
{
109-
/*case: device ---> hub ---> root hub*/
109+
/* case: device ---> hub ---> root hub */
110110
inst = pipe->inst->parent_hub->self;
111111
port = inst->port;
112112
}
@@ -132,11 +132,11 @@ GetPortDevFromPipe(
132132

133133
if (pipe->inst->parent_hub->is_roothub)
134134
{
135-
/*case: device ---> root hub*/
135+
/* case: device ---> root hub */
136136
return &psRHPortCtrl->sRHPortDev;
137137
}
138138

139-
/*case: device ---> hub ---> root hub*/
139+
/* case: device ---> hub ---> root hub */
140140
for (i = 0 ; i < NU_MAX_USBH_HUB_PORT_DEV; i ++)
141141
{
142142
if (psRHPortCtrl->asHubPortDev[i].port_num == pipe->inst->port)
@@ -266,7 +266,7 @@ static rt_err_t nu_open_pipe(upipe_t pipe)
266266

267267
if ((psPortDev == NULL) || (psPortDev->pUDev == NULL))
268268
{
269-
/*allocate new dev for hub device*/
269+
/* allocate new dev for hub device */
270270
psPortDev = AllocateNewUDev(psPortCtrl);
271271

272272
if (psPortDev == RT_NULL)
@@ -291,7 +291,7 @@ static rt_err_t nu_open_pipe(upipe_t pipe)
291291
psPortDev->bEnumDone = FALSE;
292292
}
293293

294-
/*For ep0 control transfer*/
294+
/* For ep0 control transfer */
295295
if ((pipe->ep.bEndpointAddress & 0x7F) == 0)
296296
{
297297
pipe->pipe_index = 0;
@@ -339,7 +339,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
339339

340340
psPortDev = GetPortDevFromPipe(pipe);
341341

342-
/*For ep0 control transfer*/
342+
/* For ep0 control transfer */
343343
if ((pipe->ep.bEndpointAddress & 0x7F) == 0)
344344
{
345345
if ((psPortDev) && (psPortDev->bRHParent == FALSE) && (psPortDev->bEnumDone == TRUE))
@@ -410,7 +410,7 @@ static int nu_bulk_xfer(
410410
if (ret < 0)
411411
return ret;
412412

413-
/*wait transfer done*/
413+
/* wait transfer done */
414414
if (rt_completion_wait(&(psPortDev->utr_completion), timeouts) < 0)
415415
{
416416
rt_kprintf("Request Timeout in %d ms!! (bulk_xfer)\n", timeouts);
@@ -465,7 +465,7 @@ static void xfer_done_cb(UTR_T *psUTR)
465465
{
466466
S_NU_PORT_DEV *psPortDev = (S_NU_PORT_DEV *)psUTR->context;
467467

468-
/*transfer done, signal utr_completion*/
468+
/* transfer done, signal utr_completion */
469469
rt_completion_done(&(psPortDev->utr_completion));
470470
}
471471

@@ -493,7 +493,7 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
493493
goto exit_nu_pipe_xfer;
494494
}
495495

496-
/*ctrl xfer*/
496+
/* ctrl xfer */
497497
if (pipe->ep.bmAttributes == USB_EP_ATTR_CONTROL)
498498
{
499499
int ret;
@@ -507,27 +507,27 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
507507
/* Read data from USB device. */
508508
if (psSetup->request_type & USB_REQ_TYPE_DIR_IN)
509509
{
510-
/*Store setup request*/
510+
/* Store setup request */
511511
rt_memcpy(&psPortCtrl->asHubPortDev->asSetupReq[pipe->pipe_index], psSetup, sizeof(struct urequest));
512512
}
513513
else
514514
{
515515
/* Write data to USB device. */
516-
/*Trigger USBHostLib Ctrl_Xfer*/
516+
/* Trigger USBHostLib Ctrl_Xfer */
517517
ret = nu_ctrl_xfer(psPortDev, psSetup, NULL, timeouts);
518518
if (ret != psSetup->wLength)
519519
goto exit_nu_pipe_xfer;
520520
}
521521
}
522522
else
523523
{
524-
/*token == USBH_PID_DATA*/
524+
/* token == USBH_PID_DATA */
525525
if (buffer_nonch && ((pipe->ep.bEndpointAddress & USB_DIR_MASK) == USB_DIR_IN))
526526
{
527527
struct urequest *psSetup = &psPortCtrl->asHubPortDev->asSetupReq[pipe->pipe_index];
528528

529529
/* Read data from USB device. */
530-
/*Trigger USBHostLib Ctril_Xfer*/
530+
/* Trigger USBHostLib Ctril_Xfer */
531531
/*
532532
* Workaround: HCD driver can readback all bytes of setup.wLength, but not support single packet transferring.
533533
*/
@@ -556,10 +556,10 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
556556
LOG_D("%d == USBH_PID_DATA, nil buf-%d", token, nbytes);
557557
}
558558

559-
} /*else*/
559+
} /* else */
560560
i32XferLen = nbytes;
561561
goto exit_nu_pipe_xfer;
562-
} /* if ( pipe->ep.bmAttributes == USB_EP_ATTR_CONTROL )*/
562+
} /* if ( pipe->ep.bmAttributes == USB_EP_ATTR_CONTROL ) */
563563
else
564564
{
565565

@@ -580,7 +580,7 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
580580
psUTR->bIsTransferDone = 0;
581581
psUTR->status = 0;
582582

583-
/*others xfer*/
583+
/* others xfer */
584584
rt_completion_init(&(psPortDev->utr_completion));
585585

586586
if (pipe->ep.bmAttributes == USB_EP_ATTR_BULK)
@@ -596,7 +596,7 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
596596
if (nu_int_xfer(pipe, psPortDev, psUTR, timeouts) < 0)
597597
{
598598
LOG_D("nu_pipe_xfer ERROR: int transfer failed");
599-
/*goto exit_nu_pipe_xfer;*/
599+
/* goto exit_nu_pipe_xfer; */
600600
}
601601
else
602602
{
@@ -606,25 +606,25 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
606606
}
607607
else if (pipe->ep.bmAttributes == USB_EP_ATTR_ISOC)
608608
{
609-
/*TODO: ISO transfer*/
609+
/* TODO: ISO transfer */
610610
LOG_D("nu_pipe_xfer ERROR: isoc transfer not support");
611611
goto exit_nu_pipe_xfer;
612612
}
613613

614-
} /*else*/
614+
} /* else */
615615

616616
failreport_nu_pipe_xfer:
617617

618618
if (psUTR->bIsTransferDone == 0)
619619
{
620-
/*Timeout*/
620+
/* Timeout */
621621
LOG_D("nu_pipe_xfer ERROR: timeout");
622622
pipe->status = UPIPE_STATUS_ERROR;
623623
usbh_quit_utr(psUTR);
624624
}
625625
else
626626
{
627-
/* Transfer Done. Get status*/
627+
/* Transfer Done. Get status */
628628
if (psUTR->status == 0)
629629
{
630630
pipe->status = UPIPE_STATUS_OK;
@@ -643,7 +643,7 @@ static int nu_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbytes
643643

644644
exit_nu_pipe_xfer:
645645

646-
/*Call callback*/
646+
/* Call callback */
647647
if (pipe->callback != RT_NULL)
648648
{
649649
pipe->callback(pipe);
@@ -742,7 +742,7 @@ static void nu_hcd_disconnect_callback(
742742
}
743743

744744

745-
/* USB host operations -----------------------------------------------------------*/
745+
/* USB host operations ----------------------------------------------------------- */
746746
static struct uhcd_ops nu_uhcd_ops =
747747
{
748748
nu_reset_port,
@@ -757,10 +757,10 @@ static rt_err_t nu_hcd_init(rt_device_t device)
757757

758758
usbh_core_init();
759759

760-
/*install connect/disconnect callback*/
760+
/* install connect/disconnect callback */
761761
usbh_install_conn_callback(nu_hcd_connect_callback, nu_hcd_disconnect_callback);
762762

763-
/*create thread for polling usbh port status*/
763+
/* create thread for polling usbh port status */
764764
/* create usb hub thread */
765765
pNuUSBHDev->polling_thread = rt_thread_create("usbh_drv", nu_usbh_rh_thread_entry, RT_NULL,
766766
NU_USBH_THREAD_STACK_SIZE, 8, 20);
@@ -772,7 +772,7 @@ static rt_err_t nu_hcd_init(rt_device_t device)
772772
return RT_EOK;
773773
}
774774

775-
/* global function for USB host library -----------------------------*/
775+
/* global function for USB host library ----------------------------- */
776776
uint32_t usbh_get_ticks(void)
777777
{
778778
return rt_tick_get();
@@ -880,7 +880,7 @@ int nu_usbh_register(void)
880880
res = rt_device_register(&psUHCD->parent, "usbh", RT_DEVICE_FLAG_DEACTIVATE);
881881
RT_ASSERT(res == RT_EOK);
882882

883-
/*initialize the usb host function */
883+
/* initialize the usb host function */
884884
res = rt_usb_host_init("usbh");
885885
RT_ASSERT(res == RT_EOK);
886886

bsp/nuvoton/libraries/m460/rtt_port/drv_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void nu_pin_set_function(rt_base_t pin, int data)
127127
GPx_MFPx_org = *GPx_MFPx;
128128
*GPx_MFPx = (GPx_MFPx_org & (~MFP_Msk)) | data;
129129

130-
/*rt_kprintf("Port[%d]-Pin[%d] Addr[%08x] Data[%08x] %08x -> %08x\n", port_index, pin_index, GPx_MFPx, data, GPx_MFPx_org, *GPx_MFPx);*/
130+
/* rt_kprintf("Port[%d]-Pin[%d] Addr[%08x] Data[%08x] %08x -> %08x\n", port_index, pin_index, GPx_MFPx, data, GPx_MFPx_org, *GPx_MFPx); */
131131
}
132132

133133
/**

bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int lengt
4949
rt_err_t nu_hw_spi_pdma_allocate(struct nu_spi *spi_bus);
5050
#endif
5151

52-
#endif /* __DRV_SPI_H___*/
52+
#endif /* __DRV_SPI_H___ */

0 commit comments

Comments
 (0)