User | Revision | Line number | New contents of line |
chris |
0:1e5295127662
|
1
|
#include "Objects.h"
|
chris |
0:1e5295127662
|
2
|
#include "Helper.h"
|
chris |
0:1e5295127662
|
3
|
#include "Tests.h"
|
chris |
0:1e5295127662
|
4
|
|
chris |
0:1e5295127662
|
5
|
|
chris |
0:1e5295127662
|
6
|
//#define AUDIO // it beeps at the end
|
chris |
0:1e5295127662
|
7
|
|
chris |
0:1e5295127662
|
8
|
#define TEST_DELAY 0.001
|
chris |
0:1e5295127662
|
9
|
|
chris |
0:1e5295127662
|
10
|
|
chris |
0:1e5295127662
|
11
|
// ============================
|
chris |
0:1e5295127662
|
12
|
// Tests
|
chris |
0:1e5295127662
|
13
|
// The numbers are used to trigger
|
chris |
0:1e5295127662
|
14
|
// The test on the DUT
|
chris |
0:1e5295127662
|
15
|
// ============================
|
chris |
0:1e5295127662
|
16
|
// 1. VoltageCurrent
|
chris |
0:1e5295127662
|
17
|
// 2. DUTSetupTest
|
chris |
0:1e5295127662
|
18
|
// 3. IOTest
|
chris |
0:1e5295127662
|
19
|
// 4. Resettest
|
chris |
0:1e5295127662
|
20
|
// 5. BatteryTest
|
chris |
0:1e5295127662
|
21
|
// 6. EthernetTest
|
chris |
0:1e5295127662
|
22
|
// ============================
|
chris |
0:1e5295127662
|
23
|
// Assumptions
|
chris |
0:1e5295127662
|
24
|
// ============================
|
chris |
0:1e5295127662
|
25
|
// All tests run off the initial VUSB power up
|
chris |
0:1e5295127662
|
26
|
// Vin test explicity fiddles the power
|
chris |
0:1e5295127662
|
27
|
// ============================
|
chris |
0:1e5295127662
|
28
|
|
chris |
0:1e5295127662
|
29
|
int wibble=1;
|
chris |
0:1e5295127662
|
30
|
|
chris |
0:1e5295127662
|
31
|
int main() {
|
chris |
0:1e5295127662
|
32
|
|
chris |
0:1e5295127662
|
33
|
DutReset(1);
|
chris |
0:1e5295127662
|
34
|
|
chris |
0:1e5295127662
|
35
|
|
chris |
0:1e5295127662
|
36
|
char result=0;
|
chris |
0:1e5295127662
|
37
|
|
chris |
0:1e5295127662
|
38
|
pc.printf("mbed-005.1 Production test jig\n");
|
chris |
0:1e5295127662
|
39
|
|
chris |
0:1e5295127662
|
40
|
lcd.cls();
|
chris |
0:1e5295127662
|
41
|
lcd.locate(0,0);
|
chris |
0:1e5295127662
|
42
|
lcd.printf("Reflash jig");
|
chris |
0:1e5295127662
|
43
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
44
|
lcd.printf("Press GREEN");
|
chris |
0:1e5295127662
|
45
|
|
chris |
0:1e5295127662
|
46
|
|
chris |
0:1e5295127662
|
47
|
DutISPConnect();
|
chris |
0:1e5295127662
|
48
|
|
chris |
0:1e5295127662
|
49
|
wait(0.5);
|
chris |
0:1e5295127662
|
50
|
|
chris |
0:1e5295127662
|
51
|
while (wibble) {
|
chris |
0:1e5295127662
|
52
|
|
chris |
0:1e5295127662
|
53
|
// wait for the button to be pressed
|
chris |
0:1e5295127662
|
54
|
while (!gbtn) {}
|
chris |
0:1e5295127662
|
55
|
// Power up
|
chris |
0:1e5295127662
|
56
|
DutUsbPowerUp();
|
chris |
0:1e5295127662
|
57
|
wait (1.0);
|
chris |
0:1e5295127662
|
58
|
|
chris |
0:1e5295127662
|
59
|
|
chris |
0:1e5295127662
|
60
|
// wait for the button to be pressed
|
chris |
0:1e5295127662
|
61
|
while (!gbtn) {}
|
chris |
0:1e5295127662
|
62
|
// Power down
|
chris |
0:1e5295127662
|
63
|
DutUsbPowerDown();
|
chris |
0:1e5295127662
|
64
|
wait (1.0);
|
chris |
0:1e5295127662
|
65
|
|
chris |
0:1e5295127662
|
66
|
|
chris |
0:1e5295127662
|
67
|
|
chris |
0:1e5295127662
|
68
|
}
|
chris |
0:1e5295127662
|
69
|
|
chris |
0:1e5295127662
|
70
|
|
chris |
0:1e5295127662
|
71
|
while (1) {
|
chris |
0:1e5295127662
|
72
|
|
chris |
0:1e5295127662
|
73
|
|
chris |
0:1e5295127662
|
74
|
|
chris |
0:1e5295127662
|
75
|
|
chris |
0:1e5295127662
|
76
|
|
chris |
0:1e5295127662
|
77
|
lcd.cls();
|
chris |
0:1e5295127662
|
78
|
lcd.locate(0,0);
|
chris |
0:1e5295127662
|
79
|
lcd.printf("mbed-005.1 Test");
|
chris |
0:1e5295127662
|
80
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
81
|
lcd.printf("Press GREEN");
|
chris |
0:1e5295127662
|
82
|
|
chris |
0:1e5295127662
|
83
|
// wait for the button to be pressed
|
chris |
0:1e5295127662
|
84
|
while (!gbtn) {}
|
chris |
0:1e5295127662
|
85
|
|
chris |
0:1e5295127662
|
86
|
// Power up USB and connect
|
chris |
0:1e5295127662
|
87
|
DutUsbPowerUp();
|
chris |
0:1e5295127662
|
88
|
wait (0.1);
|
chris |
0:1e5295127662
|
89
|
|
chris |
0:1e5295127662
|
90
|
|
chris |
0:1e5295127662
|
91
|
|
chris |
0:1e5295127662
|
92
|
// Connect the USB after the current test
|
chris |
0:1e5295127662
|
93
|
// this stops the spiking currents during enumeration from
|
chris |
0:1e5295127662
|
94
|
// giving false readings
|
chris |
0:1e5295127662
|
95
|
// DutUsbConnect();
|
chris |
0:1e5295127662
|
96
|
// wait (0.5);
|
chris |
0:1e5295127662
|
97
|
|
chris |
0:1e5295127662
|
98
|
|
chris |
0:1e5295127662
|
99
|
// ========================
|
chris |
0:1e5295127662
|
100
|
// Voltage and current test
|
chris |
0:1e5295127662
|
101
|
// ========================
|
chris |
0:1e5295127662
|
102
|
|
chris |
0:1e5295127662
|
103
|
|
chris |
0:1e5295127662
|
104
|
|
chris |
0:1e5295127662
|
105
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
106
|
lcd.printf("VCTest ");
|
chris |
0:1e5295127662
|
107
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
108
|
|
chris |
0:1e5295127662
|
109
|
result |= VCTest ();
|
chris |
0:1e5295127662
|
110
|
pc.printf("VCTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
111
|
|
chris |
0:1e5295127662
|
112
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
113
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
114
|
|
chris |
0:1e5295127662
|
115
|
|
chris |
0:1e5295127662
|
116
|
// ========================
|
chris |
0:1e5295127662
|
117
|
// Connect USB
|
chris |
0:1e5295127662
|
118
|
// ========================
|
chris |
0:1e5295127662
|
119
|
|
chris |
0:1e5295127662
|
120
|
DutUsbConnect();
|
chris |
0:1e5295127662
|
121
|
wait (0.5);
|
chris |
0:1e5295127662
|
122
|
|
chris |
0:1e5295127662
|
123
|
lcd.cls();
|
chris |
0:1e5295127662
|
124
|
lcd.locate(0,0);
|
chris |
0:1e5295127662
|
125
|
lcd.printf("Copy TestDUT.bin");
|
chris |
0:1e5295127662
|
126
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
127
|
lcd.printf("Press GREEN");
|
chris |
0:1e5295127662
|
128
|
wait(0.5);
|
chris |
0:1e5295127662
|
129
|
|
chris |
0:1e5295127662
|
130
|
// wait for the button to be pressed
|
chris |
0:1e5295127662
|
131
|
while (!gbtn) {}
|
chris |
0:1e5295127662
|
132
|
|
chris |
0:1e5295127662
|
133
|
// turn off the board and USB, and power it up using VIN
|
chris |
0:1e5295127662
|
134
|
DutUsbPowerDown();
|
chris |
0:1e5295127662
|
135
|
DutUsbDisconnect();
|
chris |
0:1e5295127662
|
136
|
|
chris |
0:1e5295127662
|
137
|
wait (0.2);
|
chris |
0:1e5295127662
|
138
|
DutVinPowerUp();
|
chris |
0:1e5295127662
|
139
|
|
chris |
0:1e5295127662
|
140
|
// Turn on the VB power, this is so it can stablise
|
chris |
0:1e5295127662
|
141
|
DutVB(1);
|
chris |
0:1e5295127662
|
142
|
VBatGnd=1;
|
chris |
0:1e5295127662
|
143
|
|
chris |
0:1e5295127662
|
144
|
// this covers the debug case when the board
|
chris |
0:1e5295127662
|
145
|
// remains powered by USB
|
chris |
0:1e5295127662
|
146
|
DUT_NR = 0;
|
chris |
0:1e5295127662
|
147
|
wait (0.1);
|
chris |
0:1e5295127662
|
148
|
DUT_NR = 1;
|
chris |
0:1e5295127662
|
149
|
|
chris |
0:1e5295127662
|
150
|
|
chris |
0:1e5295127662
|
151
|
lcd.cls();
|
chris |
0:1e5295127662
|
152
|
lcd.locate(0,0);
|
chris |
0:1e5295127662
|
153
|
lcd.printf("Waiting for DUT");
|
chris |
0:1e5295127662
|
154
|
|
chris |
0:1e5295127662
|
155
|
|
chris |
0:1e5295127662
|
156
|
// this is where the DUT power up... it will take a bunch of time
|
chris |
0:1e5295127662
|
157
|
// for the binary to be programmed
|
chris |
0:1e5295127662
|
158
|
// We should wait for a "R" to be sent by the DUT
|
chris |
0:1e5295127662
|
159
|
|
chris |
0:1e5295127662
|
160
|
DutBufferFlush();
|
chris |
0:1e5295127662
|
161
|
// wait here until
|
chris |
0:1e5295127662
|
162
|
while (!Dut.readable()) {
|
chris |
0:1e5295127662
|
163
|
led4 = !led4;
|
chris |
0:1e5295127662
|
164
|
wait (0.05);
|
chris |
0:1e5295127662
|
165
|
}
|
chris |
0:1e5295127662
|
166
|
|
chris |
0:1e5295127662
|
167
|
char tmp = Dut.getc();
|
chris |
0:1e5295127662
|
168
|
|
chris |
0:1e5295127662
|
169
|
if ( tmp != 'R' ) {
|
chris |
0:1e5295127662
|
170
|
}
|
chris |
0:1e5295127662
|
171
|
|
chris |
0:1e5295127662
|
172
|
|
chris |
0:1e5295127662
|
173
|
// Start the test
|
chris |
0:1e5295127662
|
174
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
175
|
lcd.printf("Testing...");
|
chris |
0:1e5295127662
|
176
|
|
chris |
0:1e5295127662
|
177
|
|
chris |
0:1e5295127662
|
178
|
|
chris |
0:1e5295127662
|
179
|
|
chris |
0:1e5295127662
|
180
|
//// ///////////////////////////////////////////////////////
|
chris |
0:1e5295127662
|
181
|
//// This is where we do the grunt work of running the tests
|
chris |
0:1e5295127662
|
182
|
//// ///////////////////////////////////////////////////////
|
chris |
0:1e5295127662
|
183
|
|
chris |
0:1e5295127662
|
184
|
|
chris |
0:1e5295127662
|
185
|
|
chris |
0:1e5295127662
|
186
|
|
chris |
0:1e5295127662
|
187
|
|
chris |
0:1e5295127662
|
188
|
|
chris |
0:1e5295127662
|
189
|
|
chris |
0:1e5295127662
|
190
|
|
chris |
0:1e5295127662
|
191
|
// ========================
|
chris |
0:1e5295127662
|
192
|
// Dut setup
|
chris |
0:1e5295127662
|
193
|
// ========================
|
chris |
0:1e5295127662
|
194
|
|
chris |
0:1e5295127662
|
195
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
196
|
lcd.printf("DutSetupTest");
|
chris |
0:1e5295127662
|
197
|
result |= DutSetupTest ();
|
chris |
0:1e5295127662
|
198
|
pc.printf("DutSetup 0x%x\n",result);
|
chris |
0:1e5295127662
|
199
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
200
|
|
chris |
0:1e5295127662
|
201
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
202
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
203
|
|
chris |
0:1e5295127662
|
204
|
|
chris |
0:1e5295127662
|
205
|
// ========================
|
chris |
0:1e5295127662
|
206
|
// IO Test
|
chris |
0:1e5295127662
|
207
|
// ========================
|
chris |
0:1e5295127662
|
208
|
|
chris |
0:1e5295127662
|
209
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
210
|
lcd.printf("IOTest ");
|
chris |
0:1e5295127662
|
211
|
result |= IOTest ();
|
chris |
0:1e5295127662
|
212
|
pc.printf("IOTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
213
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
214
|
|
chris |
0:1e5295127662
|
215
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
216
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
217
|
|
chris |
0:1e5295127662
|
218
|
|
chris |
0:1e5295127662
|
219
|
// ========================
|
chris |
0:1e5295127662
|
220
|
// Reset Test
|
chris |
0:1e5295127662
|
221
|
// ========================
|
chris |
0:1e5295127662
|
222
|
|
chris |
0:1e5295127662
|
223
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
224
|
lcd.printf("ResetTest");
|
chris |
0:1e5295127662
|
225
|
result |= ResetTest ();
|
chris |
0:1e5295127662
|
226
|
pc.printf("ResetTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
227
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
228
|
|
chris |
0:1e5295127662
|
229
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
230
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
231
|
|
chris |
0:1e5295127662
|
232
|
|
chris |
0:1e5295127662
|
233
|
// ========================
|
chris |
0:1e5295127662
|
234
|
// Ethernet test
|
chris |
0:1e5295127662
|
235
|
// ========================
|
chris |
0:1e5295127662
|
236
|
|
chris |
0:1e5295127662
|
237
|
|
chris |
0:1e5295127662
|
238
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
239
|
lcd.printf("EthernetTest");
|
chris |
0:1e5295127662
|
240
|
result |= EthernetTest ();
|
chris |
0:1e5295127662
|
241
|
pc.printf("EthernetTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
242
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
243
|
|
chris |
0:1e5295127662
|
244
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
245
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
246
|
|
chris |
0:1e5295127662
|
247
|
|
chris |
0:1e5295127662
|
248
|
|
chris |
0:1e5295127662
|
249
|
// ========================
|
chris |
0:1e5295127662
|
250
|
// RTC Test
|
chris |
0:1e5295127662
|
251
|
// ========================
|
chris |
0:1e5295127662
|
252
|
|
chris |
0:1e5295127662
|
253
|
|
chris |
0:1e5295127662
|
254
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
255
|
lcd.printf("RTC test");
|
chris |
0:1e5295127662
|
256
|
|
chris |
0:1e5295127662
|
257
|
result |= RTCTest ();
|
chris |
0:1e5295127662
|
258
|
pc.printf("RTCtTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
259
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
260
|
|
chris |
0:1e5295127662
|
261
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
262
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
263
|
|
chris |
0:1e5295127662
|
264
|
|
chris |
0:1e5295127662
|
265
|
|
chris |
0:1e5295127662
|
266
|
|
chris |
0:1e5295127662
|
267
|
// ========================
|
chris |
0:1e5295127662
|
268
|
// VBat Test
|
chris |
0:1e5295127662
|
269
|
// ========================
|
chris |
0:1e5295127662
|
270
|
|
chris |
0:1e5295127662
|
271
|
|
chris |
0:1e5295127662
|
272
|
// make sure the clock still has a sensible value
|
chris |
0:1e5295127662
|
273
|
|
chris |
0:1e5295127662
|
274
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
275
|
lcd.printf("VBat test");
|
chris |
0:1e5295127662
|
276
|
|
chris |
0:1e5295127662
|
277
|
// Turn off all other power
|
chris |
0:1e5295127662
|
278
|
DutVinPowerDown();
|
chris |
0:1e5295127662
|
279
|
|
chris |
0:1e5295127662
|
280
|
// wait for 1 second
|
chris |
0:1e5295127662
|
281
|
wait(0.1);
|
chris |
0:1e5295127662
|
282
|
|
chris |
0:1e5295127662
|
283
|
// power back on
|
chris |
0:1e5295127662
|
284
|
DutVinPowerUp();
|
chris |
0:1e5295127662
|
285
|
wait (0.1);
|
chris |
0:1e5295127662
|
286
|
|
chris |
0:1e5295127662
|
287
|
// flush the buffer (there will be an "R")
|
chris |
0:1e5295127662
|
288
|
DutBufferFlush();
|
chris |
0:1e5295127662
|
289
|
|
chris |
0:1e5295127662
|
290
|
result |= BatteryTest ();
|
chris |
0:1e5295127662
|
291
|
pc.printf("VBatTest 0x%x\n",result);
|
chris |
0:1e5295127662
|
292
|
wait (TEST_DELAY);
|
chris |
0:1e5295127662
|
293
|
|
chris |
0:1e5295127662
|
294
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
295
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
296
|
|
chris |
0:1e5295127662
|
297
|
|
chris |
0:1e5295127662
|
298
|
|
chris |
0:1e5295127662
|
299
|
|
chris |
0:1e5295127662
|
300
|
|
chris |
0:1e5295127662
|
301
|
|
chris |
0:1e5295127662
|
302
|
|
chris |
0:1e5295127662
|
303
|
|
chris |
0:1e5295127662
|
304
|
// ========================
|
chris |
0:1e5295127662
|
305
|
// Clean up
|
chris |
0:1e5295127662
|
306
|
// ========================
|
chris |
0:1e5295127662
|
307
|
|
chris |
0:1e5295127662
|
308
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
309
|
if (result==0) {
|
chris |
0:1e5295127662
|
310
|
result |= CleanUp ();
|
chris |
0:1e5295127662
|
311
|
}
|
chris |
0:1e5295127662
|
312
|
|
chris |
0:1e5295127662
|
313
|
|
chris |
0:1e5295127662
|
314
|
|
chris |
0:1e5295127662
|
315
|
gled=0; rled=0; wait (0.05);
|
chris |
0:1e5295127662
|
316
|
if (result == 0 ) {gled = 1; rled=0;} else {gled = 0; rled=1;}
|
chris |
0:1e5295127662
|
317
|
|
chris |
0:1e5295127662
|
318
|
|
chris |
0:1e5295127662
|
319
|
// non-zero, Dut failed
|
chris |
0:1e5295127662
|
320
|
if (result) {
|
chris |
0:1e5295127662
|
321
|
lcd.cls(); lcd.locate(0,0);
|
chris |
0:1e5295127662
|
322
|
lcd.printf("Failed : 0x%x",result);
|
chris |
0:1e5295127662
|
323
|
gled = 0; rled=1;
|
chris |
0:1e5295127662
|
324
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
325
|
lcd.printf("Info in Test.log",result);
|
chris |
0:1e5295127662
|
326
|
|
chris |
0:1e5295127662
|
327
|
|
chris |
0:1e5295127662
|
328
|
|
chris |
0:1e5295127662
|
329
|
// Power up USB and connect
|
chris |
0:1e5295127662
|
330
|
DutUsbPowerUp();
|
chris |
0:1e5295127662
|
331
|
wait (0.1);
|
chris |
0:1e5295127662
|
332
|
DutUsbConnect();
|
chris |
0:1e5295127662
|
333
|
wait (0.5);
|
chris |
0:1e5295127662
|
334
|
|
chris |
0:1e5295127662
|
335
|
|
chris |
0:1e5295127662
|
336
|
#ifdef AUDIO
|
chris |
0:1e5295127662
|
337
|
Beep(500,0.5);
|
chris |
0:1e5295127662
|
338
|
#endif
|
chris |
0:1e5295127662
|
339
|
|
chris |
0:1e5295127662
|
340
|
|
chris |
0:1e5295127662
|
341
|
|
chris |
0:1e5295127662
|
342
|
|
chris |
0:1e5295127662
|
343
|
} else {
|
chris |
0:1e5295127662
|
344
|
lcd.cls();
|
chris |
0:1e5295127662
|
345
|
lcd.locate(0,0);
|
chris |
0:1e5295127662
|
346
|
lcd.printf("Passed! :-)");
|
chris |
0:1e5295127662
|
347
|
|
chris |
0:1e5295127662
|
348
|
lcd.locate(0,1);
|
chris |
0:1e5295127662
|
349
|
lcd.printf("Press GREEN");
|
chris |
0:1e5295127662
|
350
|
gled = 1; rled=0;
|
chris |
0:1e5295127662
|
351
|
|
chris |
0:1e5295127662
|
352
|
#ifdef AUDIO
|
chris |
0:1e5295127662
|
353
|
Beep(4000,0.5);
|
chris |
0:1e5295127662
|
354
|
#endif
|
chris |
0:1e5295127662
|
355
|
}
|
chris |
0:1e5295127662
|
356
|
|
chris |
0:1e5295127662
|
357
|
//// ///////////////////////////////////////////////////////
|
chris |
0:1e5295127662
|
358
|
////
|
chris |
0:1e5295127662
|
359
|
//// ///////////////////////////////////////////////////////
|
chris |
0:1e5295127662
|
360
|
|
chris |
0:1e5295127662
|
361
|
|
chris |
0:1e5295127662
|
362
|
// wait for the button to be pressed
|
chris |
0:1e5295127662
|
363
|
while (!gbtn) {}
|
chris |
0:1e5295127662
|
364
|
wait(0.1);
|
chris |
0:1e5295127662
|
365
|
|
chris |
0:1e5295127662
|
366
|
// Clean up for the next pass
|
chris |
0:1e5295127662
|
367
|
result = 0;
|
chris |
0:1e5295127662
|
368
|
rled=0;
|
chris |
0:1e5295127662
|
369
|
gled=0;
|
chris |
0:1e5295127662
|
370
|
DutUsbPowerDown ();
|
chris |
0:1e5295127662
|
371
|
DutUsbDisconnect ();
|
chris |
0:1e5295127662
|
372
|
DutVinPowerDown ();
|
chris |
0:1e5295127662
|
373
|
DutReset (1);
|
chris |
0:1e5295127662
|
374
|
DutVB (0);
|
chris |
0:1e5295127662
|
375
|
|
chris |
0:1e5295127662
|
376
|
|
chris |
0:1e5295127662
|
377
|
|
chris |
0:1e5295127662
|
378
|
} // end of while
|
chris |
0:1e5295127662
|
379
|
|
chris |
0:1e5295127662
|
380
|
} // end of main
|
chris |
0:1e5295127662
|
381
|
|
chris |
0:1e5295127662
|
382
|
|
chris |
0:1e5295127662
|
383
|
|
chris |
0:1e5295127662
|
384
|
|
chris |
0:1e5295127662
|
385
|
|
chris |
0:1e5295127662
|
386
|
|
chris |
0:1e5295127662
|
387
|
|
chris |
0:1e5295127662
|
388
|
|
chris |
0:1e5295127662
|
389
|
|
chris |
0:1e5295127662
|
390
|
|
chris |
0:1e5295127662
|
391
|
|
chris |
0:1e5295127662
|
392
|
|
chris |
0:1e5295127662
|
393
|
|
chris |
0:1e5295127662
|
394
|
|
chris |
0:1e5295127662
|
395
|
|
chris |
0:1e5295127662
|
396
|
|
chris |
0:1e5295127662
|
397
|
|
chris |
0:1e5295127662
|
398
|
|
chris |
0:1e5295127662
|
399
|
|
chris |
0:1e5295127662
|
400
|
|