Rev 358 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 358 | Rev 359 | ||
|---|---|---|---|
| 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/canLCD/Source/Main.c $ |
6 | * FileName: $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canLCD/Source/Main.c $ |
| 7 | * Last changed: $LastChangedDate: 2007-03-04 |
7 | * Last changed: $LastChangedDate: 2007-03-04 15:13:16 +0100 (Sun, 04 Mar 2007) $ |
| 8 | * By: $LastChangedBy: johboh $ |
8 | * By: $LastChangedBy: johboh $ |
| 9 | * Revision: $Revision: |
9 | * Revision: $Revision: 359 $ |
| 10 | ********************************************************************/ |
10 | ********************************************************************/ |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | #include <compiler.h> |
13 | #include <compiler.h> |
| 14 | #include <stackTasks.h> |
14 | #include <stackTasks.h> |
| Line 456... | Line 456... | ||
| 456 | static TICK tick_pic = 0; |
456 | static TICK tick_pic = 0; |
| 457 | static TICK tick_temperature = 0; |
457 | static TICK tick_temperature = 0; |
| 458 | static TICK tick_door = 0; |
458 | static TICK tick_door = 0; |
| 459 | static TICK bounce_door = 0; |
459 | static TICK bounce_door = 0; |
| 460 | 460 | ||
| 461 | static |
461 | static BYTE lastDoorValue = DOOR_CLOSED; |
| 462 | static BOOL getNewTemperature = TRUE; |
462 | static BOOL getNewTemperature = TRUE; |
| 463 | 463 | ||
| 464 | static BYTE picCnt = 0; |
464 | static BYTE picCnt = 0; |
| 465 | 465 | ||
| 466 | if ((currentTick-tick_led)>(1*TICK_1S)) |
466 | if ((currentTick-tick_led)>(1*TICK_1S)) |
| Line 541... | Line 541... | ||
| 541 | CAN_PACKET outCp; |
541 | CAN_PACKET outCp; |
| 542 | outCp.type = ptPGM; |
542 | outCp.type = ptPGM; |
| 543 | outCp.pgm.class = pcSENSOR; |
543 | outCp.pgm.class = pcSENSOR; |
| 544 | outCp.pgm.id = pstDOOR_OUTSIDE; |
544 | outCp.pgm.id = pstDOOR_OUTSIDE; |
| 545 | outCp.length = 1; |
545 | outCp.length = 1; |
| 546 | outCp.data[0] = SW1_IO; |
546 | outCp.data[0] = (SW1_IO==DOOR_CLOSED?0:1); |
| 547 | while(!canSendMessage(outCp,PRIO_HIGH)); |
547 | while(!canSendMessage(outCp,PRIO_HIGH)); |
| 548 | 548 | ||
| 549 | tick_door = currentTick; |
549 | tick_door = currentTick; |
| 550 | } |
550 | } |
| 551 | #endif |
551 | #endif |