Rev 86 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 86 | Rev 87 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | * |
2 | * |
| 3 | * Main application |
3 | * Main application |
| 4 | * |
4 | * |
| 5 | ********************************************************************* |
5 | ********************************************************************* |
| 6 | * FileName: $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canBase/Source/Main.c $ |
6 | * FileName: $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canBase/Source/Main.c $ |
| 7 | * Last changed: $LastChangedDate: 2006-11-14 |
7 | * Last changed: $LastChangedDate: 2006-11-14 11:20:48 +0100 (Tue, 14 Nov 2006) $ |
| 8 | * By: $LastChangedBy: johboh $ |
8 | * By: $LastChangedBy: johboh $ |
| 9 | * Revision: $Revision: |
9 | * Revision: $Revision: 87 $ |
| 10 | ********************************************************************/ |
10 | ********************************************************************/ |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | #include <compiler.h> |
13 | #include <compiler.h> |
| 14 | #include <stackTasks.h> |
14 | #include <stackTasks.h> |
| Line 22... | Line 22... | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | void main() |
24 | void main() |
| 25 | { |
25 | { |
| 26 | static TICK t = 0; |
26 | static TICK t = 0; |
| - | 27 | CAN_MESSAGE cm2; |
|
| 27 | 28 | ||
| 28 | // Inits |
29 | // Inits |
| 29 | 30 | ||
| 30 | mainInit(); |
31 | mainInit(); |
| 31 | 32 | ||
| 32 | #ifdef USE_CAN |
33 | #ifdef USE_CAN |
| 33 | canInit(); |
34 | canInit(); |
| 34 | #endif |
35 | #endif |
| 35 | 36 | ||
| 36 | tickInit(); |
37 | tickInit(); |
| - | 38 | ||
| - | 39 | // Dummy bootmessage |
|
| - | 40 | cm2.data[0]=0x91; |
|
| - | 41 | cm2.data_length=1; |
|
| - | 42 | canSendMessage(cm2,PRIO_HIGH); |
|
| - | 43 | ||
| 37 | 44 | ||
| 38 | while(1) |
45 | while(1) |
| 39 | { |
46 | { |
| 40 | static TICK t = 0; |
47 | static TICK t = 0; |
| 41 | if ((tickGet()-t)>TICK_SECOND |
48 | if ((tickGet()-t)>TICK_SECOND) |
| 42 | { |
49 | { |
| 43 | LED0_IO=~LED0_IO; |
50 | LED0_IO=~LED0_IO; |
| - | 51 | t = tickGet(); |
|
| 44 | } |
52 | } |
| 45 | } |
53 | } |
| 46 | } |
54 | } |
| 47 | 55 | ||
| 48 | 56 | ||
| Line 102... | Line 110... | ||
| 102 | void canParse(CAN_MESSAGE cm) |
110 | void canParse(CAN_MESSAGE cm) |
| 103 | { |
111 | { |
| 104 | switch(cm.funct) |
112 | switch(cm.funct) |
| 105 | { |
113 | { |
| 106 | case FUNCT_BOOTLOADER: |
114 | case FUNCT_BOOTLOADER: |
| 107 | if (cm.funcc==FUNCC_BOOT_INIT) { |
115 | if (cm.funcc==FUNCC_BOOT_INIT) { Reset(); } |
| 108 | break; |
116 | break; |
| 109 | } |
117 | } |
| 110 | } |
118 | } |
| 111 | #endif |
119 | #endif |
| 112 | 120 | ||