embedded: reintroduce missing emulated bus initialization for UL_USB1 board. lpc17xx
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Tue, 5 Jun 2012 12:07:36 +0000 (14:07 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Tue, 5 Jun 2012 12:07:36 +0000 (14:07 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
embedded/app/usbcan/main.c
embedded/app/usbcan/ul_usb1.c

index 873f4c6..14fbe28 100644 (file)
@@ -218,10 +218,6 @@ int main(void)
        // * CAN device initialization - device side (adapted from LinCAN setup.c)
        // ***********************************************************************
 
-//     useless with lpc17xx (defined in can_lpcbusemu.c)
-//     can_init();
-
-
        DEBUGMSG("Initiating CAN device initialization\n");
        baudrate[0]=1000;
 
@@ -288,13 +284,17 @@ int main(void)
        }
 
 
-       if (candev->hwspecops->request_io(candev))
+       if (candev->hwspecops->request_io(candev)) {
+               CANMSG("Error to request IO\n");
                sys_err();
+       }
        candev->flags|=CANDEV_IO_RESERVED;
 
 
-       if (candev->hwspecops->reset(candev))
+       if (candev->hwspecops->reset(candev)) {
+               CANMSG("Error to reset chip\n");
                sys_err();
+       }
 
 
        for(chipnr=0; chipnr<candev->nr_all_chips; chipnr++) {
index 8314d28..36e1c62 100644 (file)
@@ -120,7 +120,7 @@ int ul_usb1_release_io(struct candevice_t *candev)
  */
 int ul_usb1_reset(struct candevice_t *candev)
 {
-       return 0;
+       return can_init();
 }
 
 #define RESET_ADDR 0x0