]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - embedded/app/usbcan/main.c
embedded: use standard CONFIG_OC_LINCAN_CARD_xxx option to distinguish required hardware.
[lincan.git] / embedded / app / usbcan / main.c
index 71fb5e7a575e0352fe73f8ed390bfc61cc5a6e34..54b505ad330766388a1b9cbcbdea6c7fdeac0692 100644 (file)
@@ -67,8 +67,8 @@
 #include "./usb/usb_defs.h"
 #include "./usb/usb_vend.h"
 
-
-#include "can/lpc17xx_can.h"
+extern int can_lmc1_register(struct hwspecops_t *hwspecops);
+extern int ul_usb1_register(struct hwspecops_t *hwspecops);
 
 #define MASK_EP1RX  0x01
 #define MASK_EP1TX  0x02
@@ -156,19 +156,6 @@ int sys_err(){
   }
 }
 
-/***********************************************************************
- * Microsecond delay routine
- ***********************************************************************/
-/*
-void udelay(long time)
-{
-  volatile long ticks=(time * CCLK) / 2000000;
-  do{
-    ticks--;
-  } while(ticks>0);
-}
-*/
-
 /***********************************************************************
  * Routine for visible LED blinking (on USB transmission)
  ***********************************************************************/
@@ -227,7 +214,7 @@ int main(void)
        }
 
 
-       //***********************************************************************
+       // ***********************************************************************
        // * CAN device initialization - device side (adapted from LinCAN setup.c)
        // ***********************************************************************
 
@@ -263,12 +250,12 @@ int main(void)
 
        
 
-       // DEBUG
-       //ul_usb1_register(candev->hwspecops);  //(defined in ul_usb1.c)
-       // register for another board:
+#ifdef CONFIG_OC_LINCAN_CARD_ul_usb1
+       ul_usb1_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)){
@@ -532,6 +519,7 @@ int main(void)
 
                        }
                        
+
                }