Subversion Repositories HomeAutomation

Rev

Rev 341 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 341 Rev 353
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/canIR/Source/Main.c $
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canIR/Source/Main.c $
7
 * Last changed:    $LastChangedDate: 2007-02-25 21:15:41 +0100 (Sun, 25 Feb 2007) $
7
 * Last changed:    $LastChangedDate: 2007-03-03 19:07:14 +0100 (Sat, 03 Mar 2007) $
8
 * By:              $LastChangedBy: johboh $
8
 * By:              $LastChangedBy: johboh $
9
 * Revision:        $Revision: 341 $
9
 * Revision:        $Revision: 353 $
10
 ********************************************************************/
10
 ********************************************************************/
11
 
11
 
12
 
12
 
13
#include <compiler.h>
13
#include <compiler.h>
14
#include <stackTasks.h>
14
#include <stackTasks.h>
Line 25... Line 25...
25
static void mainInit(void);
25
static void mainInit(void);
26
 
26
 
27
 
27
 
28
void main()
28
void main()
29
{
29
{
30
    static TICK t = 0;
-
 
31
    CAN_PACKET outCp;
-
 
32
 
-
 
33
    // Inits
30
    // Inits
34
 
-
 
35
    mainInit();
31
    mainInit();
36
    canInit();
32
    canInit();
37
 
33
 
38
    #ifdef USE_IREC
34
    #ifdef USE_IREC
39
        irecInit();
35
        irecInit();
40
    #endif
36
    #endif
41
 
37
 
42
 
38
 
43
    while(1)
39
    while(1)
44
    {
40
    {  
-
 
41
        TICK currentTick = tickGet();
-
 
42
 
45
        static TICK t = 0;
43
        static TICK tick_led = 0;
-
 
44
 
46
 
45
 
47
        if ((tickGet()-t)>TICK_SECOND)
46
        if ((currentTick-tick_led)>(1*TICK_1S))
48
        {
47
        {
49
            LED0_IO=~LED0_IO;
48
            LED0_IO=~LED0_IO;
50
            t = tickGet();
49
            tick_led = currentTick;
51
        }
50
        }
52
    }
51
    }
53
}
52
}
54
 
53
 
55
 
54