Used sysless functions for IRQ handling. Used access functions to the chip register...
[lincan.git] / embedded / app / usbcan / main.c
index 41062e3..71fb5e7 100644 (file)
@@ -62,7 +62,7 @@
 
 //#include "./can/ul_usb1.h"
 
-//#include "./can/setup.h"
+#include "./can/setup.h"
 
 #include "./usb/usb_defs.h"
 #include "./usb/usb_vend.h"
@@ -231,8 +231,8 @@ int main(void)
        // * CAN device initialization - device side (adapted from LinCAN setup.c)
        // ***********************************************************************
 
-       // DEBUG
-       //can_init(); // useless with lpc17xx (defined in can_lpcbusemu.c)
+//     useless with lpc17xx (defined in can_lpcbusemu.c)
+//     can_init();
 
 
        DEBUGMSG("Initiating CAN device initialization\n");
@@ -321,11 +321,12 @@ int main(void)
 
                chip->flags |= CHIP_ATTACHED;
 
-// Interrupts from chip are served in main cycle
-//             if(can_chip_setup_irq(chip)<0) {
-//                     CANMSG("Error to setup chip IRQ\n");
-//                     sys_err();
-//             }
+               // used with lpc17xx:
+               if(can_chip_setup_irq(chip)<0) {
+                       CANMSG("Error to setup chip IRQ\n");
+                       sys_err();
+               }
+
        }
 
        if (candev->flags & CANDEV_PROGRAMMABLE_IRQ)