From 7b788014f78ef6a2f38f8c26824df7127a4db42b Mon Sep 17 00:00:00 2001 From: liruncong Date: Mon, 10 Sep 2018 19:40:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3drivers=E4=B8=8B,armclang?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=97=B6=E7=9A=84=E8=AD=A6=E5=91=8A=E6=88=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20=20=20=20=E6=B3=A8:vcom=5Ftx=5Fthread=5Fen?= =?UTF-8?q?try=E4=B8=8B,=20if(!res=20&=20CDC=5FTX=5FHAS=5FDATE)=E5=BA=94?= =?UTF-8?q?=E4=B8=BAbug.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/cputime/cputime.c | 4 ++-- components/drivers/usb/usbdevice/class/cdc_vcom.c | 2 +- components/drivers/usb/usbhost/core/hub.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/drivers/cputime/cputime.c b/components/drivers/cputime/cputime.c index 20f41b6dac..0c260f13bd 100644 --- a/components/drivers/cputime/cputime.c +++ b/components/drivers/cputime/cputime.c @@ -68,7 +68,7 @@ uint32_t clock_cpu_microsecond(uint32_t cpu_tick) { float unit = clock_cpu_getres(); - return (cpu_tick * unit) / 1000; + return (uint32_t)((cpu_tick * unit) / 1000); } /** @@ -83,7 +83,7 @@ uint32_t clock_cpu_millisecond(uint32_t cpu_tick) { float unit = clock_cpu_getres(); - return (cpu_tick * unit) / (1000 * 1000); + return (uint32_t)((cpu_tick * unit) / (1000 * 1000)); } /** diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 049c211521..eaff09c5d7 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -849,7 +849,7 @@ static void vcom_tx_thread_entry(void* parameter) { continue; } - if(!res & CDC_TX_HAS_DATE) + if(!(res & CDC_TX_HAS_DATE)) { continue; } diff --git a/components/drivers/usb/usbhost/core/hub.c b/components/drivers/usb/usbhost/core/hub.c index 29b465d1b7..b022183d1a 100644 --- a/components/drivers/usb/usbhost/core/hub.c +++ b/components/drivers/usb/usbhost/core/hub.c @@ -502,11 +502,11 @@ static rt_err_t rt_usbh_hub_enable(void *arg) { int i = 0; rt_err_t ret = RT_EOK; - uep_desc_t ep_desc; + uep_desc_t ep_desc = RT_NULL; uhub_t hub; struct uinstance* device; struct uhintf* intf = (struct uhintf*)arg; - upipe_t pipe_in; + upipe_t pipe_in = RT_NULL; int timeout = 300; /* paremeter check */ RT_ASSERT(intf != RT_NULL); -- GitLab