X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/3c6d0376edd06bad63e861415974556259f593cd..f6c113a5fb217e7495b93053cf29fa6966923445:/embedded/app/usbcan/can/can.h diff --git a/embedded/app/usbcan/can/can.h b/embedded/app/usbcan/can/can.h index 38c68dd..4dacadf 100644 --- a/embedded/app/usbcan/can/can.h +++ b/embedded/app/usbcan/can/can.h @@ -27,14 +27,25 @@ */ /* - NOP count for synchronizing with peripheral (SJA1000) + Delay for synchronization with peripheral (SJA1000) */ - #define SJA1000_CLK (24000000) /* XTAL frequency */ - #define SJA1000_PRESC (2) /* embedded prescaler */ - #define SJA1000_CCLK (SJA1000_CLK/SJA1000_PRESC) /* SJA core frequency */ - #define SJA1000_SCLK (PCLK/SJA1000_CCLK) /* Clock count to synchronize with LPC */ + #define SJA1000_CLK (24000000) /* XTAL frequency */ + #define SJA1000_PRESC (2) /* embedded prescaler */ + #define SJA1000_CCLK (SJA1000_CLK/SJA1000_PRESC) /* SJA core frequency */ + #define SJA1000_SCLK (PCLK/SJA1000_CCLK) /* Clock count to synchronize with LPC */ - volatile int slowdown; + #define SJA1000_DELAY(void) \ + ({ \ + volatile int delay; \ + for (delay=0;delay