Date:2011-04-13 17:17:02 (8 years 11 months ago)
Author:Werner Almesberger
Commit:16a48d6931a9b3d8c652ab92ee94f6b43d7dd88c
Message:libatrf: cw test mode can now be resumed, with lower overhead (231 only)

- lib/cwtest.c (enter_test_mode_231, prepare_test_mode_231,
start_test_mode_231, cw_test_begin): broke enter_test_mode_231 into
a slow setup component and a fast start/resume component
- include/cwtest.h (cw_test_resume), lib/cwtest.c (cw_test_resume):
resume transmission in a previously set up test mode
Files: tools/include/cwtest.h (1 diff)
tools/lib/cwtest.c (4 diffs)

Change Details

tools/include/cwtest.h
2020
2121
2222void cw_test_begin(struct atrf_dsc *dsc, uint8_t cont_tx);
23void cw_test_resume(struct atrf_dsc *dsc);
2324void cw_test_end(struct atrf_dsc *dsc);
2425
2526#endif /* !CW_TEST_H */
tools/lib/cwtest.c
2323#include "cwtest.h"
2424
2525
26static int last_cont_tx; /* @@@ hack for resuming on the 230 */
27
28
2629static void enter_test_mode_230(struct atrf_dsc *dsc, uint8_t cont_tx)
2730{
2831    atrf_buf_write(dsc, "", 1);
...... 
4245}
4346
4447
45static void enter_test_mode_231(struct atrf_dsc *dsc, uint8_t cont_tx)
48static void prepare_test_mode_231(struct atrf_dsc *dsc, uint8_t cont_tx)
4649{
4750    uint8_t buf[127];
4851    uint8_t status;
...... 
8083    atrf_reg_write(dsc, REG_RX_CTRL, 0xa7); /*11 */
8184
8285    atrf_buf_write(dsc, buf, sizeof(buf)); /*12 */
86}
8387
88
89static void start_test_mode_231(struct atrf_dsc *dsc)
90{
8491    atrf_reg_write(dsc, REG_PART_NUM, 0x54); /*13 */
8592    atrf_reg_write(dsc, REG_PART_NUM, 0x46); /*14 */
8693
...... 
96103    switch (atrf_identify(dsc)) {
97104    case artf_at86rf230:
98105        enter_test_mode_230(dsc, cont_tx);
106        last_cont_tx = cont_tx;
107        break;
108    case artf_at86rf231:
109        prepare_test_mode_231(dsc, cont_tx);
110        start_test_mode_231(dsc);
111        break;
112    default:
113        abort();
114    }
115}
116
117
118void cw_test_resume(struct atrf_dsc *dsc)
119{
120    switch (atrf_identify(dsc)) {
121    case artf_at86rf230:
122        enter_test_mode_230(dsc, last_cont_tx);
99123        break;
100124    case artf_at86rf231:
101        enter_test_mode_231(dsc, cont_tx);
125        start_test_mode_231(dsc);
102126        break;
103127    default:
104128        abort();

Archive Download the corresponding diff file



interactive