Revision 1202
Station/server communication:
- Implemented backspace handling
- Implemented all test starting commands with parameter
Tests:
- Added functions for testing only one component of a kind
- Made function names consistent with server commands
test_bom.c | ||
---|---|---|
1 | 1 |
#include "test_bom.h" |
2 | 2 |
#include "global.h" |
3 | 3 |
|
4 |
void test_bom (bool test_emitters, bool test_detectors)
|
|
4 |
void test_bom_bitmask (uint16_t emitter_bitmask, uint16_t detector_bitmask)
|
|
5 | 5 |
{ |
6 | 6 |
usb_puts("# Testing BOM" NL); |
7 | 7 |
|
8 |
for (uint8_t n=0; n<15; ++n)
|
|
8 |
for (uint8_t n=0; n<16; ++n, emitter_bitmask>>=1, detector_bitmask>>=1)
|
|
9 | 9 |
{ |
10 |
if (test_emitters)
|
|
10 |
if (emitter_bitmask&1)
|
|
11 | 11 |
{ |
12 | 12 |
usb_puts("# Testing BOM emitter "); |
13 | 13 |
usb_puti(n); |
... | ... | |
20 | 20 |
// wait (done) |
21 | 21 |
} |
22 | 22 |
|
23 |
if (test_detectors)
|
|
23 |
if (detector_bitmask&1)
|
|
24 | 24 |
{ |
25 | 25 |
usb_puts("# Testing BOM detector "); |
26 | 26 |
usb_puti(n); |
... | ... | |
42 | 42 |
|
43 | 43 |
usb_puts("# Testing BOM finished" NL); |
44 | 44 |
} |
45 |
|
|
46 |
void test_bom (uint8_t num, bool test_emitter, bool test_detector) |
|
47 |
{ |
|
48 |
uint16_t emitter_bitmask=0, detector_bitmask=0; |
|
49 |
|
|
50 |
if (test_emitter && num<16) emitter_bitmask =1<<num; |
|
51 |
if (test_detector && num<16) detector_bitmask=1<<num; |
|
52 |
|
|
53 |
test_bom_bitmask (emitter_bitmask, detector_bitmask); |
|
54 |
} |
|
55 |
|
|
56 |
void test_bom_all (bool test_emitters, bool test_detectors) |
|
57 |
{ |
|
58 |
uint16_t emitter_bitmask=0, detector_bitmask=0; |
|
59 |
|
|
60 |
if (test_emitters ) emitter_bitmask =0xFFFF; |
|
61 |
if (test_detectors) detector_bitmask=0xFFFF; |
|
62 |
|
|
63 |
test_bom_bitmask (emitter_bitmask, detector_bitmask); |
|
64 |
} |
Also available in: Unified diff