embedded: use standard CONFIG_OC_LINCAN_CARD_xxx option to distinguish required hardware.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Fri, 25 May 2012 16:35:53 +0000 (18:35 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Fri, 25 May 2012 16:35:53 +0000 (18:35 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
embedded/app/usbcan/Makefile.omk
embedded/app/usbcan/main.c
embedded/board/arm/lpc17xx-common/config/config.usbcan
embedded/board/arm/ul_usb1/config/config.usbcan

index 7d33f73..0beeb96 100644 (file)
@@ -11,6 +11,9 @@ ifeq ($(CONFIG_APP_USBCAN),y)
 default_CONFIG += MACH=$(MACH)
 #default_CONFIG += ULAN_ID=$(ULAN_ID)
 default_CONFIG += CONFIG_MISC_VECT=x
+default_CONFIG += CONFIG_OC_LINCAN_CARD_ul_usb1=x
+default_CONFIG += CONFIG_OC_LINCAN_CARD_can_lmc1=x
+
 
 LOCAL_CONFIG_H = local_config.h
 
@@ -21,11 +24,12 @@ INCLUDES += -I.
 bin_PROGRAMS = usbcan
 usbcan_SOURCES = main.c can_queue.c sja1000p.c  devcommon.c setup.c finish.c
 usbcan_SOURCES += usb_vend.c can_quesysless.c sysdep_sysless.c
-ifeq ($(MACH),lpc17xx)
+ifeq ($(CONFIG_OC_LINCAN_CARD_can_lmc1),y)
 usbcan_SOURCES += lpc17xx_can.c
-else #MACH
+endif
+ifeq ($(CONFIG_OC_LINCAN_CARD_ul_usb1),y)
 usbcan_SOURCES += can_lpcbusemu.c ul_usb1.c
-endif #MACH
+endif
 
 #usbtest_SOURCES +=  ul_idstr.c
 #lib_LOADLIBES =  bspbase ul_drv lpciap keyval lpciap_kvpb mach_hal uldy
index 603168d..54b505a 100644 (file)
@@ -250,10 +250,12 @@ int main(void)
 
        
 
+#ifdef CONFIG_OC_LINCAN_CARD_ul_usb1
        ul_usb1_register(candev->hwspecops);
-//     can_lmc1_register(candev->hwspecops);
-
-       
+#endif
+#ifdef CONFIG_OC_LINCAN_CARD_can_lmc1
+       can_lmc1_register(candev->hwspecops);
+#endif
 
        bd=baudrate[0];
        if (candev->hwspecops->init_hw_data(candev)){
index ec976db..147fcdb 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_USB_LPCUSB=y
 
 CONFIG_APP_USBCAN=y
 #CONFIG_APP_USBLED=y
+CONFIG_OC_LINCAN_CARD_can_lmc1=y
+
 
 CONFIG_OC_UL_DRV_SYSLESS=n
 CONFIG_ULAN_DY=n
index f7320f6..2ee967a 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_USB_BASE=y
 CONFIG_USB_MORE=y
 CONFIG_USB_LPCUSB=y
 CONFIG_APP_USBCAN=y
+CONFIG_OC_LINCAN_CARD_ul_usb1=y
 #CONFIG_APP_USBBOOT=y
 #CONFIG_ULBOOT=y