From 8710be5665ec17da807a848e3286d3940c76dc1d Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 12 Feb 2013 16:42:20 -0300 Subject: [PATCH] tools/atrf-txrx/atrf-txrx.c: add section headers and update clkm comment --- tools/atrf-txrx/atrf-txrx.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/atrf-txrx/atrf-txrx.c b/tools/atrf-txrx/atrf-txrx.c index 3ec39be..23fc211 100644 --- a/tools/atrf-txrx/atrf-txrx.c +++ b/tools/atrf-txrx/atrf-txrx.c @@ -74,9 +74,12 @@ enum mode { static volatile int run = 1; +/* ----- Helper functions -------------------------------------------------- */ + + /* - * clkm: 0 disable CLKM - * >0 output 2^(clkm-1) MHz signal + * mhz: 0 disable CLKM + * >0 output specified clock */ static struct atrf_dsc *init_txrx(const char *driver, int trim, unsigned mhz) @@ -138,6 +141,9 @@ static void set_rate(struct atrf_dsc *dsc, uint8_t rate) } +/* ----- Message transmit/receive ------------------------------------------ */ + + static void receive_message(struct atrf_dsc *dsc) { uint8_t buf[MAX_PSDU+1]; /* PSDU+LQI */ @@ -320,6 +326,9 @@ static void transmit_hmac(struct atrf_dsc *dsc, const char *msg) } +/* ----- PER test ---------------------------------------------------------- */ + + static void transmit_pattern(struct atrf_dsc *dsc, double pause_s, int times) { uint8_t buf[MAX_PSDU]; @@ -355,6 +364,9 @@ static void transmit_pattern(struct atrf_dsc *dsc, double pause_s, int times) } +/* ----- Ping -------------------------------------------------------------- */ + + static void ping_tx(struct atrf_dsc *dsc, const struct ping *pck) { atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_PLL_ON); @@ -440,6 +452,9 @@ static void ping(struct atrf_dsc *dsc, double max_wait_s, int master) } +/* ----- Continuous wave test ---------------------------------------------- */ + + static int test_mode(struct atrf_dsc *dsc, uint8_t cont_tx, const char *cmd) { int status = 0; @@ -459,6 +474,9 @@ static int test_mode(struct atrf_dsc *dsc, uint8_t cont_tx, const char *cmd) } +/* ----- Command-line processing ------------------------------------------- */ + + static void die(int sig) { run = 0;