diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-13 15:13:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-13 15:13:37 +0000 |
commit | c37fdc28c2cfdf41a549ba245c1cad85b757e53a (patch) | |
tree | 2812daa6196bae9eb0a4233aa1b28f6eb7902c44 /nuttx/drivers/can.c | |
parent | a3933a716fd10ac4c87089ce7fac43ee24b3a2d4 (diff) | |
download | px4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.tar.gz px4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.tar.bz2 px4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.zip |
Eliminate some hcs12 compile errors/warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2329 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/can.c')
-rw-r--r-- | nuttx/drivers/can.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/nuttx/drivers/can.c b/nuttx/drivers/can.c index 509210a8f..834765183 100644 --- a/nuttx/drivers/can.c +++ b/nuttx/drivers/can.c @@ -61,6 +61,9 @@ * Definitions ****************************************************************************/ +#define HALF_SECOND_MSEC 500 +#define HALF_SECOND_USEC 500000L + /**************************************************************************** * Private Type Definitions ****************************************************************************/ @@ -214,9 +217,9 @@ static int can_close(FAR struct file *filep) while (dev->cd_xmit.cf_head != dev->cd_xmit.cf_tail) { #ifndef CONFIG_DISABLE_SIGNALS - usleep(500*1000); + usleep(HALF_SECOND_USEC); #else - up_mdelay(500); + up_mdelay(HALF_SECOND_MSEC); #endif } @@ -225,9 +228,9 @@ static int can_close(FAR struct file *filep) while (!dev_txempty(dev)) { #ifndef CONFIG_DISABLE_SIGNALS - usleep(500*1000); + usleep(HALF_SECOND_USEC); #else - up_mdelay(500); + up_mdelay(HALF_SECOND_MSEC); #endif } @@ -554,11 +557,13 @@ static int can_ioctl(FAR struct file *filep, int cmd, unsigned long arg) switch (cmd) { /* CANIOCTL_RTR: Send the remote transmission request and wait for the response. - * Argument is a reference to struct canioctl_rtr_s + * Argument is a reference to struct canioctl_rtr_s (casting to uintptr first + * eliminates complaints on some architectures where the sizeof long is different + * from the size of a pointer). */ case CANIOCTL_RTR: - ret = can_rtrread(dev, (struct canioctl_rtr_s*)arg); + ret = can_rtrread(dev, (struct canioctl_rtr_s*)((uintptr)arg)); break; /* Not a "built-in" ioctl command.. perhaps it is unique to this device driver */ |