Subversion Repositories HomeAutomation

Rev

Rev 967 | Rev 1006 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 967 Rev 1005
Line 25... Line 25...
25
    ///TODO: Initialize hardware etc here
25
    ///TODO: Initialize hardware etc here
26
    DDRC |= (1<<PC0);
26
    DDRC |= (1<<PC0);
27
    PORTC |= (1<<PC0);
27
    PORTC |= (1<<PC0);
28
 
28
 
29
    glcdPowerOn();
29
    glcdPowerOn();
30
 
-
 
31
    glcdSetXY(0,0);
-
 
32
    glcdSetXY(0,0);
-
 
33
    glcdSetXY(0,0);
-
 
34
 
30
 
35
    for (jxa = 0; jxa< 8; jxa++){
31
    for (jxa = 0; jxa< 8; jxa++){
36
        glcdSetXY(0,jxa);
32
        glcdSetXY(0,jxa);
37
        for (ixa = 0; ixa < 128; ixa++){
33
        for (ixa = 0; ixa < 128; ixa++){
38
            glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128));
34
            glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128));
39
        }
35
        }
40
    }
36
    }
41
 
-
 
42
}
37
}
43
 
38
 
44
void act_ks0108_Process(void)
39
void act_ks0108_Process(void)
45
{
40
{
46
    ///TODO: Stuff that needs doing is done here
41
    ///TODO: Stuff that needs doing is done here
47
}
42
}
48
 
43
 
49
void act_ks0108_HandleMessage(StdCan_Msg_t *rxMsg)
44
void act_ks0108_HandleMessage(StdCan_Msg_t *rxMsg)
50
{
45
{
51
    static uint8_t saer=0;
46
    static uint8_t saer=0;
-
 
47
    static uint8_t saer2=0;
52
    saer++;
48
    saer++;
53
    if (saer>6) {
49
    if (saer>10) {
54
        //glcdSetXY(0,0);
-
 
55
        //glcdPutStr("rad0.1");
-
 
56
        glcdSetXY(78,1);
-
 
57
        glcdPutStr("Hej!");
-
 
58
        glcdSetXY(78,2);
50
        saer2++;
59
        glcdPutStr("28 grader");
51
        for (jxa = 0; jxa< 8; jxa++){
60
        //glcdSetXY(3,3);
52
            glcdSetXY(0,jxa);
61
        //glcdPutStr("rad3.4");
-
 
62
        glcdSetXY(78,4);
-
 
63
        glcdPutStr("En för lång text");
53
            for (ixa = 0; ixa < 128; ixa++){
64
        /*glcdSetXY(5,5);
-
 
65
        glcdPutStr("rad5.6");
-
 
66
        glcdSetXY(6,6);
-
 
67
        glcdPutStr("rad6.7");
-
 
68
        glcdSetXY(7,7);
-
 
69
        glcdPutStr("rad7.8");
-
 
70
        glcdSetXY(8,8);
-
 
71
        glcdPutStr("rad7.8");
54
                glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128));
72
        */
-
 
73
 
-
 
74
    }
55
            }
75
    /*
-
 
76
    if (    StdCan_Ret_class(rxMsg->Header) == CAN_CLASS_MODULE_DEF && ///TODO: Change this to the actual class type
-
 
77
        StdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER &&
-
 
78
        rxMsg->Header.ModuleType == CAN_TYPE_MODULE_def_default && ///TODO: Change this to the actual module type
-
 
79
        rxMsg->Header.ModuleId == act_ks0108_ID)
-
 
80
    {
-
 
81
        switch (rxMsg->Header.Command)
-
 
82
        {
-
 
83
        case CAN_CMD_MODULE_DUMMY:
-
 
84
        ///TODO: Do something dummy
-
 
85
        break;
-
 
86
        }
56
        }
-
 
57
        saer=0;
-
 
58
        glcdSetXY(83,1);
-
 
59
        glcdPutStr("Tycker ");
-
 
60
        glcdSetXY(83,2);
-
 
61
        glcdPutStr(" detta ");
-
 
62
        glcdSetXY(83,3);
-
 
63
        glcdPutStr("funkar!");
-
 
64
        glcdSetXY(83,4);
-
 
65
        char buffer[20];   
-
 
66
        //numtoascii((int16_t)saer2 ,*buffer);
-
 
67
        unsignedtoascii((int16_t)saer2,0,buffer,1);
-
 
68
        glcdPutStr(buffer);
87
    }
69
    }
88
    */
-
 
89
}
70
}
90
 
71
 
91
void act_ks0108_List(uint8_t ModuleSequenceNumber)
72
void act_ks0108_List(uint8_t ModuleSequenceNumber)
92
{
73
{
93
    StdCan_Msg_t txMsg;
74
    StdCan_Msg_t txMsg;