|
@@ -77,6 +77,15 @@ uint8_t refreshAnimationCount = 1;
|
77
|
77
|
uint8_t lastButtonState = 0;
|
78
|
78
|
char buffer[11];
|
79
|
79
|
|
|
80
|
+uint8_t defaultImage[64] = { 0xe7, 0xc3, 0xa5, 0x18, 0x18, 0xa5, 0xc3, 0xe7,
|
|
81
|
+ 0x81, 0x81, 0x00, 0x18, 0x18, 0x00, 0x81, 0x81,
|
|
82
|
+ 0x81, 0x00, 0x81, 0x18, 0x18, 0x81, 0x00, 0x81,
|
|
83
|
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
|
|
84
|
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
|
|
85
|
+ 0x81, 0x00, 0x81, 0x18, 0x18, 0x81, 0x00, 0x81,
|
|
86
|
+ 0x81, 0x81, 0x00, 0x18, 0x18, 0x00, 0x81, 0x81,
|
|
87
|
+ 0xe7, 0xc3, 0xa5, 0x18, 0x18, 0xa5, 0xc3, 0xe7 };
|
|
88
|
+
|
80
|
89
|
int main(void) {
|
81
|
90
|
uint8_t *audioData = NULL;
|
82
|
91
|
uint8_t *imageData = NULL;
|
|
@@ -95,6 +104,8 @@ int main(void) {
|
95
|
104
|
DDRC = 0xFF; // Latch Enable
|
96
|
105
|
DDRA = 0xFF; // Latch Data
|
97
|
106
|
|
|
107
|
+ setImage(defaultImage); // Display something
|
|
108
|
+
|
98
|
109
|
#ifdef DEBUG
|
99
|
110
|
// Kill animation counter in debug mode
|
100
|
111
|
// => Don't preserve animations while power down
|
|
@@ -141,18 +152,20 @@ int main(void) {
|
141
|
152
|
i = 0;
|
142
|
153
|
}
|
143
|
154
|
|
144
|
|
- if (isFinished() > length) {
|
145
|
|
- // Load next image
|
146
|
|
- if (i < (count - 1)) {
|
147
|
|
- i++;
|
148
|
|
- } else {
|
149
|
|
- i = 0;
|
|
155
|
+ if (count > 0) {
|
|
156
|
+ if (isFinished() > length) {
|
|
157
|
+ // Load next image
|
|
158
|
+ if (i < (count - 1)) {
|
|
159
|
+ i++;
|
|
160
|
+ } else {
|
|
161
|
+ i = 0;
|
|
162
|
+ }
|
|
163
|
+
|
|
164
|
+ imageData = getFrame(i);
|
|
165
|
+ length = imageData[64];
|
|
166
|
+ setImage(imageData);
|
|
167
|
+ free(imageData);
|
150
|
168
|
}
|
151
|
|
-
|
152
|
|
- imageData = getFrame(i);
|
153
|
|
- length = imageData[64];
|
154
|
|
- setImage(imageData);
|
155
|
|
- free(imageData);
|
156
|
169
|
}
|
157
|
170
|
}
|
158
|
171
|
|