Browse Source

Misc. fixes.

Poti is now a multiplication, from 1 to 3,5. Also added basic noise
filtering. UploadTest can now send a specific byte as frame data.
Thomas Buck 12 years ago
parent
commit
03bc1cf9c2
7 changed files with 524 additions and 438 deletions
  1. 33
    7
      AudioFirmware/eq.c
  2. 0
    3
      AudioFirmware/eq.h
  3. 0
    4
      AudioFirmware/main.c
  4. 43
    35
      AudioFirmware/main.hex
  5. 405
    364
      CubeFirmware/main.hex
  6. 4
    0
      CubeFirmware/visualizer.c
  7. 39
    25
      UploadTest/main.c

+ 33
- 7
AudioFirmware/eq.c View File

@@ -43,13 +43,19 @@ uint8_t result[7] = {128, 128, 128, 128, 128, 128, 128};
43 43
 #define STROBEON STROBEPORT |= (1 << STROBE)
44 44
 #define STROBEOFF STROBEPORT &= ~(1 << STROBE)
45 45
 
46
+void equalizerInit(void);
47
+uint8_t *equalizerGet(void);
48
+void calcMultiplicator(uint8_t *d);
49
+void filterNoise(uint8_t *data);
50
+uint8_t getOffset(void);
51
+
46 52
 void equalizerInit(void) {
47 53
 	RESETON;
48 54
 	STROBEOFF;
49 55
 }
50 56
 
51 57
 uint8_t *equalizerGet(void) {
52
-	uint8_t i, offset = getOffset();
58
+	uint8_t i;
53 59
 
54 60
 	RESETOFF;
55 61
 	_delay_us(Trs);
@@ -60,19 +66,39 @@ uint8_t *equalizerGet(void) {
60 66
 		STROBEOFF;
61 67
 		_delay_us(To); // Wait for result
62 68
 
63
-		// Get result, takes ca. 29ms
64 69
 		adcStartConversion(0);
65
-		result[i] = offset + adcGetByte();
70
+		result[i] = adcGetByte();
66 71
 	}
67 72
 
68 73
 	RESETON;
69
-	asm volatile ("nop");
70
-	asm volatile ("nop");   // Ensure minimal reset pulse width
71
-							// 2 NOPs at 16MHz are enough...
74
+	asm volatile ("nop"); // Ensure minimal reset pulse width
75
+	asm volatile ("nop"); // 2 NOPs at 16MHz are enough...
76
+
77
+	filterNoise(result);
78
+	calcMultiplicator(result);
79
+
72 80
 	return result;
73 81
 }
74 82
 
83
+void calcMultiplicator(uint8_t *d) {
84
+	uint8_t i;
85
+	uint16_t multiplicator = ((uint16_t)getOffset() + 100) / 10;
86
+
87
+	for (i = 0; i < 7; i++) {
88
+		d[i] = (d[i] * multiplicator) / 10;
89
+	}
90
+}
91
+
92
+void filterNoise(uint8_t *data) {
93
+	uint8_t i;
94
+	for (i = 0; i < 7; i++) {
95
+		if (data[i] <= 40) {
96
+			data[i] = 0;
97
+		}
98
+	}
99
+}
100
+
75 101
 uint8_t getOffset(void) {
76 102
 	adcStartConversion(0x01);
77
-	return (adcGetByte() / 2);
103
+	return adcGetByte();
78 104
 }

+ 0
- 3
AudioFirmware/eq.h View File

@@ -28,6 +28,3 @@ void equalizerInit(void);
28 28
 // 7 elements in byte array
29 29
 // lowest to highest frequency
30 30
 uint8_t *equalizerGet(void);
31
-
32
-void eqLed(uint8_t *d);
33
-uint8_t getOffset(void);

+ 0
- 4
AudioFirmware/main.c View File

@@ -60,10 +60,6 @@ int main(void) {
60 60
 			music = equalizerGet();
61 61
 			twiSetDataToSend(music);
62 62
 		}
63
-
64
-		// Heartbeat
65
-		PORTB ^= (1 << PB1);
66
-
67 63
 		wdt_reset();
68 64
 	}
69 65
 

+ 43
- 35
AudioFirmware/main.hex View File

@@ -1,39 +1,47 @@
1 1
 :1000000012C02CC02BC02AC029C028C027C026C0BF
2 2
 :1000100025C024C023C022C021C020C01FC01EC0D4
3
-:100020001DC0A1C01BC011241FBECFE5D4E0DEBFA0
4
-:10003000CDBF10E0A0E6B0E0EEE4F2E002C0059033
3
+:100020001DC0CEC01BC011241FBECFE5D4E0DEBF73
4
+:10003000CDBF10E0A0E6B0E0E0EDF2E002C0059038
5 5
 :100040000D92AE36B107D9F710E0AEE6B0E001C0D0
6
-:100050001D92A037B107E1F702D0F7C0D1CFCF93FF
7
-:10006000DF9314BE88E10FB6F89481BD11BC0FBEBA
8
-:1000700086E087BB8CE084BB11BA82E4C8D032D062
9
-:1000800041D078942DE088E190E00FB6F894A895DF
10
-:1000900081BD0FBE21BD80E690E0C2D0D4E0C2E0B9
11
-:1000A000CDD0882329F088B38D2788BB33D0B8D032
12
-:1000B00088B38C2788BBA895F3CF97B1907F97B969
13
-:1000C00097B18F70892B87B9369A089581E0369958
14
-:1000D00080E00895FBDF8823E9F3369824B135B139
15
-:1000E000C901089517B83E9A86B1856086B9379AD6
16
-:1000F00080E0E3DFEFDF0895EDDF96958795969535
17
-:1001000087950895AB9AAA98089581E0D6DFF4DF29
18
-:10011000869508951F93CF93DF93F7DF182FAB9841
19
-:100120008FE191E00197F1F700C00000C0E6D0E058
20
-:10013000AA9A95E69A95F1F70000AA9880EC8A951C
21
-:10014000F1F780E0BADFD8DF810F899390E0C736FE
22
-:10015000D90771F7AB9A00000000CE010797DF9135
23
-:10016000CF911F9108951F920F920FB60F921124F5
24
-:100170008F939F93EF93FF9381B190E0887F883BAB
25
-:100180009105C1F0893B91053CF4883A910559F0FD
26
-:10019000803B910581F507C0803C910531F1883C99
27
-:1001A000910549F522C081E080936F00809167003E
28
-:1001B00083B915C080916F00863040F010926F00B7
29
-:1001C00080916D0083B986B78F7B11C0E82FF0E076
30
-:1001D000E959FF4F908193B98F5F80936F0086B785
31
-:1001E000806486BF10926E0006C086B7806486BFAA
32
-:1001F00081E080936E0086B7806886BFFF91EF91A3
33
-:100200009F918F910F900FBE0F901F90189588238C
34
-:1002100011F481E001C08E7F82B985E486BF089524
35
-:10022000282F392FD901E7E6F0E08D91819380E006
36
-:10023000EE36F807D1F710926E00089581E09091A4
37
-:0E0240006E00992309F480E00895F894FFCF32
38
-:0E024E00808080808080804242424242424254
6
+:100050001D92A037B107E1F702D038C1D1CFCF93BD
7
+:1000600014BE88E10FB6F89481BD11BC0FBE86E0C6
8
+:1000700087BB8CE084BB11BA82E4F6D02ED03DD091
9
+:1000800078942DE088E190E00FB6F894A89581BDB2
10
+:100090000FBE21BD80E690E0F0D0C4E0FCD0882304
11
+:1000A00029F088B38C2788BB61D0E7D0A895F6CF1C
12
+:1000B00097B1907F97B997B18F70892B87B9369A8E
13
+:1000C000089581E0369980E00895FBDF8823E9F305
14
+:1000D000369824B135B1C901089517B83E9A86B152
15
+:1000E000856086B9379A80E0E3DFEFDF0895EDDFC2
16
+:1000F00096958795969587950895AB9AAA980895B1
17
+:10010000E82FF92F87E09081993208F4108281500E
18
+:1001100031968823C1F7089581E0CADFE8DF0895AA
19
+:100120001F93CF93DF93D82FC92FF6DF90E08C5920
20
+:100130009F4F6AE070E0B6D09B01CE01E92FF82F07
21
+:1001400010E0CAE0D0E0408150E0249FC001259F2C
22
+:10015000900D349F900D1124BE01A4D061931F5FB8
23
+:10016000173089F7DF91CF911F910895CF93DF93D7
24
+:10017000AB988FE191E00197F1F700C00000C0E675
25
+:10018000D0E0AA9A95E69A95F1F70000AA9880EC3B
26
+:100190008A95F1F780E08CDFAADF899390E0C7367B
27
+:1001A000D90779F7AB9A00000000CE010797A8DFC6
28
+:1001B000CE010797B5DFCE010797DF91CF91089564
29
+:1001C0001F920F920FB60F9211248F939F93EF936C
30
+:1001D000FF9381B190E0887F883B9105C1F0893B16
31
+:1001E00091053CF4883A910559F0803B910581F5E1
32
+:1001F00007C0803C910531F1883C910549F522C04A
33
+:1002000081E080936F008091670083B915C0809171
34
+:100210006F00863040F010926F0080916D0083B9BE
35
+:1002200086B78F7B11C0E82FF0E0E959FF4F90812E
36
+:1002300093B98F5F80936F0086B7806486BF1092FA
37
+:100240006E0006C086B7806486BF81E080936E0032
38
+:1002500086B7806886BFFF91EF919F918F910F9035
39
+:100260000FBE0F901F901895882311F481E001C0F4
40
+:100270008E7F82B985E486BF0895282F392FD90152
41
+:10028000E7E6F0E08D91819380E0EE36F807D1F754
42
+:1002900010926E00089581E090916E00992309F408
43
+:1002A00080E00895AA1BBB1B51E107C0AA1FBB1F1A
44
+:1002B000A617B70710F0A61BB70B881F991F5A95F2
45
+:1002C000A9F780959095BC01CD010895F894FFCFD2
46
+:0E02D0008080808080808042424242424242D2
39 47
 :00000001FF

+ 405
- 364
CubeFirmware/main.hex View File

@@ -71,21 +71,21 @@
71 71
 :10046000038A03A003BA03D903E603F20306045385
72 72
 :100470007472696E67206E6F7420666F756E64218A
73 73
 :100480000A0011241FBECFE5D8E0DEBFCDBF11E0CA
74
-:10049000A0E6B0E0E4E9F3E202C005900D92AE37C9
75
-:1004A000B107D9F712E0AEE7B1E001C01D92A23664
76
-:1004B000B107E1F70E94A7020C94C8110C94000048
74
+:10049000A0E6B0E0ECE1F6E202C005900D92A638CD
75
+:1004A000B107D9F712E0A6E8B1E001C01D92AA3663
76
+:1004B000B107E1F70E94A7020C940C130C94000002
77 77
 :1004C000863561F1873580F4873411F1883438F44A
78 78
 :1004D0008234E1F08434C1F08F3331F513C08834B5
79 79
 :1004E00089F0833509F517C0883661F0893628F41C
80 80
 :1004F000843651F08736C1F40BC0833761F08637FC
81 81
 :1005000099F40CC086E00BC00E94BD0882E40DC0C7
82
-:100510000E947F0F08950E94490B089580E00E9479
82
+:100510000E94C31008950E948D0C089580E00E94EF
83 83
 :1005200026090E942D05089583E20E94ED04089596
84
-:10053000B0990AC080917F01882321F481E08093E3
85
-:100540007F0102C010927F0180917F0108954F9238
84
+:10053000B0990AC080918701882321F481E08093DB
85
+:10054000870102C0109287018091870108954F9220
86 86
 :100550005F926F927F928F929F92AF92BF92CF9253
87 87
 :10056000DF92EF92FF920F931F93CF93DF9384B7A5
88
-:1005700080939A0114BE98E10FB6F89491BD11BC16
88
+:100570008093A20114BE98E10FB6F89491BD11BC0E
89 89
 :100580000FBE8FEF8ABB8CEF81BB97BB84BB87B359
90 90
 :10059000866087BBB8980E94B30589E190E068E067
91 91
 :1005A00040E021E00E9457040E94A4060E941D081A
@@ -93,20 +93,20 @@
93 93
 :1005C0000FBE21BD81E690E00E945A050E9498026C
94 94
 :1005D000D82E0E948B08C22EB32EA42E952E862EC6
95 95
 :1005E000772E582E492E0E94DC08EC01FF24662449
96
-:1005F000EE2480917E01882309F4A895DD2069F01E
96
+:1005F000EE2480918601882309F4A895DD2069F016
97 97
 :100600000E94AF05882309F460C00E94FF0700978D
98 98
 :1006100009F45BC00E94960958C08091600088234D
99 99
 :1006200031F00E94DC08EC0110926000EE2420976B
100 100
 :10063000F1F00E94AF05681608F047C02E2D30E09B
101 101
 :10064000CE0101972817390710F4E39401C0EE2476
102 102
 :100650008E2D90E00E949C088C01FC01E05CFF4F15
103
-:1006600060800E945A05C8010E94F7102EC0809138
104
-:10067000800182FD2AC081FF0FC00E943A0BF8164C
105
-:1006800038F40F2D0F5F8F2D0E943C0BF02E1DC0F4
106
-:10069000809180018D7F16C00E94AF058033A8F045
103
+:1006600060800E945A05C8010E943B122EC08091F2
104
+:10067000880182FD2AC081FF0FC00E947E0CF816FF
105
+:1006800038F40F2D0F5F8F2D0E94800CF02E1DC0AF
106
+:10069000809188018D7F16C00E94AF058033A8F03D
107 107
 :1006A000EF2DF0E0EE0FFF1FEF59FE4F808191819B
108 108
 :1006B0000E945A053F2D333010F4F39406C0809108
109
-:1006C0008001826080938001FF240E948904882336
109
+:1006C0008801826080938801FF240E948904882326
110 110
 :1006D00021F00E9497040E9460020E948B08F22F72
111 111
 :1006E000FC19A1E02F1708F0A0E0232F2B19E1E05F
112 112
 :1006F000321708F0E0E0322F3A1BA32F31E02A171F
@@ -123,18 +123,18 @@
123 123
 :1007A000EE2329F4AA2319F4F73908F422CF0E9482
124 124
 :1007B0009802D82E0E948B08C22EB32EA42E952EFE
125 125
 :1007C000862E772E582E492E14CF1F920F920FB6D9
126
-:1007D0000F9211248F939F93EF93FF93E0918301E6
127
-:1007E000F09184018CB1E556FE4F808380918301A6
128
-:1007F000909184018F31910550F480918301909103
129
-:1008000084010196909384018093830104C0109227
130
-:10081000840110928301FF91EF919F918F910F902E
126
+:1007D0000F9211248F939F93EF93FF93E0918B01DE
127
+:1007E000F0918C018CB1ED55FE4F808380918B018F
128
+:1007F00090918C018F31910550F480918B019091F3
129
+:100800008C01019690938C0180938B0104C010920F
130
+:100810008C0110928B01FF91EF919F918F910F901E
131 131
 :100820000FBE0F901F9018951F920F920FB60F9248
132 132
 :1008300011242F933F938F939F93EF93FF932091D6
133
-:100840008501309186018091870190918801281758
134
-:100850003907F1F0E0918501F0918601E554FE4FF2
135
-:1008600080818CB980918501909186018F319105AD
136
-:1008700050F48091850190918601019690938601B4
137
-:100880008093850109C0109286011092850104C0F1
133
+:100840008D0130918E0180918F0190919001281738
134
+:100850003907F1F0E0918D01F0918E01ED53FE4FDB
135
+:1008600080818CB980918D0190918E018F3191059D
136
+:1008700050F480918D0190918E01019690938E019C
137
+:1008800080938D0109C010928E0110928D0104C0D9
138 138
 :1008900081E0809367015598FF91EF919F918F912F
139 139
 :1008A0003F912F910F900FBE0F901F9018954330DE
140 140
 :1008B00060F5362F3550343040F5322F315032301C
@@ -143,52 +143,52 @@
143 143
 :1008E000653061F0663011F0683029F420B522607F
144 144
 :1008F00020BD663019F020B5246020BD90BD89B9B7
145 145
 :100900008AB188698AB980E0089581E0089581E01C
146
-:10091000089540918101509182012091830130918D
147
-:10092000840181E04217530709F480E00895209183
148
-:100930008101309182018091830190918401281777
149
-:10094000390729F1E0918101F0918201E556FE4FCE
150
-:100950008081E0918101F0918201E556FE4F108285
151
-:1009600020918101309182012F31310558F420917D
152
-:100970008101309182012F5F3F4F3093820120939C
153
-:10098000810108951092820110928101089580E002
154
-:10099000089580918701909188012091850130917F
155
-:1009A000860101968217930791F0809185019091BD
156
-:1009B0008601009779F4209187013091880181E0C8
146
+:1009100008954091890150918A0120918B01309175
147
+:100920008C0181E04217530709F480E0089520917B
148
+:10093000890130918A0180918B0190918C01281757
149
+:10094000390729F1E0918901F0918A01ED55FE4FB7
150
+:100950008081E0918901F0918A01ED55FE4F10826E
151
+:100960002091890130918A012F31310558F420916D
152
+:10097000890130918A012F5F3F4F30938A01209384
153
+:100980008901089510928A0110928901089580E0EA
154
+:10099000089580918F019091900120918D01309167
155
+:1009A0008E0101968217930791F080918D019091AD
156
+:1009B0008E01009779F420918F013091900181E0B0
157 157
 :1009C00090E02F31310541F080E090E0089581E022
158
-:1009D00090E0089580E090E00895209187013091A3
159
-:1009E000880140918501509186012F5F3F4F241768
160
-:1009F000350799F320918501309186012115310544
161
-:100A000039F420918701309188012F31310529F384
162
-:100A1000E0918701F0918801E554FE4F8083809139
163
-:100A20008701909188018F31910550F48091870161
164
-:100A3000909188010196909388018093870104C06A
165
-:100A4000109288011092870180916701813021F412
158
+:1009D00090E0089580E090E0089520918F0130919B
159
+:1009E000900140918D0150918E012F5F3F4F241750
160
+:1009F000350799F320918D0130918E012115310534
161
+:100A000039F420918F01309190012F31310529F374
162
+:100A1000E0918F01F0919001ED53FE4F8083809122
163
+:100A20008F01909190018F31910550F480918F0149
164
+:100A30009091900101969093900180938F0104C052
165
+:100A40001092900110928F0180916701813021F402
166 166
 :100A500010926701559A5D9A0895CF93DF93C82F3E
167 167
 :100A6000D92F02C00E94ED0489918823D9F7DF9124
168
-:100A7000CF9108951AB810BC10BC19B81092820119
169
-:100A800010928101109286011092850110928401CA
170
-:100A9000109283011092880110928701089520918D
171
-:100AA0008D0130918E0140918F0150919001B901DB
172
-:100AB000CA0108957FB7F89421E02093890110922C
173
-:100AC0008A0110928C01482F592F80E090E019C0C4
168
+:100A7000CF9108951AB810BC10BC19B810928A0111
169
+:100A80001092890110928E0110928D0110928C01AA
170
+:100A900010928B011092900110928F010895209175
171
+:100AA0009501309196014091970150919801B901BB
172
+:100AB000CA0108957FB7F89421E020939101109224
173
+:100AC000920110929401482F592F80E090E019C0B4
174 174
 :100AD0006D916095F901EE0FFF1FEE0FFF1FEE0FF6
175
-:100AE000FF1FE80FF91FE552FE4F60832F5F3F4F56
175
+:100AE000FF1FE80FF91FED51FE4F60832F5F3F4F4F
176 176
 :100AF0002830310569F70196485F5F4F88309105CE
177 177
 :100B000021F0DA0120E030E0E3CF7FBF08959FB706
178
-:100B1000F89421E02093890110928A0110928C01AF
179
-:100B200020E030E0809510C0FB01E40FF51FE55296
178
+:100B1000F89421E020939101109292011092940197
179
+:100B200020E030E0809510C0FB01E40FF51FED518F
180 180
 :100B3000FE4F80834F5F5F4F48305105A9F72F5F0D
181 181
 :100B40003F4F2830310549F040E050E0B901E3E083
182 182
 :100B5000660F771FEA95E1F7E7CF9FBF0895809171
183
-:100B60008A01869508958EB589608EBD82EC92EAE1
183
+:100B60009201869508958EB589608EBD82EC92EAD9
184 184
 :100B70009BBD8ABD80E189BF80E00E948705789493
185 185
 :100B800080E090E061E01DC07FB7F894FA01E20FC9
186
-:100B9000F31FE552FE4FA0811082609389011092ED
187
-:100BA0008A0110928C017FBF70918A017723E1F353
186
+:100B9000F31FED51FE4FA0811082609391011092DE
187
+:100BA0009201109294017FBF709192017723E1F33B
188 188
 :100BB0002F5F3F4F2830310539F701968830910576
189 189
 :100BC00049F020E030E0AC01F3E0440F551FFA9506
190
-:100BD000E1F7DACFF89410928D0110928E01109205
191
-:100BE0008F011092900110928A0110928C01089549
190
+:100BD000E1F7DACFF89410929501109296011092F5
191
+:100BE0009701109298011092920110929401089529
192 192
 :100BF00089B78F7E89BF0895982F9C7F92BB98B349
193 193
 :100C0000880F880F880F8871977E892B88BB08957D
194 194
 :100C100095B3937095BB98B3997F98BB823058F089
@@ -197,18 +197,18 @@
197 197
 :100C400002C0220F331F8A95E2F7422B48BB6BBBD1
198 198
 :100C5000000008951F920F920FB60F9211242F9348
199 199
 :100C60003F934F935F936F937F938F939F93AF9334
200
-:100C7000BF93CF93DF93EF93FF9380918C0180918B
201
-:100C80008901882321F010928B011092890180E064
202
-:100C90000E94FC05C0E0D0E0E0918B01F0E0A3E011
203
-:100CA000EE0FFF1FAA95E1F7EC0FFD1FE552FE4F77
200
+:100C7000BF93CF93DF93EF93FF9380919401809183
201
+:100C80009101882321F0109293011092910180E04C
202
+:100C90000E94FC05C0E0D0E0E0919301F0E0A3E009
203
+:100CA000EE0FFF1FAA95E1F7EC0FFD1FED51FE4F70
204 204
 :100CB00060818C2F0E9408062196C830D10561F70B
205
-:100CC00020918B0181E090E002C0880F991F2A9546
206
-:100CD000E2F70E94FC0580918B01873030F480910F
207
-:100CE0008B018F5F80938B0107C010928B018091E5
208
-:100CF0008A018F5F80938A0110928C0180918D010F
209
-:100D000090918E01A0918F01B09190010196A11D4B
210
-:100D1000B11D80938D0190938E01A0938F01B093AC
211
-:100D20009001FF91EF91DF91CF91BF91AF919F9192
205
+:100CC0002091930181E090E002C0880F991F2A953E
206
+:100CD000E2F70E94FC0580919301873030F4809107
207
+:100CE00093018F5F8093930107C0109293018091CD
208
+:100CF00092018F5F809392011092940180919501EF
209
+:100D000090919601A0919701B09198010196A11D33
210
+:100D1000B11D8093950190939601A0939701B09394
211
+:100D20009801FF91EF91DF91CF91BF91AF919F918A
212 212
 :100D30008F917F916F915F914F913F912F910F9084
213 213
 :100D40000FBE0F901F90189511B88CE080B90895D0
214 214
 :100D500094EA96BF06B607FEFDCF91B1987F983012
@@ -234,7 +234,7 @@
234 234
 :100E9000FF920F931F93CF93DF934B015C0180E090
235 235
 :100EA000881680E0980681E0A80680E0B80618F46D
236 236
 :100EB00030EAE32E02C022EAE22E042F10E0C8013D
237
-:100EC0000E945D10EC016C01009759F18E2D0E947B
237
+:100EC0000E94A111EC016C01009759F18E2D0E9436
238 238
 :100ED000A806882321F50E94ED06882D0E94ED06C4
239 239
 :100EE0008E2D81600E94E406BB244801089481088D
240 240
 :100EF000910807C00E94FA06FE01EE0DFF1D8083D7
@@ -254,26 +254,26 @@
254 254
 :100FD000ED068C2FCD2DD82F03C089910E94ED06F0
255 255
 :100FE0008C2F8D198C15C8F30E94E706DF91CF91E5
256 256
 :100FF0001F910F91FF90EF90DF90CF900895CF93C6
257
-:10100000DF9383E40E94A806882389F4CBE1D2E031
258
-:101010000E94FA06899382E0C132D807C9F70E947C
259
-:101020000107809321020E94E706269702C0C0E0D4
257
+:10100000DF9383E40E94A806882389F4C3E2D2E038
258
+:101010000E94FA06899382E0C932D807C9F70E9474
259
+:101020000107809329020E94E706269702C0C0E0CC
260 260
 :10103000D0E0CE01DF91CF91089583B78B6083BF5D
261 261
 :101040008AEF8CBF89B7826089BF08951F920F9283
262 262
 :101050000FB60F9211242F933F934F935F936F938B
263
-:101060007F938F939F93AF93EF93FF934091920160
264
-:101070003091930120919401909195018091960176
265
-:10108000F0919701E0919801A0919901642F6F5F11
263
+:101060007F938F939F93AF93EF93FF9340919A0158
264
+:1010700030919B0120919C0190919D0180919E0156
265
+:10108000F0919F01E091A001A091A101642F6F5FF9
266 266
 :1010900051E0641708F050E0530F41E0531708F097
267 267
 :1010A00040E0420F31E0421708F030E0390F21E014
268 268
 :1010B000391708F020E0280F91E0281708F090E099
269 269
 :1010C0009F0F81E09F1708F080E08E0F71E08E1770
270
-:1010D00008F070E07A0F609392015093930140936F
271
-:1010E00094013093950120939601909397018093FA
272
-:1010F000980170939901FF91EF91AF919F918F911A
270
+:1010D00008F070E07A0F60939A0150939B0140935F
271
+:1010E0009C0130939D0120939E0190939F018093DA
272
+:1010F000A0017093A101FF91EF91AF919F918F910A
273 273
 :101100007F916F915F914F913F912F910F900FBE03
274
-:101110000F901F901895209192013091930140916A
275
-:101120009401509195016091960170919701809181
276
-:101130009801909199010895BC0126E0660F771FF0
274
+:101110000F901F90189520919A0130919B0140915A
275
+:101120009C0150919D0160919E0170919F01809161
276
+:10113000A0019091A1010895BC0126E0660F771FE0
277 277
 :101140002A95E1F7680F791F605E7F4F80E090E09D
278 278
 :1011500041E40E9441070895AB01BC0136E0660FEF
279 279
 :10116000771F3A95E1F7680F791F605E7F4F80E047
@@ -292,9 +292,9 @@
292 292
 :1012300058F4682F70E06E5F7F4F882777FD8095A8
293 293
 :10124000982F0E940807089580E008958A3248F494
294 294
 :10125000E82FF0E0EE0FFF1FE55EFB4F2591349184
295
-:1012600004C0EFE6F4E02591349182E292E0B90106
296
-:101270000E94901182E292E0089580E490E00E9442
297
-:101280005D109C01009709F4FFCFE82FF92FCF01E3
295
+:1012600004C0EFE6F4E0259134918AE292E0B901FE
296
+:101270000E94D4128AE292E0089580E490E00E94F5
297
+:10128000A1119C01009709F4FFCFE82FF92FCF019E
298 298
 :10129000805C9F4F1192E817F907E1F7C9010895A3
299 299
 :1012A000A7E0B0E0FD01E41BF109AD01421B5109CB
300 300
 :1012B0009A0143E0220F331F4A95E1F7E20FF31F33
@@ -304,286 +304,327 @@
304 304
 :1012F000331F5A95E1F7E20FF31FE80FF91F81E062
305 305
 :1013000090E002C0880F991F6A95E2F7809590815E
306 306
 :10131000982390830895282F392FF90180E41192A2
307
-:101320008150E9F708950E94F7100895AF92BF9297
307
+:101320008150E9F708950E943B120895AF92BF9251
308 308
 :10133000DF92EF92FF920F931F93DF93CF9300D032
309
-:10134000CDB7DEB7F82E092F0E943D095C01802F32
310
-:101350000F2D182F30E08FE1F82EF80181918F01C9
311
-:101360006F2D0E943D10D82E50E010C0C501632F94
312
-:101370004E2D252F3A8359830E945009E3945981B9
313
-:101380003A81ED149CF35F5F583011F0EE24F9CFF1
314
-:101390003F5F373011F7C5010E945A05C5010E9411
315
-:1013A00093090F900F90CF91DF911F910F91FF90B4
316
-:1013B000EF90DF90BF90AF9008950895EF92FF9265
317
-:1013C0000F931F93DF93CF930F92CDB7DEB70E9499
318
-:1013D0003D097C0117E01FC0C701602F432F212F5B
319
-:1013E00039830E94500939813F5F3830A9F70F5F78
320
-:1013F000083011F030E0F0CFC7010E945A0501C05B
321
-:10140000A8950E94AF058230D8F3C7010E948B09CE
322
-:1014100011501F3F11F000E0EDCFC7010E94F710FF
323
-:101420000F90CF91DF911F910F91FF90EF90089552
324
-:10143000EF92FF920F931F93DF93CF930F92CDB74D
325
-:10144000DEB70E943D097C0110E01FC0C701632F79
326
-:10145000402F212F39830E94500939813F5F383056
327
-:10146000A9F70F5F083011F030E0F0CFC7010E94FC
328
-:101470005A0501C0A8950E94AF058230D8F3C70174
329
-:101480000E948B091F5F183011F000E0EDCFC701FB
330
-:101490000E94F7100F90CF91DF911F910F91FF9055
331
-:1014A000EF900895EF92FF920F931F93DF93CF93E6
332
-:1014B0000F92CDB7DEB70E943D097C0117E01FC037
333
-:1014C000C701612F402F232F39830E945009398192
334
-:1014D0003F5F3830A9F70F5F083011F030E0F0CFF0
335
-:1014E000C7010E945A0501C0A8950E94AF0582302D
336
-:1014F000D8F3C7010E948B0911501F3F11F000E083
337
-:10150000EDCFC7010E94F7100F90CF91DF911F918F
338
-:101510000F91FF90EF900895EF92FF920F931F931A
339
-:10152000DF93CF930F92CDB7DEB70E943D097C01C8
340
-:1015300010E01FC0C701612F402F232F39830E9465
341
-:10154000500939813F5F3830A9F70F5F083011F03B
342
-:1015500030E0F0CFC7010E945A0501C0A8950E9453
343
-:10156000AF058230D8F3C7010E948B091F5F183086
344
-:1015700011F000E0EDCFC7010E94F7100F90CF915E
345
-:10158000DF911F910F91FF90EF900895EF92FF92DE
346
-:101590000F931F93DF93CF930F92CDB7DEB70E94C7
347
-:1015A0003D097C0117E01FC0C701602F412F232F89
348
-:1015B00039830E94500939813F5F3830A9F70F5FA6
349
-:1015C000083011F030E0F0CFC7010E945A0501C089
350
-:1015D000A8950E94AF058230D8F3C7010E948B09FD
351
-:1015E00011501F3F11F000E0EDCFC7010E94F7102E
352
-:1015F0000F90CF91DF911F910F91FF90EF90089581
353
-:10160000EF92FF920F931F93DF93CF930F92CDB77B
354
-:10161000DEB70E943D097C0110E01FC0C701602FAA
355
-:10162000412F232F39830E94500939813F5F383081
356
-:10163000A9F70F5F083011F030E0F0CFC7010E942A
357
-:101640005A0501C0A8950E94AF058230D8F3C701A2
358
-:101650000E948B091F5F183011F000E0EDCFC70129
359
-:101660000E94F7100F90CF91DF911F910F91FF9083
360
-:10167000EF90089586E00895863050F4E82FF0E06A
361
-:10168000EE0FFF1FE859FE4F0190F081E02D099504
362
-:1016900008952F923F924F925F926F927F928F9216
363
-:1016A0009F92AF92BF92CF92DF92EF92FF920F93F1
364
-:1016B0001F93DF93CF93CDB7DEB72B970FB6F89478
365
-:1016C000DEBF0FBECDBF81E490E00E945D10898334
366
-:1016D0009A832C010E948B08B22EC32ED42E152F74
367
-:1016E000062FF72EE82EA92E82E40E94ED046CC08E
368
-:1016F0000E948B08A22FAB19F1E02A1708F0F0E046
369
-:10170000232F2C19E1E0321708F0E0E0322F3F1BC5
370
-:10171000F32F31E02F1708F030E0E32B342F3D1981
371
-:1017200021E0431708F020E0432F4E1BE42F41E057
372
-:101730003E1708F040E0242B452F411B31E05417A1
373
-:1017400008F030E0542F521B21E0451708F020E04C
374
-:10175000322B462F401B21E0641708F020E0642F55
375
-:10176000631B31E0461708F030E0232B472F4F1959
376
-:1017700031E0741708F030E0742F721B21E0471736
377
-:1017800008F020E0322B482F4E1921E0841708F092
378
-:1017900020E0842F831B31E0481708F030E0232B32
379
-:1017A0009A19921789F4882379F4772369F46623C8
380
-:1017B00059F4552349F4EE2339F4F63028F4F53082
381
-:1017C00011F4AD3D08F4A8950E948904882309F41A
382
-:1017D0008FCF0E9497048B8382E40E94ED048824BB
383
-:1017E00099243324C201805C9F4F9F838E838EC1D6
384
-:1017F0000E948B08E22FEB19F1E02E1708F0F0E0C1
385
-:10180000232F2C19A1E0321708F0A0E0322F3F1B44
386
-:10181000F32F31E02F1708F030E0A32B342F3D19C0
387
-:1018200021E0431708F020E0432F4A1BA1E03417C2
388
-:1018300008F0A0E02A2BA52FA11B31E05A1708F0D1
389
-:1018400030E05A2F521B21E0A51708F020E0322B80
390
-:10185000B62FB01B21E06B1708F020E0AB2FA31BC5
391
-:1018600031E0BA1708F030E0232B672F6F1931E011
392
-:10187000761708F030E0762F721B21E0671708F02A
393
-:1018800020E0322B682F6E1921E0861708F020E047
394
-:10189000862F831B31E0681708F030E0232B9A195C
395
-:1018A000921789F4882379F4772369F4AA2359F4E9
396
-:1018B000552349F4442339F4F63028F4F53011F473
397
-:1018C000ED3D08F4A8950E948904882309F490CF7F
398
-:1018D0000E949704282E82E40E94ED0434010EC178
399
-:1018E0000E948B08E22FEB19F1E02E1708F0F0E0D0
400
-:1018F000A32FAC1921E03A1708F020E03A2F3F1B44
401
-:10190000F1E0A31708F0F0E02F2BA42FAD19F1E0C0
402
-:101910004A1708F0F0E04A2F421B21E0A41708F014
403
-:1019200020E0F22BA52FA11B21E05A1708F020E0A0
404
-:101930005A2F5F1BF1E0A51708F0F0E02F2BA62F20
405
-:10194000A01BF1E06A1708F0F0E06A2F621B21E0AB
406
-:10195000A61708F020E0F22B272F2F19A1E072170D
407
-:1019600008F0A0E0722F7F1BF1E0271708F0F0E0ED
408
-:10197000AF2BF82FFE1921E08F1708F020E08F2FF2
409
-:101980008A1BA1E0F81708F0A0E02A2B9A199217F9
410
-:1019900089F4882379F4772369F4662359F455236D
411
-:1019A00049F4442339F4363028F4353011F4ED3D50
412
-:1019B00008F4A8950E948904882309F491CF0E9415
413
-:1019C0009704EE81FF81808382E40E94ED04998177
414
-:1019D0008A81292F382FC901805C9F4F9D838C837A
415
-:1019E000398728876BC00E948B08E22FEB19F1E042
416
-:1019F0002E1708F0F0E0232F2C19A1E0321708F081
417
-:101A0000A0E0322F3F1BF32F31E02F1708F030E01A
418
-:101A1000A32B342F3D1921E0431708F020E0432F7A
419
-:101A20004A1BA1E0341708F0A0E02A2BA52FA11B28
420
-:101A300031E05A1708F030E05A2F521B21E0A51769
421
-:101A400008F020E0322BB62FB01B21E06B1708F016
422
-:101A500020E0AB2FA31B31E0BA1708F030E0232BB6
423
-:101A6000672F6F1931E0761708F030E0762F721B80
424
-:101A700021E0671708F020E0322B682F6E1921E073
425
-:101A8000861708F020E0862F831B31E0681708F0E6
426
-:101A900030E0232B9A19921789F4882379F477235D
427
-:101AA00069F4AA2359F4552349F4442339F4F63050
428
-:101AB00028F4F53011F4ED3D08F4A8950E9489044E
429
-:101AC000882309F490CF0E949704E885F9858193D3
430
-:101AD000F987E8872C813D81E217F30779F782E4E3
431
-:101AE0000E94ED0493012F5F3F4FC301B2012A878B
432
-:101AF0003B870E94AC082A853B853901862D8819D1
433
-:101B0000821508F457CF820C911C33943B81331615
434
-:101B100008F4D9CEC2010E94F7106CC00E948B0855
435
-:101B2000A22FAB19F1E02A1708F0F0E0232F2C19AF
436
-:101B3000E1E0321708F0E0E0322F3F1BF32F31E0F5
437
-:101B40002F1708F030E0E32B342F3D1921E0431725
438
-:101B500008F020E0432F4E1BE42F41E03E1708F031
439
-:101B600040E0242B452F411B31E0541708F030E0B2
440
-:101B7000542F521B21E0451708F020E0322B462F4E
441
-:101B8000401B21E0641708F020E0642F631B31E064
442
-:101B9000461708F030E0232B472F4F1931E0741718
443
-:101BA00008F030E0742F721B21E0471708F020E0A6
444
-:101BB000322B482F4E1921E0841708F020E0842FA3
445
-:101BC000831B31E0481708F030E0232B9A19921755
446
-:101BD00089F4882379F4772369F4662359F455232B
447
-:101BE00049F4EE2339F4F63028F4F53011F4AD3D24
448
-:101BF00008F4A8950E948904882309F48FCF0E94D5
449
-:101C000097046CC00E948B08A22FAB19F1E02A1731
450
-:101C100008F0F0E0232F2C19E1E0321708F0E0E0A3
451
-:101C2000322F3F1BF32F31E02F1708F030E0E32B6A
452
-:101C3000342F3D1921E0431708F020E0432F4E1BBD
453
-:101C4000E42F41E03E1708F040E0242B452F411BD4
454
-:101C500031E0541708F030E0542F521B21E04517B3
455
-:101C600008F020E0322B462F401B21E0641708F0DB
456
-:101C700020E0642F631B31E0461708F030E0232B8F
457
-:101C8000472F4F1931E0741708F030E0742F721BA2
458
-:101C900021E0471708F020E0322B482F4E1921E0B1
459
-:101CA000841708F020E0842F831B31E0481708F0E8
460
-:101CB00030E0232B9A19921789F4882379F477233B
461
-:101CC00069F4662359F4552349F4EE2339F4F630C8
462
-:101CD00028F4F53011F4AD3D08F4A8950E9489046C
463
-:101CE000882309F48FCF0E9497046CC00E948B0850
464
-:101CF000A22FAB19F1E02A1708F0F0E0232F2C19DE
465
-:101D0000E1E0321708F0E0E0322F3F1BF32F31E023
466
-:101D10002F1708F030E0E32B342F3D1921E0431753
467
-:101D200008F020E0432F4E1BE42F41E03E1708F05F
468
-:101D300040E0242B452F411B31E0541708F030E0E0
469
-:101D4000542F521B21E0451708F020E0322B462F7C
470
-:101D5000401B21E0641708F020E0642F631B31E092
471
-:101D6000461708F030E0232B472F4F1931E0741746
472
-:101D700008F030E0742F721B21E0471708F020E0D4
473
-:101D8000322B482F4E1921E0841708F020E0842FD1
474
-:101D9000831B31E0481708F030E0232B9A19921783
475
-:101DA00089F4882379F4772369F4662359F4552359
476
-:101DB00049F4EE2339F4F63028F4F53011F4AD3D52
477
-:101DC00008F4A8950E948904882309F48FCF0E9403
478
-:101DD00097046CC00E948B08A22FAB19F1E02A1760
479
-:101DE00008F0F0E0232F2C19E1E0321708F0E0E0D2
480
-:101DF000322F3F1BF32F31E02F1708F030E0E32B99
481
-:101E0000342F3D1921E0431708F020E0432F4E1BEB
482
-:101E1000E42F41E03E1708F040E0242B452F411B02
483
-:101E200031E0541708F030E0542F521B21E04517E1
484
-:101E300008F020E0322B462F401B21E0641708F009
485
-:101E400020E0642F631B31E0461708F030E0232BBD
486
-:101E5000472F4F1931E0741708F030E0742F721BD0
487
-:101E600021E0471708F020E0322B482F4E1921E0DF
488
-:101E7000841708F020E0842F831B31E0481708F016
489
-:101E800030E0232B9A19921789F4882379F4772369
490
-:101E900069F4662359F4552349F4EE2339F4F630F6
491
-:101EA00028F4F53011F4AD3D08F4A8950E9489049A
492
-:101EB000882309F48FCF0E94970482E40E94ED04E6
493
-:101EC000C4010E94F80881E0809360002B960FB651
494
-:101ED000F894DEBF0FBECDBFCF91DF911F910F9160
495
-:101EE000FF90EF90DF90CF90BF90AF909F908F903A
496
-:101EF0007F906F905F904F903F902F9008956F92DA
497
-:101F00007F928F929F92AF92BF92CF92DF92EF9289
498
-:101F1000FF920F931F93CF93DF930E94DC086C0115
499
-:101F20006FEF70E00E944910009711F4862E02C0F6
500
-:101F3000862E839482E40E94ED04882D0E94ED0495
501
-:101F40000E949704823409F058C000E010E041C0BC
502
-:101F50008FEFC816D10409F010F49C2C02C099240C
503
-:101F60009A94892D0E94ED040E949704823409F00E
504
-:101F700044C0780126C0C7010E949C08EC01FC0106
505
-:101F8000E05CFF4F80810E94ED040E949704823440
506
-:101F900089F45E0180E4682EF50181915F010E9461
507
-:101FA000ED046A94C9F70E9497040894E11CF11C9F
508
-:101FB000823421F0CE010E94F7101FC0CE010E9492
509
-:101FC000F7108E2D87198915B0F2C918D108015064
510
-:101FD0001F4F702E802F8195881508F4B9CF82E4A9
511
-:101FE0000E94ED0482E40E94ED0482E40E94ED046C
512
-:101FF00082E40E94ED040E949704DF91CF911F912B
513
-:102000000F91FF90EF90DF90CF90BF90AF909F9097
514
-:102010008F907F906F9008951F93CF93DF930E94CE
515
-:10202000FF07EC01009731F485E10E9426090E9428
516
-:102030002D051FC086E10E9426090E942D0510E390
517
-:10204000812F0E94ED0484E791E00E942D05899183
518
-:1020500090E062E272E04AE050E00E94971182E272
519
-:1020600092E00E942D058AE00E94ED041F5F173365
520
-:1020700039F7DF91CF911F910895991B79E004C042
521
-:10208000991F961708F0961B881F7A95C9F78095B7
522
-:102090000895AA1BBB1B51E107C0AA1FBB1FA617AF
523
-:1020A000B70710F0A61BB70B881F991F5A95A9F701
524
-:1020B00080959095BC01CD010895CF93DF93823038
525
-:1020C000910510F482E090E0E0916002F0916102ED
526
-:1020D00040E050E020E030E026C060817181681768
527
-:1020E0007907E0F06817790781F4828193812115DF
528
-:1020F000310531F0D90113969C938E9312972BC022
529
-:10210000909361028093600226C04115510519F039
530
-:102110006417750718F4AB01E901DF019F017281B3
531
-:102120006381E72FF62F3097C1F64115510501F174
532
-:10213000481B590B4430510580F412968D919C91A7
533
-:102140001397209719F09B838A8304C090936102B0
534
-:1021500080936002FD01329646C0FD01E40FF51F39
535
-:10216000819391934250504011965C934E933BC0A3
536
-:1021700020915E0230915F022115310541F42091DA
537
-:10218000790130917A0130935F0220935E022091B1
538
-:102190007B0130917C012115310541F42DB73EB70B
539
-:1021A0004091770150917801241B350BE0915E023C
540
-:1021B000F0915F02E217F307A0F42E1B3F0B2817E4
541
-:1021C000390778F0AC014E5F5F4F2417350748F0B0
542
-:1021D0004E0F5F1F50935F0240935E028193919375
543
-:1021E00002C0E0E0F0E0CF01DF91CF910895CF93FE
544
-:1021F000DF93009709F491C0FC0132971382128299
545
-:1022000060916002709161026115710581F4208115
546
-:102210003181280F391F80915E0290915F028217F1
547
-:10222000930799F5F0935F02E0935E0276C0DB01BD
548
-:1022300080E090E002C0CD01D901AE17BF0748F49D
549
-:1022400012962D913C91139721153105A1F7CD01DF
550
-:1022500021C0B383A283EF01499159919E01240FBC
551
-:10226000351FA217B30779F42D913C911197240FD4
552
-:10227000351F2E5F3F4F3183208312962D913C9165
553
-:10228000139733832283009729F4F0936102E0933C
554
-:10229000600243C0DC011396FC93EE9312974D91BC
555
-:1022A0005D91A40FB51FEA17FB0769F42081318106
556
-:1022B000240F351F2E5F3F4FEC0139832883228185
557
-:1022C00033813B832A83E0E0F0E002C0FB01BC01E4
558
-:1022D000DB0112968D919C9113970097B9F79B01A2
559
-:1022E0002E5F3F4F8D919C911197820F931F4091CC
560
-:1022F0005E0250915F024817590779F4309729F42C
561
-:10230000109261021092600202C013821282225067
562
-:10231000304030935F0220935E02DF91CF910895A9
563
-:10232000FB01DC0105900D920020E1F70895FB010F
564
-:102330009F01E8944230C4F04532B4F44A3029F4A5
565
-:1023400097FB1EF4909581959F4F642F77270E94ED
566
-:102350004910805D8A330CF0895D8193CB01009731
567
-:10236000A1F716F45DE251931082C9010C94B811E3
568
-:10237000DC01FC01672F71917723E1F7329704C0EC
569
-:102380007C916D9370836291AE17BF07C8F3089577
570
-:04239000F894FFCFEF
571
-:1023940001FFFFFFFFFFFFFFFFFF8181818181813B
572
-:1023A400FFFF818181818181FFFF81818181818121
573
-:1023B400FFFF818181818181FFFF81818181818111
574
-:1023C400FFFF818181818181FFFFFFFFFFFFFFFF0D
575
-:1023D400FFFF010101FF8080FFFF010101FF8080F9
576
-:1023E400FFFF010101FF8080FFFF010101FF8080E9
577
-:1023F400FFFF010101FF8080FFFF010101FF8080D9
578
-:10240400FFFF010101FF8080FFFF010101FF8080C8
579
-:10241400FF7E818181FF8181817E818181FF818134
580
-:10242400817E818181FF8181817E818181FF8181A2
581
-:10243400817E818181FF8181817E818181FF818192
582
-:10244400817E818181FF8181817E818181FF818182
583
-:10245400811E2222221E0202021E2222221E0202A9
584
-:10246400021E2222221E0202021E2222221E020218
585
-:10247400021E2222221E0202021E2222221E020208
586
-:10248400021E2222221E0202021E2222221E0202F8
587
-:1024940002A100E100210101000BC60A8C0A520AC4
588
-:0E24A400180ADE093A20002000620200000043
309
+:10134000CDB7DEB7F82E092F0E943D095C010E943F
310
+:101350008B09802F0F2D182F30E08FE1F82EF80128
311
+:1013600081918F016F2D0E948111D82E50E010C005
312
+:10137000C501632F4E2D252F3A8359830E945009B2
313
+:10138000E39459813A81ED149CF35F5F583011F07A
314
+:10139000EE24F9CF3F5F373011F7C5010E945A059F
315
+:1013A000C5010E9493090F900F90CF91DF911F917B
316
+:1013B0000F91FF90EF90DF90BF90AF900895089548
317
+:1013C0000F931F93CF93DF930E943D09EC0110E030
318
+:1013D00012C0CE01612F402F20E00E945009CE01A3
319
+:1013E000612F402F27E00E9450090F5F083089F7D6
320
+:1013F0001F5F1830B1F000E0ECCFCE0160E0412F6C
321
+:10140000202F0E945009CE0168E0412F202F0E941A
322
+:1014100050090F5F083089F71F5F183019F410E08A
323
+:1014200015C010E000E0E9CFCE01612F40E0202F91
324
+:101430000E945009CE01612F48E0202F0E945009E0
325
+:101440000F5F083089F71F5F183011F000E0ECCF14
326
+:10145000CE010E945A0501C0A8950E94AF058230B6
327
+:10146000D8F3CE010E948B09CE010E943B12DF917E
328
+:10147000CF911F910F9108950F931F93CF93DF93F7
329
+:101480000E943D09EC0111E012C0CE01612F402FF6
330
+:1014900021E00E945009CE01612F402F26E00E94DA
331
+:1014A00050090F5F073089F71F5F1730B1F001E077
332
+:1014B000ECCFCE0161E0412F202F0E945009CE01D8
333
+:1014C00066E0412F202F0E9450090F5F073089F7F7
334
+:1014D0001F5F173019F411E015C011E001E0E9CFEA
335
+:1014E000CE01612F41E0202F0E945009CE01612FD3
336
+:1014F00046E0202F0E9450090F5F073089F71F5FD9
337
+:10150000173011F001E0ECCFCE010E945A0501C066
338
+:10151000A8950E94AF058230D8F3CE010E948B09B6
339
+:10152000CE010E943B12DF91CF911F910F91089540
340
+:101530000F931F93CF93DF930E943D09EC0112E0BC
341
+:1015400012C0CE01612F402F22E00E945009CE012F
342
+:10155000612F402F25E00E9450090F5F063089F768
343
+:101560001F5F1630B1F002E0ECCFCE0162E0412FF8
344
+:10157000202F0E945009CE0165E0412F202F0E94AC
345
+:1015800050090F5F063089F71F5F163019F412E01B
346
+:1015900015C012E002E0E9CFCE01612F42E0202F1A
347
+:1015A0000E945009CE01612F45E0202F0E94500972
348
+:1015B0000F5F063089F71F5F163011F002E0ECCFA5
349
+:1015C000CE010E945A0501C0A8950E94AF05823045
350
+:1015D000D8F3CE010E948B09CE010E943B12DF910D
351
+:1015E000CF911F910F910895CF93DF930E943D09F2
352
+:1015F000EC0163E043E023E00E945009CE0164E087
353
+:1016000043E023E00E945009CE0164E044E023E07F
354
+:101610000E945009CE0164E044E024E00E94500999
355
+:10162000CE010E945A0501C0A8950E94AF058230E4
356
+:10163000D8F3CE010E948B09CE010E943B12DF91AC
357
+:10164000CF910895EF92FF920F931F93DF93CF9363
358
+:101650000F92CDB7DEB70E943D097C0117E01FC095
359
+:10166000C701602F432F212F39830E9450093981F0
360
+:101670003F5F3830A9F70F5F083011F030E0F0CF4E
361
+:10168000C7010E945A0501C0A8950E94AF0582308B
362
+:10169000D8F3C7010E948B0911501F3F11F000E0E1
363
+:1016A000EDCFC7010E943B120F90CF91DF911F91A8
364
+:1016B0000F91FF90EF900895EF92FF920F931F9379
365
+:1016C000DF93CF930F92CDB7DEB70E943D097C0127
366
+:1016D00010E01FC0C701632F402F212F39830E94C4
367
+:1016E000500939813F5F3830A9F70F5F083011F09A
368
+:1016F00030E0F0CFC7010E945A0501C0A8950E94B2
369
+:10170000AF058230D8F3C7010E948B091F5F1830E4
370
+:1017100011F000E0EDCFC7010E943B120F90CF9176
371
+:10172000DF911F910F91FF90EF900895EF92FF923C
372
+:101730000F931F93DF93CF930F92CDB7DEB70E9425
373
+:101740003D097C0117E01FC0C701612F402F232FE7
374
+:1017500039830E94500939813F5F3830A9F70F5F04
375
+:10176000083011F030E0F0CFC7010E945A0501C0E7
376
+:10177000A8950E94AF058230D8F3C7010E948B095B
377
+:1017800011501F3F11F000E0EDCFC7010E943B1246
378
+:101790000F90CF91DF911F910F91FF90EF900895DF
379
+:1017A000EF92FF920F931F93DF93CF930F92CDB7DA
380
+:1017B000DEB70E943D097C0110E01FC0C701612F08
381
+:1017C000402F232F39830E94500939813F5F3830E1
382
+:1017D000A9F70F5F083011F030E0F0CFC7010E9489
383
+:1017E0005A0501C0A8950E94AF058230D8F3C70101
384
+:1017F0000E948B091F5F183011F000E0EDCFC70188
385
+:101800000E943B120F90CF91DF911F910F91FF909B
386
+:10181000EF900895EF92FF920F931F93DF93CF9372
387
+:101820000F92CDB7DEB70E943D097C0117E01FC0C3
388
+:10183000C701602F412F232F39830E94500939811E
389
+:101840003F5F3830A9F70F5F083011F030E0F0CF7C
390
+:10185000C7010E945A0501C0A8950E94AF058230B9
391
+:10186000D8F3C7010E948B0911501F3F11F000E00F
392
+:10187000EDCFC7010E943B120F90CF91DF911F91D6
393
+:101880000F91FF90EF900895EF92FF920F931F93A7
394
+:10189000DF93CF930F92CDB7DEB70E943D097C0155
395
+:1018A00010E01FC0C701602F412F232F39830E94F2
396
+:1018B000500939813F5F3830A9F70F5F083011F0C8
397
+:1018C00030E0F0CFC7010E945A0501C0A8950E94E0
398
+:1018D000AF058230D8F3C7010E948B091F5F183013
399
+:1018E00011F000E0EDCFC7010E943B120F90CF91A5
400
+:1018F000DF911F910F91FF90EF9008958AE0089576
401
+:101900008A3050F4E82FF0E0EE0FFF1FE859FE4F49
402
+:101910000190F081E02D099508952F923F924F920A
403
+:101920005F926F927F928F929F92AF92BF92CF926F
404
+:10193000DF92EF92FF920F931F93DF93CF93CDB778
405
+:10194000DEB72B970FB6F894DEBF0FBECDBF81E494
406
+:1019500090E00E94A11189839A832C010E948B0838
407
+:10196000B22EC32ED42E152F062FF72EE82EA92E19
408
+:1019700082E40E94ED046CC00E948B08A22FAB1978
409
+:10198000F1E02A1708F0F0E0232F2C19E1E03217DC
410
+:1019900008F0E0E0322F3F1BF32F31E02F1708F063
411
+:1019A00030E0E32B342F3D1921E0431708F020E00D
412
+:1019B000432F4E1BE42F41E03E1708F040E0242B5C
413
+:1019C000452F411B31E0541708F030E0542F521BD3
414
+:1019D00021E0451708F020E0322B462F401B21E084
415
+:1019E000641708F020E0642F631B31E0461708F00D
416
+:1019F00030E0232B472F4F1931E0741708F030E007
417
+:101A0000742F721B21E0471708F020E0322B482F7B
418
+:101A10004E1921E0841708F020E0842F831B31E069
419
+:101A2000481708F030E0232B9A19921789F488237D
420
+:101A300079F4772369F4662359F4552349F4EE23A6
421
+:101A400039F4F63028F4F53011F4AD3D08F4A895DA
422
+:101A50000E948904882309F48FCF0E9497048B8306
423
+:101A600082E40E94ED04882499243324C201805C1E
424
+:101A70009F4F9F838E838EC10E948B08E22FEB19AC
425
+:101A8000F1E02E1708F0F0E0232F2C19A1E0321717
426
+:101A900008F0A0E0322F3F1BF32F31E02F1708F0A2
427
+:101AA00030E0A32B342F3D1921E0431708F020E04C
428
+:101AB000432F4A1BA1E0341708F0A0E02A2BA52FE2
429
+:101AC000A11B31E05A1708F030E05A2F521B21E0D9
430
+:101AD000A51708F020E0322BB62FB01B21E06B17C2
431
+:101AE00008F020E0AB2FA31B31E0BA1708F030E07C
432
+:101AF000232B672F6F1931E0761708F030E0762F2F
433
+:101B0000721B21E0671708F020E0322B682F6E1956
434
+:101B100021E0861708F020E0862F831B31E068174C
435
+:101B200008F030E0232B9A19921789F4882379F46E
436
+:101B3000772369F4AA2359F4552349F4442339F44B
437
+:101B4000F63028F4F53011F4ED3D08F4A8950E9424
438
+:101B50008904882309F490CF0E949704282E82E4F8
439
+:101B60000E94ED0434010EC10E948B08E22FEB1994
440
+:101B7000F1E02E1708F0F0E0A32FAC1921E03A179E
441
+:101B800008F020E03A2F3F1BF1E0A31708F0F0E047
442
+:101B90002F2BA42FAD19F1E04A1708F0F0E04A2FDF
443
+:101BA000421B21E0A41708F020E0F22BA52FA11B77
444
+:101BB00021E05A1708F020E05A2F5F1BF1E0A5172B
445
+:101BC00008F0F0E02F2BA62FA01BF1E06A1708F019
446
+:101BD000F0E06A2F621B21E0A61708F020E0F22B4C
447
+:101BE000272F2F19A1E0721708F0A0E0722F7F1B9A
448
+:101BF000F1E0271708F0F0E0AF2BF82FFE1921E0F5
449
+:101C00008F1708F020E08F2F8A1BA1E0F81708F04B
450
+:101C1000A0E02A2B9A19921789F4882379F4772364
451
+:101C200069F4662359F4552349F4442339F43630D2
452
+:101C300028F4353011F4ED3D08F4A8950E9489048C
453
+:101C4000882309F491CF0E949704EE81FF8180835D
454
+:101C500082E40E94ED0499818A81292F382FC901DD
455
+:101C6000805C9F4F9D838C83398728876BC00E943F
456
+:101C70008B08E22FEB19F1E02E1708F0F0E0232F8C
457
+:101C80002C19A1E0321708F0A0E0322F3F1BF32FF0
458
+:101C900031E02F1708F030E0A32B342F3D1921E05D
459
+:101CA000431708F020E0432F4A1BA1E0341708F047
460
+:101CB000A0E02A2BA52FA11B31E05A1708F030E035
461
+:101CC0005A2F521B21E0A51708F020E0322BB62F27
462
+:101CD000B01B21E06B1708F020E0AB2FA31B31E015
463
+:101CE000BA1708F030E0232B672F6F1931E0761711
464
+:101CF00008F030E0762F721B21E0671708F020E033
465
+:101D0000322B682F6E1921E0861708F020E0862F0D
466
+:101D1000831B31E0681708F030E0232B9A199217E3
467
+:101D200089F4882379F4772369F4AA2359F4552395
468
+:101D300049F4442339F4F63028F4F53011F4ED3D3C
469
+:101D400008F4A8950E948904882309F490CF0E9482
470
+:101D50009704E885F9858193F987E8872C813D818F
471
+:101D6000E217F30779F782E40E94ED0493012F5FF5
472
+:101D70003F4FC301B2012A873B870E94AC082A85E6
473
+:101D80003B853901862D8819821508F457CF820CBE
474
+:101D9000911C33943B81331608F4D9CEC2010E94C2
475
+:101DA0003B126CC00E948B08A22FAB19F1E02A17DE
476
+:101DB00008F0F0E0232F2C19E1E0321708F0E0E002
477
+:101DC000322F3F1BF32F31E02F1708F030E0E32BC9
478
+:101DD000342F3D1921E0431708F020E0432F4E1B1C
479
+:101DE000E42F41E03E1708F040E0242B452F411B33
480
+:101DF00031E0541708F030E0542F521B21E0451712
481
+:101E000008F020E0322B462F401B21E0641708F039
482
+:101E100020E0642F631B31E0461708F030E0232BED
483
+:101E2000472F4F1931E0741708F030E0742F721B00
484
+:101E300021E0471708F020E0322B482F4E1921E00F
485
+:101E4000841708F020E0842F831B31E0481708F046
486
+:101E500030E0232B9A19921789F4882379F4772399
487
+:101E600069F4662359F4552349F4EE2339F4F63026
488
+:101E700028F4F53011F4AD3D08F4A8950E948904CA
489
+:101E8000882309F48FCF0E9497046CC00E948B08AE
490
+:101E9000A22FAB19F1E02A1708F0F0E0232F2C193C
491
+:101EA000E1E0321708F0E0E0322F3F1BF32F31E082
492
+:101EB0002F1708F030E0E32B342F3D1921E04317B2
493
+:101EC00008F020E0432F4E1BE42F41E03E1708F0BE
494
+:101ED00040E0242B452F411B31E0541708F030E03F
495
+:101EE000542F521B21E0451708F020E0322B462FDB
496
+:101EF000401B21E0641708F020E0642F631B31E0F1
497
+:101F0000461708F030E0232B472F4F1931E07417A4
498
+:101F100008F030E0742F721B21E0471708F020E032
499
+:101F2000322B482F4E1921E0841708F020E0842F2F
500
+:101F3000831B31E0481708F030E0232B9A199217E1
501
+:101F400089F4882379F4772369F4662359F45523B7
502
+:101F500049F4EE2339F4F63028F4F53011F4AD3DB0
503
+:101F600008F4A8950E948904882309F48FCF0E9461
504
+:101F700097046CC00E948B08A22FAB19F1E02A17BE
505
+:101F800008F0F0E0232F2C19E1E0321708F0E0E030
506
+:101F9000322F3F1BF32F31E02F1708F030E0E32BF7
507
+:101FA000342F3D1921E0431708F020E0432F4E1B4A
508
+:101FB000E42F41E03E1708F040E0242B452F411B61
509
+:101FC00031E0541708F030E0542F521B21E0451740
510
+:101FD00008F020E0322B462F401B21E0641708F068
511
+:101FE00020E0642F631B31E0461708F030E0232B1C
512
+:101FF000472F4F1931E0741708F030E0742F721B2F
513
+:1020000021E0471708F020E0322B482F4E1921E03D
514
+:10201000841708F020E0842F831B31E0481708F074
515
+:1020200030E0232B9A19921789F4882379F47723C7
516
+:1020300069F4662359F4552349F4EE2339F4F63054
517
+:1020400028F4F53011F4AD3D08F4A8950E948904F8
518
+:10205000882309F48FCF0E9497046CC00E948B08DC
519
+:10206000A22FAB19F1E02A1708F0F0E0232F2C196A
520
+:10207000E1E0321708F0E0E0322F3F1BF32F31E0B0
521
+:102080002F1708F030E0E32B342F3D1921E04317E0
522
+:1020900008F020E0432F4E1BE42F41E03E1708F0EC
523
+:1020A00040E0242B452F411B31E0541708F030E06D
524
+:1020B000542F521B21E0451708F020E0322B462F09
525
+:1020C000401B21E0641708F020E0642F631B31E01F
526
+:1020D000461708F030E0232B472F4F1931E07417D3
527
+:1020E00008F030E0742F721B21E0471708F020E061
528
+:1020F000322B482F4E1921E0841708F020E0842F5E
529
+:10210000831B31E0481708F030E0232B9A1992170F
530
+:1021100089F4882379F4772369F4662359F45523E5
531
+:1021200049F4EE2339F4F63028F4F53011F4AD3DDE
532
+:1021300008F4A8950E948904882309F48FCF0E948F
533
+:10214000970482E40E94ED04C4010E94F80881E033
534
+:10215000809360002B960FB6F894DEBF0FBECDBF04
535
+:10216000CF91DF911F910F91FF90EF90DF90CF9073
536
+:10217000BF90AF909F908F907F906F905F904F90A7
537
+:102180003F902F9008956F927F928F929F92AF927F
538
+:10219000BF92CF92DF92EF92FF920F931F93CF9354
539
+:1021A000DF930E94DC086C016FEF70E00E948D11DC
540
+:1021B000009711F4862E02C0862E839482E40E943A
541
+:1021C000ED04882D0E94ED040E949704823409F0EA
542
+:1021D00058C000E010E041C08FEFC816D10409F0EC
543
+:1021E00010F49C2C02C099249A94892D0E94ED042D
544
+:1021F0000E949704823409F044C0780126C0C701C8
545
+:102200000E949C08EC01FC01E05CFF4F80810E9471
546
+:10221000ED040E949704823489F45E0180E4682E04
547
+:10222000F50181915F010E94ED046A94C9F70E9453
548
+:1022300097040894E11CF11C823421F0CE010E9425
549
+:102240003B121FC0CE010E943B128E2D87198915AB
550
+:10225000B0F2C918D10801501F4F702E802F819500
551
+:10226000881508F4B9CF82E40E94ED0482E40E944C
552
+:10227000ED0482E40E94ED0482E40E94ED040E94D9
553
+:102280009704DF91CF911F910F91FF90EF90DF9016
554
+:10229000CF90BF90AF909F908F907F906F90089558
555
+:1022A0001F93CF93DF930E94FF07EC01009731F457
556
+:1022B00085E10E9426090E942D051FC086E10E942B
557
+:1022C00026090E942D0510E3812F0E94ED048CE762
558
+:1022D00091E00E942D05899190E06AE272E04AE067
559
+:1022E00050E00E94DB128AE292E00E942D058AE013
560
+:1022F0000E94ED041F5F173339F7DF91CF911F91D3
561
+:102300000895991B79E004C0991F961708F0961B51
562
+:10231000881F7A95C9F780950895AA1BBB1B51E1C8
563
+:1023200007C0AA1FBB1FA617B70710F0A61BB70B45
564
+:10233000881F991F5A95A9F780959095BC01CD01EA
565
+:102340000895CF93DF938230910510F482E090E0FE
566
+:10235000E0916802F091690240E050E020E030E056
567
+:1023600026C06081718168177907E0F068177907E6
568
+:1023700081F4828193812115310531F0D9011396C1
569
+:102380009C938E9312972BC090936902809368025E
570
+:1023900026C04115510519F06417750718F4AB01F3
571
+:1023A000E901DF019F0172816381E72FF62F3097EA
572
+:1023B000C1F64115510501F1481B590B4430510537
573
+:1023C00080F412968D919C911397209719F09B831E
574
+:1023D0008A8304C09093690280936802FD0132965B
575
+:1023E00046C0FD01E40FF51F819391934250504088
576
+:1023F00011965C934E933BC0209166023091670228
577
+:102400002115310541F420918101309182013093F1
578
+:102410006702209366022091830130918401211587
579
+:10242000310541F42DB73EB740917F0150918001B5
580
+:10243000241B350BE0916602F0916702E217F30767
581
+:10244000A0F42E1B3F0B2817390778F0AC014E5F24
582
+:102450005F4F2417350748F04E0F5F1F50936702F8
583
+:10246000409366028193919302C0E0E0F0E0CF01D7
584
+:10247000DF91CF910895CF93DF93009709F491C036
585
+:10248000FC01329713821282609168027091690296
586
+:102490006115710581F420813181280F391F8091E8
587
+:1024A0006602909167028217930799F5F09367028D
588
+:1024B000E093660276C0DB0180E090E002C0CD01CF
589
+:1024C000D901AE17BF0748F412962D913C9113978E
590
+:1024D00021153105A1F7CD0121C0B383A283EF01FE
591
+:1024E000499159919E01240F351FA217B30779F422
592
+:1024F0002D913C911197240F351F2E5F3F4F318353
593
+:10250000208312962D913C91139733832283009759
594
+:1025100029F4F0936902E093680243C0DC0113964A
595
+:10252000FC93EE9312974D915D91A40FB51FEA179E
596
+:10253000FB0769F420813181240F351F2E5F3F4F47
597
+:10254000EC0139832883228133813B832A83E0E0B5
598
+:10255000F0E002C0FB01BC01DB0112968D919C9161
599
+:1025600013970097B9F79B012E5F3F4F8D919C9178
600
+:102570001197820F931F409166025091670248178E
601
+:10258000590779F4309729F4109269021092680281
602
+:1025900002C013821282225030403093670220938F
603
+:1025A0006602DF91CF910895FB01DC0105900D9249
604
+:1025B0000020E1F70895FB019F01E8944230C4F048
605
+:1025C0004532B4F44A3029F497FB1EF49095819576
606
+:1025D0009F4F642F77270E948D11805D8A330CF006
607
+:1025E000895D8193CB010097A1F716F45DE25193C9
608
+:1025F0001082C9010C94FC12DC01FC01672F71915F
609
+:102600007723E1F7329704C07C916D9370836291D8
610
+:0C261000AE17BF07C8F30895F894FFCF81
611
+:10261C0001FFFFFFFFFFFFFFFFFF818181818181B0
612
+:10262C00FFFF818181818181FFFF81818181818196
613
+:10263C00FFFF818181818181FFFF81818181818186
614
+:10264C00FFFF818181818181FFFFFFFFFFFFFFFF82
615
+:10265C00FFFF010101FF8080FFFF010101FF80806E
616
+:10266C00FFFF010101FF8080FFFF010101FF80805E
617
+:10267C00FFFF010101FF8080FFFF010101FF80804E
618
+:10268C00FFFF010101FF8080FFFF010101FF80803E
619
+:10269C00FF7E818181FF8181817E818181FF8181AA
620
+:1026AC00817E818181FF8181817E818181FF818118
621
+:1026BC00817E818181FF8181817E818181FF818108
622
+:1026CC00817E818181FF8181817E818181FF8181F8
623
+:1026DC00811E2222221E0202021E2222221E02021F
624
+:1026EC00021E2222221E0202021E2222221E02028E
625
+:1026FC00021E2222221E0202021E2222221E02027E
626
+:10270C00021E2222221E0202021E2222221E02026D
627
+:10271C0002A100E100210101440C0A0CD00B960B24
628
+:10272C005C0B220BF40A980A3C0AE0093A200020C0
629
+:06273C00006A020000002B
589 630
 :00000001FF

+ 4
- 0
CubeFirmware/visualizer.c View File

@@ -33,10 +33,14 @@ void simpleVisualization(uint8_t *data) {
33 33
 
34 34
 	buff = buffNew();
35 35
 
36
+	buffClearAllPixels(buff);
37
+
36 38
 	for(i = 0; i < 7; i++) {
37 39
 		max = data[i] / 31;
38 40
 		
41
+		// d = 7;
39 42
 		for (d = 0; d < 8; d++) {
43
+			// h = max;
40 44
 			for (h = 0; h < max; h++) {
41 45
 				buffSetPixel(buff, i, h, d);
42 46
 			}

+ 39
- 25
UploadTest/main.c View File

@@ -1,6 +1,7 @@
1 1
 #include <stdio.h>
2 2
 #include <stdlib.h>
3 3
 #include <strings.h>
4
+#include <time.h>
4 5
 
5 6
 #include "serial.h"
6 7
 
@@ -20,9 +21,13 @@ volatile int keepRunning = 1;
20 21
 int main(int argc, char *argv[]) {
21 22
 	char c;
22 23
 	int i, f;
23
-	
24
-	if (argc != 2) {
25
-		printf("Usage: %s /dev/port\n", argv[0]);
24
+	int animationCount = 1;
25
+	int frameCount = 2;
26
+	int duration = 3;
27
+	int data = -1;
28
+
29
+	if (argc < 2) {
30
+		printf("Usage:\n%s /dev/port [-d 0xff]\n", argv[0]);
26 31
 		return 0;
27 32
 	}
28 33
 
@@ -31,6 +36,11 @@ int main(int argc, char *argv[]) {
31 36
 		return 0;
32 37
 	}
33 38
 
39
+	if ((argc >= 4) && (strcmp(argv[2], "-d") == 0)) {
40
+		sscanf(argv[3], "%x", &data);
41
+		frameCount = 1;
42
+	}
43
+
34 44
 	signal(SIGINT, intHandler);
35 45
 	signal(SIGQUIT, intHandler);
36 46
 
@@ -47,7 +57,7 @@ int main(int argc, char *argv[]) {
47 57
 	readAck();
48 58
 
49 59
 	printf("\tSending anim count (1)...");
50
-	c = 1;
60
+	c = (char)animationCount;
51 61
 	if (serialWriteTry(&c, 1) != 0) {
52 62
 		printf(" Could not send it!\n");
53 63
 		suicide;
@@ -57,7 +67,7 @@ int main(int argc, char *argv[]) {
57 67
 	readAck();
58 68
 
59 69
 	printf("\tSending frame count (2)...");
60
-	c = 2;
70
+	c = (char)frameCount;
61 71
 	if (serialWriteTry(&c, 1) != 0) {
62 72
 		printf(" Could not send it!\n");
63 73
 		suicide;
@@ -66,9 +76,9 @@ int main(int argc, char *argv[]) {
66 76
 
67 77
 	readAck();
68 78
 
69
-	for (f = 0; f < 2; f++) {
79
+	for (f = 0; f < frameCount; f++) {
70 80
 		printf("\tSending duration (3)...");
71
-		c = 3;
81
+		c = (char)duration;
72 82
 		if (serialWriteTry(&c, 1) != 0) {
73 83
 			printf(" Could not send it!\n");
74 84
 			suicide;
@@ -79,29 +89,25 @@ int main(int argc, char *argv[]) {
79 89
 
80 90
 		printf("\tSending data");
81 91
 		
82
-		if (f == 0) {
83
-			for(i = 0; i < 64; i++) {
84
-				c = (char)i; // Some test data
85
-				if (serialWriteTry(&c, 1) != 0) {
86
-					printf(" Error while sending!\n");
87
-					suicide;
92
+		for(i = 0; i < 64; i++) {
93
+			if (data == -1) {
94
+				if (f == 0) {
95
+					c = (char)i; // Some test data
88 96
 				} else {
89
-					printf(".");
97
+					c = (char)(63 - i);
90 98
 				}
99
+			} else {
100
+				c = (char)data;
91 101
 			}
92
-			printf(" Success!\n");
93
-		} else {
94
-			for(i = 0; i < 64; i++) {
95
-				c = (char)63 - i; // Some test data
96
-				if (serialWriteTry(&c, 1) != 0) {
97
-					printf(" Error while sending!\n");
98
-					suicide;
99
-				} else {
100
-					printf(".");
101
-				}
102
+
103
+			if (serialWriteTry(&c, 1) != 0) {
104
+				printf(" Error while sending!\n");
105
+				suicide;
106
+			} else {
107
+				printf(".");
102 108
 			}
103
-			printf(" Success!\n");
104 109
 		}
110
+		printf(" Success!\n");
105 111
 
106 112
 		readAck();
107 113
 	}
@@ -150,6 +156,9 @@ int serialReadTry(char *data, size_t length) {
150 156
 	int i = 0;
151 157
 	int written = 0;
152 158
 	int ret;
159
+	time_t start, end;
160
+	start = time(NULL);
161
+
153 162
 	while (keepRunning) {
154 163
 		ret = serialRead((data + written), (length - written));
155 164
 		if (ret == -1) {
@@ -163,6 +172,11 @@ int serialReadTry(char *data, size_t length) {
163 172
 		if (written == length) {
164 173
 			break;
165 174
 		}
175
+		end = time(NULL);
176
+		if (difftime(start, end) > 2) {
177
+			printf("Timeout went by. Exit!");
178
+			suicide;
179
+		}
166 180
 	}
167 181
 	return 0;
168 182
 }

Loading…
Cancel
Save