Subversion Repositories HomeAutomation

Rev

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

Rev 679 Rev 763
Line 12... Line 12...
12
#include <avr/pgmspace.h>
12
#include <avr/pgmspace.h>
13
 
13
 
14
#define APP_TYPE    0xf001
14
#define APP_TYPE    0xf001
15
#define APP_VERSION 0x0002
15
#define APP_VERSION 0x0002
16
 
16
 
17
 
-
 
18
 
-
 
19
 
-
 
20
/* Left half of the LCD */
-
 
21
 
17
/*
22
static unsigned char Splash_left[] PROGMEM = {
18
static unsigned char Splash_left[] PROGMEM = {
23
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,
-
 
24
        0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,
19
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
25
        0xFF,0xFF,0x7F,0x7F,0x3F,0xBF,0x3F,0x1F,
20
          15,231,  3,241,250,171,115,181, 53, 54,110,254,254,254,110,180,
26
        0x3F,0x3F,0x3F,0x7F,0xFF,0xBF,0x1F,0x47,
21
          53, 53,113,171,251,242,240,  3, 15,255,255,255,255,255,255,255,
27
        0x87,0x07,0x07,0x07,0x27,0x77,0x77,0x67,
22
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
28
        0xE7,0xE7,0xE7,0xC7,0x87,0x07,0x07,0x07,
-
 
29
        0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x87,
23
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
30
        0xC7,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
31
        0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xEF,0x7F,
24
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
32
        0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,
25
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
33
        0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,
26
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
34
        0x3F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x1F,
27
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
35
        0x1F,0x1F,0x1F,0x1F,0x0F,0x1F,0x1F,0x1F,
28
           0,255,252,227, 31,191,127,254,254,255,191,119,119,119,191,255,
36
        0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,
-
 
37
        0x7F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,
29
         254,254,255,127, 63,223,227,252,252,129, 63,255,255,255,255,255,
38
        0x7F,0xFF,0xFF,0xFF,0x7F,0x7F,0xFF,0xFF,
-
 
39
        0xFE,0xFE,0xFE,0xFF,0xFF,0xFF,0xF8,0xF8,
-
 
40
        0xF0,0xF0,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,
-
 
41
        0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,
30
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
42
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,
31
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
43
        0x0C,0x0E,0x1C,0x3F,0x0F,0x03,0x00,0x04,
32
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
44
        0x04,0x87,0xCF,0x9F,0xFF,0xFE,0xFC,0xF8,
33
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
45
        0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,
34
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
46
        0xFF,0xFD,0xFF,0xFF,0xFF,0xDF,0xCF,0x1F,
35
         255,255,255,255,255,255,255,255,255,255,255,255,127, 31,135,217,
47
        0x3F,0x3F,0x13,0x03,0x01,0x10,0x1C,0x0C,
36
         220,223,  7,  1, 12, 47, 47,118,118,121,125,251,251,251,251,125,
48
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
 
49
        0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,
37
         121,118, 54, 15, 12,  9,  7, 15,223,223,216,167,143, 63,255,255,
50
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
 
51
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
 
52
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
 
53
        0x00,0x90,0xF8,0xF8,0xF8,0xF8,0xF8,0xCC,
-
 
54
        0xE0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC,0xFE,
-
 
55
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
56
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
57
        0xFF,0xFF,0xFF,0xFF,0xF8,0xF0,0xE0,0xE0,
38
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
58
        0xC0,0x80,0x00,0x00,0x00,0x80,0xC0,0xC0,
-
 
59
        0xE0,0xE0,0xC0,0xE0,0xF0,0xFC,0xFE,0xFE,
39
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
60
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
40
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
61
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
41
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
62
        0xFF,0xFF,0xFF,0x3F,0x1F,0x09,0x01,0x00,
42
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
63
        0x04,0x06,0x06,0x06,0x0E,0x1C,0x1E,0x18,
43
         255,255,255,255,255,255,255,255,255,255, 15,240,254,255,255,255,
64
        0x1C,0x18,0x19,0x19,0x01,0x03,0x00,0x00,
-
 
65
        0x00,0x07,0x46,0x00,0x00,0x80,0x80,0x80,
-
 
66
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
44
           7,  3,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
67
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
45
           0,  0,  0,  0,  0,  0,  0,  0,  3,  7,255,255,255,255,240, 15,
68
        0x00,0x00,0x84,0xFC,0xF8,0xF4,0xFE,0xFE,
46
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
69
        0xF7,0xFB,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
70
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
71
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
72
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
47
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
73
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
48
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
74
        0xFF,0xFF,0xFF,0xFC,0xFC,0xFC,0xFD,0xF9,
49
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
75
        0xF9,0xF3,0xFF,0xFF,0x5F,0x0F,0x0F,0x0F,
50
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
76
        0x0F,0x0F,0x1F,0x3F,0x3F,0x3F,0xFF,0xFF,
51
         255,255,255,255,255,255,255,255,127,131,252,255,255,255,255,159,
77
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
78
        0xFF,0xFF,0xF0,0xE0,0xC0,0xC0,0xC0,0xC0,
-
 
79
        0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,
52
         224,248,240,240,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
80
        0x00,0x00,0x00,0x00,0x00,0x03,0x06,0x00,
53
           0,  0,  0,  0,  0,  0,240,240,248,224, 31,255,255,255,255,252,
81
        0x88,0xC8,0xFC,0xFC,0xFE,0xFF,0xFF,0xFF,
-
 
82
        0xFF,0xFE,0xF0,0xE0,0xF8,0xFC,0xFE,0xFF,
-
 
83
        0xFE,0xFC,0xF8,0x30,0x30,0xE0,0xF6,0x7F,
-
 
84
        0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
54
         131,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
85
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
86
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
87
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
55
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
88
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
56
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
89
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
57
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
90
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
58
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
91
        0xFF,0xFF,0xFF,0xFD,0xF0,0xE0,0xC0,0x00,
59
         255,255,255,255,255,255,255,255,  0,255,255,255, 31,225,254,255,
92
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
60
         255,127, 31,  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
93
        0x01,0x01,0xF1,0xFB,0xFF,0xFF,0xFF,0xFF,
-
 
94
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
95
        0xFF,0xFF,0xFF,0xFE,0x98,0x00,0x00,0x00,
-
 
96
        0x00,0x00,0x00,0x00,0x80,0xC0,0xFE,0x7F,
61
           0,  0,  0,  0,  0,  0,  7, 31,127,255,255,254,225, 31,255,255,
97
        0x1F,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
98
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
99
        0xFF,0xFF,0xFF,0xFE,0xFC,0xFF,0xFF,0xFE,
-
 
100
        0xFE,0x7F,0x7E,0x3F,0x1F,0x1F,0x0F,0x0F,
62
         255,  0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
101
        0x3D,0x39,0x19,0x3B,0x7F,0xFF,0xFF,0xFF,
63
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
102
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
103
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
104
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
64
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
105
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
65
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
106
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
66
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
107
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,
67
         255,255,255,255,255,255,255,  7,248,255,255, 15,240,255,255, 15,
108
        0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,
68
          19, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
109
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
69
          28, 28, 28, 28, 28, 28, 28, 28, 28, 19, 15,255,255,240, 15,255,
110
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
70
         255,248,  7,255,255,255,255,255,255,255,255,255,255,255,255,255,
111
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xF0,0xF0,
71
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
112
        0xF0,0xF0,0xF8,0xFC,0xFF,0xFF,0xFF,0xFF,
72
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
113
        0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
73
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
114
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
74
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
115
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
75
         255,191, 95, 95,111,119,121,126,159,127,135,248,255,255,255,128,
116
        0xFC,0xF0,0xF0,0xF0,0xF8,0xF8,0xF8,0xF0,
76
           0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,248,248,  0,  0,
117
        0xF0,0xE0,0xC0,0xC0,0xE0,0xF0,0xFF,0xFF,
77
           0,  0,  0,  0,  0,  0,  0,  0,  0,  0,128,255,255,255,248,135,
118
        0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xDF,0xFF,
-
 
119
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
78
         127,159,126,121,119,111, 95, 95,191,255,255,255,255,255,255,255,
120
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
79
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
121
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
80
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
122
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
81
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
123
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF8,
82
         255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
124
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
125
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
126
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
127
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
128
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
129
        0xFF,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,
-
 
130
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,
-
 
131
        0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,
-
 
132
        0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,
-
 
133
        0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,
-
 
-
 
83
};
-
 
84
*/
134
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
85
static unsigned char Splash_left[] PROGMEM = {
135
        0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
-
 
136
        0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,
-
 
137
        0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
-
 
138
        0x03,0x03,0x03,0x03,0x03,0x01,0x03,0x03,
-
 
139
        0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x00,
-
 
140
        0x00,0x00,0x07,0x07,0x07,0x07,0x07,0x07,
-
 
141
        0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
-
 
142
        0x07,0x03,0x03,0x01,0x01,0x01,0x01,0x01,
86
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xe7,0x3,0xf1,0xfa,0xab,0x73,0xb5,0x35,0x36,0x6e,0xfe,0xfe,0xfe,0x6e,0xb4,0x35,0x35,0x71,0xab,0xfb,0xf2,0xf0,0x3,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0x7,0xff,//Line 1 
143
        0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
87
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xfc,0xe3,0x1f,0xbf,0x7f,0xfe,0xfe,0xff,0xbf,0x77,0x77,0x77,0xbf,0xff,0xfe,0xfe,0xff,0x7f,0x3f,0xdf,0xe3,0xfc,0xfc,0x81,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 2 
144
        0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
88
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x1f,0x87,0xd9,0xdc,0xdf,0x7,0x1,0xc,0x2f,0x2f,0x76,0x76,0x79,0x7d,0xfb,0xfb,0xfb,0xfb,0x7d,0x79,0x76,0x36,0xf,0xc,0x9,0x7,0xf,0xdf,0xdf,0xd8,0xa7,0x8f,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 3 
145
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
89
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xf0,0xfe,0xff,0xff,0xff,0x7,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x7,0xff,0xff,0xff,0xff,0xf0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 4 
146
        0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
90
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x83,0xfc,0xff,0xff,0xff,0xff,0x9f,0xe0,0xf8,0xf0,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf0,0xf0,0xf8,0xe0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x83,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 5 
147
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
91
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x1f,0xe1,0xfe,0xff,0xff,0x7f,0x1f,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x1f,0x7f,0xff,0xff,0xfe,0xe1,0x1f,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0x3,0xb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xb,0x3,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfc,0xff,//Line 6 
148
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
92
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xf8,0xff,0xff,0xf,0xf0,0xff,0xff,0xf,0x13,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x13,0xf,0xff,0xff,0xf0,0xf,0xff,0xff,0xf8,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//Line 7 
149
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
93
0xff,0xbf,0x5f,0x5f,0x6f,0x77,0x79,0x7e,0x9f,0x7f,0x87,0xf8,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8,0xf8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0xff,0xff,0xff,0xf8,0x87,0x7f,0x9f,0x7e,0x79,0x77,0x6f,0x5f,0x5f,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x0,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff//Line 7 
150
        0x00,0x01,0x05,0x05,0x07,0x07,0x07,0x07
-
 
151
         };
94
};
152
 
-
 
153
uint16_t ixa = 0;
95
uint16_t ixa = 0;
154
uint8_t jxa = 0;
96
uint8_t jxa = 0;
-
 
97
uint16_t sensor_Temperature = 12.7*(2<<(SNS_DECPOINT_VOLTAGE-1));
-
 
98
 
-
 
99
 
-
 
100
void numtoascii( int16_t num, char **str );
-
 
101
void signedtoascii(int16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals);
-
 
102
void unsignedtoascii(uint16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals);
-
 
103
 
-
 
104
 
155
 
105
 
156
 
106
 
157
// A simple message "queue", with space for one message only.
107
// A simple message "queue", with space for one message only.
158
// These are declared volatile to tell the compiler not to optimize away accesses.
108
// These are declared volatile to tell the compiler not to optimize away accesses.
159
volatile Can_Message_t rxMsg; // Message storage
109
volatile Can_Message_t rxMsg; // Message storage
Line 169... Line 119...
169
}
119
}
170
 
120
 
171
// Timer callback function used for some timer tests
121
// Timer callback function used for some timer tests
172
void timer_callback(uint8_t timer) {
122
void timer_callback(uint8_t timer) {
173
    Can_Message_t msg;
123
    Can_Message_t msg;
174
   
124
   
175
    msg.ExtendedFlag = 1;
125
    msg.ExtendedFlag = 1;
176
    msg.Id = (CAN_TST << CAN_SHIFT_CLASS) | NODE_ID;
126
    msg.Id = (CAN_TST << CAN_SHIFT_CLASS) | NODE_ID;
177
    msg.RemoteFlag = 0;
127
    msg.RemoteFlag = 0;
178
    msg.DataLength = 1;
128
    msg.DataLength = 1;
179
    msg.Data.bytes[0] = timer;
129
    msg.Data.bytes[0] = timer;
180
   
130
   
181
    BIOS_CanSend(&msg);
131
    BIOS_CanSend(&msg);
182
}
132
}
183
 
133
 
184
int main(void)
134
int main(void)
185
{
135
{
186
   
-
 
187
   
-
 
188
   
-
 
189
   
-
 
190
    //Initiera utgŒngar
-
 
191
 
-
 
192
    DDRB |= (1<<7)|(1<<2)|(1<<1)|(1<<0);
-
 
193
   
-
 
194
 
-
 
195
    DDRC |= (1<<5)|(1<<4);
-
 
196
   
-
 
197
 
-
 
198
    DDRD |= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0);
-
 
199
   
136
   
200
   
137
   
201
    // Enable interrupts as early as possible
138
    // Enable interrupts as early as possible
202
    sei();
139
    sei();
203
   
140
   
204
    unsigned long time;
141
    unsigned long time;
205
   
142
   
206
    Can_Message_t txMsg;
143
    Can_Message_t txMsg;
207
    txMsg.Id = (CAN_NMT_APP_START << CAN_SHIFT_NMT_TYPE) | (NODE_ID << CAN_SHIFT_NMT_SID);
144
    txMsg.Id = (CAN_NMT_APP_START << CAN_SHIFT_NMT_TYPE) | (NODE_ID << CAN_SHIFT_NMT_SID);
208
    txMsg.DataLength = 4;
145
    txMsg.DataLength = 4;
209
    txMsg.RemoteFlag = 0;
146
    txMsg.RemoteFlag = 0;
Line 213... Line 150...
213
   
150
   
214
    // Set up callback for CAN reception, this is optional if only sending is required.
151
    // Set up callback for CAN reception, this is optional if only sending is required.
215
    BIOS_CanCallback = &can_receive;
152
    BIOS_CanCallback = &can_receive;
216
    // Send CAN_NMT_APP_START
153
    // Send CAN_NMT_APP_START
217
    BIOS_CanSend(&txMsg);
154
    BIOS_CanSend(&txMsg);
218
   
-
 
219
 
-
 
220
 
-
 
221
    /* Kukgrejer frŒn apetech-libbet
-
 
222
    // Wait a little while the display starts up
-
 
223
    for(volatile uint16_t i=0; i<15000; i++);
-
 
224
   
-
 
225
    // Initialize the LCD
-
 
226
    ks0108Init(0);
-
 
227
   
-
 
228
    // Select a font
-
 
229
    ks0108SelectFont(Arial_Bold_14, ks0108ReadFontData, BLACK);
-
 
230
    // Set a position
-
 
231
    ks0108GotoXY(15,10);
-
 
232
    // Print some text
-
 
233
    ks0108Puts_P(PSTR("KS0108-Treiber"));
-
 
234
    // a nice little round rect
-
 
235
    ks0108DrawRoundRect(5, 5, 117, 20, 8, BLACK);
-
 
236
 
-
 
237
    // Once again :)
-
 
238
    // Select a font
-
 
239
    ks0108SelectFont(Corsiva_12, ks0108ReadFontData, BLACK);
-
 
240
    // Set a position
-
 
241
    ks0108GotoXY(5,0);
-
 
242
    // Print some text
-
 
243
    ks0108Puts_P(PSTR("http://www.apetech.de\nmailto:me@apetech.de"));
-
 
244
 
-
 
245
    */
-
 
246
   
155
   
247
   
156
   
248
   
157
   
249
   
158
   
-
 
159
    //Initiera utgŒngar
-
 
160
    DDRB |= (1<<7)|(1<<2)|(1<<1)|(1<<0);
-
 
161
    DDRC |= (1<<5)|(1<<4);  
-
 
162
    DDRD |= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0);
250
    glcdPowerOn();
163
    glcdPowerOn();
251
 
164
 
-
 
165
    glcdSetXY(0,0);
-
 
166
    glcdSetXY(0,0);
252
    glcdSetXY(0,0);
167
    glcdSetXY(0,0);
253
 
168
 
254
    //glcdPutStr("This is a test....... Let us try another row.. And another.. And some more..");
169
    //glcdPutStr("This is a test....... Let us try another row.. And another.. And some more..");
255
 
170
 
256
    for (jxa = 0; jxa< 8; jxa++){
171
    for (jxa = 0; jxa< 8; jxa++){
257
        glcdSetXY(0,jxa);
172
        glcdSetXY(0,jxa);
258
        for (ixa = 0; ixa < 128; ixa++){
173
        for (ixa = 0; ixa < 128; ixa++){
259
            glcdWriteData(pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128));
174
            glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128));
260
        }
175
        }
261
    }
176
    }
-
 
177
   
-
 
178
   
-
 
179
 
262
    glcdSetXY(0,0);
180
    //glcdSetXY(0,0);
263
    glcdPutStr("I can write text. This is cool. Yeah baby! Pixelina!");
181
    //glcdPutStr("I can write text. This is cool. Yeah baby! Pixelina!");
264
   
182
   
265
    /*glcdSetXY(5,5);
183
    /*glcdSetXY(5,5);
266
    glcdPutStr("I can write text.");
184
    glcdPutStr("I can write text.");
267
    glcdSetXY(8,10);
185
    glcdSetXY(8,10);
268
    glcdPutStr("Everywhere!");
186
    glcdPutStr("Everywhere!");
269
    */
187
    */
-
 
188
   
-
 
189
 
270
   
190
   
271
    while (1) {
191
    while (1) {
272
        //glcdSetXY(0,0);
-
 
273
        //glcdPutStr("This is a test.... Let us try another row.. And another.. And some more..");
-
 
274
 
192
 
275
       
193
       
276
        if (Timer_Expired(0)) {
-
 
277
            // Send a CAN message
-
 
278
            time = Timer_GetTicks();
-
 
279
            txMsg.Data.dwords[1] = time;
-
 
280
            BIOS_CanSend(&txMsg);
-
 
281
            //printf("Two seconds passed, time is now %ld.\n", time);
-
 
282
        }
-
 
283
       
-
 
284
        if (rxMsgFull) {
194
        if (rxMsgFull) {
285
            // Print the received message
195
            uint16_t sns_type;
-
 
196
            uint8_t snsid;
-
 
197
            if ( ((rxMsg.Id & CAN_MASK_CLASS)>>CAN_SHIFT_CLASS) == CAN_SNS){// FIXME ett jŠkla herk, stŠda upp
-
 
198
           
-
 
199
                sns_type = (uint16_t)((rxMsg.Id & CAN_MASK_SNS_TYPE) >> CAN_SHIFT_SNS_TYPE);
286
/*          printf("RX: ID=%08lx, DLC=%u, EXT=%u, RTR=%u, data={ ",
200
                snsid = (uint8_t)((rxMsg.Id & CAN_MASK_SNS_ID) >> CAN_SHIFT_SNS_ID);
-
 
201
               
287
                    rxMsg.Id,
202
                switch(sns_type)
-
 
203
                {
-
 
204
                case SNS_TYPE_TEMPERATURE:
288
                    (uint16_t)rxMsg.DataLength,
205
                    sensor_Temperature = rxMsg.Data.words[0];
-
 
206
                   
-
 
207
 
-
 
208
 
-
 
209
                    char buffer[20];   
-
 
210
 
-
 
211
                    unsignedtoascii(sensor_Temperature,SNS_DECPOINT_TEMPERATURE,buffer,1);
-
 
212
                   
289
                    (uint16_t)rxMsg.ExtendedFlag,
213
                    if (rxMsg.Id == 0x040a0413){
-
 
214
                        glcdSetXY(78,1);
-
 
215
                        glcdPutStr("UT:");
290
                    (uint16_t)rxMsg.RemoteFlag);
216
                        glcdPutStr(buffer);
-
 
217
                        //glcdPutStr("C");
291
            for (uint8_t i=0; i<rxMsg.DataLength; i++) {
218
                    } else if (rxMsg.Id == 0x040a0213) {
-
 
219
                        glcdSetXY(78,2);
-
 
220
                        glcdPutStr("IN:");
-
 
221
                        glcdPutStr(buffer);
-
 
222
                        //glcdPutStr("C");
292
                printf("%02x ", rxMsg.Data.bytes[i]);
223
                    } else if (rxMsg.Id == 0x040a0211) {
-
 
224
                        glcdSetXY(78,3);
-
 
225
                        glcdPutStr("TV:");
-
 
226
                        glcdPutStr(buffer);
-
 
227
                        //glcdPutStr("C");
293
            }
228
                    }
-
 
229
 
294
            printf("}\n");*/
230
                break;
-
 
231
                }
-
 
232
            }
295
            rxMsgFull = 0; //  
233
            rxMsgFull = 0;
-
 
234
        }
-
 
235
    }
-
 
236
   
-
 
237
    return 0;
-
 
238
}
-
 
239
 
-
 
240
    //‡ la pengi. Skall libbifieras.
-
 
241
    void numtoascii( int16_t num, char **str ) {
-
 
242
        if( num==0 ) return;
-
 
243
        numtoascii( num/10, str );
-
 
244
        **str = '0' + (num%10);
-
 
245
        (*str)++;
-
 
246
    }
-
 
247
 
-
 
248
    void signedtoascii(int16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals){ //decimalplace is number of decimals
-
 
249
        uint8_t i;
-
 
250
 
-
 
251
        if( num<0 ) {
-
 
252
            *(string++) = '-';
-
 
253
            num = -num;
-
 
254
        }
-
 
255
        numtoascii(num>>decimalplace, &string );
-
 
256
        if(numberofdecimals!=0) *(string++) = '.';
-
 
257
        for(i=0;i<numberofdecimals;i++) {
-
 
258
            num %= 1<<decimalplace;
-
 
259
            num *= 10;
-
 
260
            *(string++) = '0' + (num>>decimalplace);
296
        }
261
        }
-
 
262
        *(string++) = 0;
297
    }
263
    }
298
   
264
 
-
 
265
    void unsignedtoascii(uint16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals){ //decimalplace is number of decimals
-
 
266
        uint8_t i;
-
 
267
        numtoascii(num>>decimalplace, &string );
-
 
268
        if(numberofdecimals!=0) *(string++) = '.';
-
 
269
        for(i=0;i<numberofdecimals;i++) {
-
 
270
            num %= 1<<decimalplace;
299
    return 0;
271
            num *= 10;
-
 
272
            *(string++) = '0' + (num>>decimalplace);
-
 
273
        }
-
 
274
        *(string++) = 0;
300
}
275
    }