Advertisement
pabloducato

Untitled

May 28th, 2019
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.89 KB | None | 0 0
  1. /******************************************************************************
  2.  *****************************************************************************/
  3.  
  4.  
  5. #include "config.h"
  6.  
  7.  
  8. #include "lpc2294.h"
  9. #include "lcd.h"
  10. #include "uart.h"
  11. #include "armVIC.h"
  12. #include "can.h"
  13.  
  14.  
  15. #define STATE_0             0
  16. #define STATE_1             1
  17. #define STATE_2             2
  18. #define STATE_3             3
  19. #define STATE_4             4
  20. #define STATE_5             5
  21. #define STATE_6             6
  22. #define STATE_7             7
  23. #define STATE_8             8
  24. #define STATE_9             9
  25. #define STATE_10            10
  26.  
  27. #define STATE_MAX           STATE_10
  28.  
  29. unsigned char sendSymulPacket = _FALSE;
  30. unsigned char startSymulation = _FALSE;
  31. #ifdef uIP_IS_USED
  32. #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
  33. #endif  //uIP_IS_USED
  34.  
  35. void __attribute__ ((interrupt("IRQ"))) timer0_cmp(void);
  36. void systemInit(void);
  37. void gpioInit(void);
  38. const char AppTitle[] = " Magistrala CAN ";
  39.  
  40. #define   UIP_ARP_TIMER     1000
  41. #define   UIP_TX_TIMER      1
  42. #define   HALF_SEK          50
  43. #define   LED_TIMER         50
  44. #define   ONE_SEC           100
  45. #define   THREE_SEC         300
  46. #define   TWO_SEC           200
  47. #define   TEST_TIMER        100
  48.  
  49. int TX_EventPending = _FALSE;           // the hardware receive event
  50. int ARP_EventPending = _FALSE;          // trigger the arp timer event
  51. unsigned long half_Sec = HALF_SEK;
  52. unsigned long two_Sec = 0;
  53. unsigned long three_Sec = THREE_SEC;
  54. unsigned long Uip_Timer = UIP_TX_TIMER;
  55. unsigned long ten_Secs = UIP_ARP_TIMER;
  56. unsigned long LedTimer = LED_TIMER;
  57. unsigned long one_Sec = ONE_SEC;
  58. unsigned long TestTimer = TEST_TIMER;
  59.  
  60.  
  61. //=====================================================================
  62. //
  63. //=====================================================================
  64. void systemInit(void)
  65. {
  66.     // --- enable and connect the PLL (Phase Locked Loop) ---
  67.     // a. set multiplier and divider
  68.     SCB_PLLCFG = MSEL | (1<<PSEL1) | (0<<PSEL0);
  69.     // b. enable PLL
  70.     SCB_PLLCON = (1<<PLLE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement