Skip to content

Commit a987cfe

Browse files
authored
Merge pull request #5173 from cndabai/components
Components编译报错
2 parents 163b464 + f04941c commit a987cfe

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

components/drivers/phy/phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rt_err_t rt_hw_phy_register(struct rt_phy_device *phy, const char *name)
6060
device->tx_complete = RT_NULL;
6161

6262
#ifdef RT_USING_DEVICE_OPS
63-
device->ops = phy_ops;
63+
device->ops = &phy_ops;
6464
#else
6565
device->init = NULL;
6666
device->open = NULL;

components/drivers/usb/usbdevice/class/cdc_vcom.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* 2013-06-25 heyuanjie87 remove SOF mechinism
1111
* 2013-07-20 Yi Qiu do more test
1212
* 2016-02-01 Urey Fix some error
13+
* 2021-10-14 mazhiyuan Fix some error
1314
*/
1415

1516
#include <rthw.h>
1617
#include <rtdevice.h>
17-
#include <drivers/serial.h>
1818
#include "drivers/usb_device.h"
1919
#include "cdc.h"
2020

@@ -738,7 +738,7 @@ static rt_size_t _vcom_rb_block_put(struct vcom *data, const rt_uint8_t *buf, rt
738738
return size;
739739
}
740740

741-
static rt_size_t _vcom_tx(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size,int direction)
741+
static rt_size_t _vcom_tx(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size,rt_uint32_t direction)
742742
{
743743
struct ufunction *func;
744744
struct vcom *data;
@@ -939,8 +939,12 @@ static void rt_usb_vcom_init(struct ufunction *func)
939939
config.parity = PARITY_NONE;
940940
config.bit_order = BIT_ORDER_LSB;
941941
config.invert = NRZ_NORMAL;
942+
#if defined(RT_USING_SERIAL_V1)
942943
config.bufsz = CDC_RX_BUFSIZE;
943-
944+
#elif defined(RT_USING_SERIAL_V2)
945+
config.rx_bufsz = CDC_RX_BUFSIZE;
946+
config.tx_bufsz = CDC_TX_BUFSIZE;
947+
#endif
944948
data->serial.ops = &usb_vcom_ops;
945949
data->serial.serial_rx = RT_NULL;
946950
data->serial.config = config;

components/drivers/usb/usbdevice/class/ecm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,16 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device)
644644
_ecm_eth->host_addr[4] = 0xEC;//*(const rt_uint8_t *)(0x1fff7a14);
645645
_ecm_eth->host_addr[5] = 0xAB;//*(const rt_uint8_t *)(0x1fff7a18);
646646

647+
#ifdef RT_USING_DEVICE_OPS
648+
_ecm_eth->parent.parent.ops = &ecm_device_ops;
649+
#else
647650
_ecm_eth->parent.parent.init = rt_ecm_eth_init;
648651
_ecm_eth->parent.parent.open = rt_ecm_eth_open;
649652
_ecm_eth->parent.parent.close = rt_ecm_eth_close;
650653
_ecm_eth->parent.parent.read = rt_ecm_eth_read;
651654
_ecm_eth->parent.parent.write = rt_ecm_eth_write;
652655
_ecm_eth->parent.parent.control = rt_ecm_eth_control;
656+
#endif
653657
_ecm_eth->parent.parent.user_data = device;
654658

655659
_ecm_eth->parent.eth_rx = rt_ecm_eth_rx;

0 commit comments

Comments
 (0)