diff options
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/Makefile | 7 | ||||
-rw-r--r-- | nuttx/drivers/can.c | 29 |
2 files changed, 27 insertions, 9 deletions
diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index b76a04a8c..a6fcbe1f0 100644 --- a/nuttx/drivers/Makefile +++ b/nuttx/drivers/Makefile @@ -2,7 +2,7 @@ # drivers/Makefile # # Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -64,10 +64,13 @@ include usbhost/Make.defs include wireless/Make.defs ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += dev_null.c dev_zero.c loop.c can.c + CSRCS += dev_null.c dev_zero.c loop.c ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) CSRCS += ramdisk.c rwbuffer.c endif +ifneq ($(CONFIG_CAN),y) + CSRCS += can.c +endif ifeq ($(CONFIG_PWM),y) CSRCS += pwm.c endif diff --git a/nuttx/drivers/can.c b/nuttx/drivers/can.c index fc70678a7..532eef592 100644 --- a/nuttx/drivers/can.c +++ b/nuttx/drivers/can.c @@ -1,8 +1,8 @@ /**************************************************************************** * drivers/can.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,10 +34,6 @@ ****************************************************************************/ /**************************************************************************** - * Compilation Switches - ****************************************************************************/ - -/**************************************************************************** * Included Files ****************************************************************************/ @@ -60,9 +56,27 @@ #include <arch/irq.h> +#ifdef CONFIG_CAN + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Debug ********************************************************************/ +/* Non-standard debug that may be enabled just for testing CAN */ + +#ifdef CONFIG_DEBUG_CAN +# define candbg dbg +# define canvdbg vdbg +# define canlldbg lldbg +# define canllvdbg llvdbg +#else +# define candbg(x...) +# define canvdbg(x...) +# define canlldbg(x...) +# define canllvdbg(x...) +#endif + +/* Timing Definitions *******************************************************/ #define HALF_SECOND_MSEC 500 #define HALF_SECOND_USEC 500000L @@ -619,7 +633,7 @@ int can_register(FAR const char *path, FAR struct can_dev_s *dev) /* Register the CAN device */ - dbg("Registering %s\n", path); + canvdbg("Registering %s\n", path); return register_driver(path, &g_canops, 0666, dev); } @@ -768,3 +782,4 @@ int can_txdone(FAR struct can_dev_s *dev) return ret; } +#endif /* CONFIG_CAN */ |