Merge pull request #1789 from liruncong/dev-usb

修正drivers下一处bug,并修正armclang编译时该目录下的错误或警告
This commit is contained in:
Bernard Xiong 2018-10-09 13:49:52 +08:00 committed by GitHub
commit 05101c4bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ uint32_t clock_cpu_microsecond(uint32_t cpu_tick)
{ {
float unit = clock_cpu_getres(); 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(); float unit = clock_cpu_getres();
return (cpu_tick * unit) / (1000 * 1000); return (uint32_t)((cpu_tick * unit) / (1000 * 1000));
} }
/** /**

View File

@ -849,7 +849,7 @@ static void vcom_tx_thread_entry(void* parameter)
{ {
continue; continue;
} }
if(!res & CDC_TX_HAS_DATE) if(!(res & CDC_TX_HAS_DATE))
{ {
continue; continue;
} }

View File

@ -502,11 +502,11 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
{ {
int i = 0; int i = 0;
rt_err_t ret = RT_EOK; rt_err_t ret = RT_EOK;
uep_desc_t ep_desc; uep_desc_t ep_desc = RT_NULL;
uhub_t hub; uhub_t hub;
struct uinstance* device; struct uinstance* device;
struct uhintf* intf = (struct uhintf*)arg; struct uhintf* intf = (struct uhintf*)arg;
upipe_t pipe_in; upipe_t pipe_in = RT_NULL;
int timeout = 300; int timeout = 300;
/* paremeter check */ /* paremeter check */
RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf != RT_NULL);