diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-06-15 17:47:41 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-06-15 17:47:41 -0600 |
| commit | c5cfc0d6e507d093987741b6ffaf69ebb24caa4b (patch) | |
| tree | a75b83343939e96592ac07178f2011d82ea6ded8 /src/telelco-v0.2/ao_lco.c | |
| parent | 1b3d07ede530fa40cb7257fb1725c969ba60e0f0 (diff) | |
| parent | 9ab3a1de95b705783c31a7e16447f52c10b6b480 (diff) | |
Merge branch 'branch-1.4' into debian
Diffstat (limited to 'src/telelco-v0.2/ao_lco.c')
| -rw-r--r-- | src/telelco-v0.2/ao_lco.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/telelco-v0.2/ao_lco.c b/src/telelco-v0.2/ao_lco.c index 0bbb76f1..b3f5bb16 100644 --- a/src/telelco-v0.2/ao_lco.c +++ b/src/telelco-v0.2/ao_lco.c @@ -251,18 +251,22 @@ ao_lco_search(void) { uint16_t tick_offset; int8_t r; + int8_t try; uint8_t box; ao_lco_box_reset_present(); for (box = 0; box < AO_PAD_MAX_BOXES; box++) { if ((box % 10) == 0) ao_lco_set_box(box); - tick_offset = 0; - r = ao_lco_query(box, &ao_pad_query, &tick_offset); - PRINTD("box %d result %d\n", box, r); - if (r == AO_RADIO_CMAC_OK) { - ao_lco_box_set_present(box); - ao_delay(AO_MS_TO_TICKS(30)); + for (try = 0; try < 5; try++) { + tick_offset = 0; + r = ao_lco_query(box, &ao_pad_query, &tick_offset); + PRINTD("box %d result %d\n", box, r); + if (r == AO_RADIO_CMAC_OK) { + ao_lco_box_set_present(box); + ao_delay(AO_MS_TO_TICKS(30)); + break; + } } } if (ao_lco_min_box <= ao_lco_max_box) |
