]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
embedded ul_usb1: adapt this board support to the lpc17xx changes.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Fri, 25 May 2012 16:24:51 +0000 (18:24 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Fri, 25 May 2012 16:24:51 +0000 (18:24 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
embedded/app/usbcan/Makefile.omk
embedded/app/usbcan/can_lpcbusemu.c
embedded/app/usbcan/main.c

index c4c7cbae4468a3f9ac69cf9e68effe3b570f7a6b..7d33f7342852d87277784e59121d32270e6933e1 100644 (file)
@@ -24,16 +24,18 @@ usbcan_SOURCES += usb_vend.c can_quesysless.c sysdep_sysless.c
 ifeq ($(MACH),lpc17xx)
 usbcan_SOURCES += lpc17xx_can.c
 else #MACH
-#usbcan_SOURCES += can_lpcbusemu.c ul_usb1.c
+usbcan_SOURCES += can_lpcbusemu.c ul_usb1.c
 endif #MACH
 
 #usbtest_SOURCES +=  ul_idstr.c
 #lib_LOADLIBES =  bspbase ul_drv lpciap keyval lpciap_kvpb mach_hal uldy
 lib_LOADLIBES =  bspbase usbbase usbmore lpcusb mach_hal
 usbcan_MOREOBJS = $(USER_LIB_DIR)/system_stub.o
-# $(USER_LIB_DIR)/ivt.o
 nobase_include_HEADERS = usb/usb_defs.h
 
-#link_VARIANTS = app boot
+ifeq ($(MACH),lpc21xx)
+link_VARIANTS = app boot
+usbcan_MOREOBJS += $(USER_LIB_DIR)/ivt.o
+endif
 
 endif #CONFIG_ULBOOT
index fc945993b177faa9f72e015adfe9217477c3087f..2c1574981df13bd7152a20ed3119df64ef4d53fb 100644 (file)
@@ -11,6 +11,19 @@ See documentation for details.
 
 #include "can/can.h"
 
+
+/***********************************************************************
+ * Microsecond delay routine
+ ***********************************************************************/
+void udelay(long time)
+{
+  volatile long ticks=(time * CCLK) / 2000000;
+  do{
+    ticks--;
+  } while(ticks>0);
+}
+
+
 inline void can_data_pins_dir_output(void)
 {
        IO1DIR|=P1_SJA1000_DATA_PINS; // Port as output to send data
index 6a7b8be8fcd5732d0d18736950d6d4f33ac13016..603168d1b9baff54cc00b67862c922dd2fb27d75 100644 (file)
@@ -68,6 +68,7 @@
 #include "./usb/usb_vend.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
@@ -155,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)
  ***********************************************************************/
@@ -262,10 +250,8 @@ int main(void)
 
        
 
-       // DEBUG
-       //ul_usb1_register(candev->hwspecops);  //(defined in ul_usb1.c)
-       // register for another board:
-       can_lmc1_register(candev->hwspecops);
+       ul_usb1_register(candev->hwspecops);
+//     can_lmc1_register(candev->hwspecops);