FreeCalypso > hg > freecalypso-tools
comparison rvinterf/etmsync/l1tmops.c @ 271:dc9dbb2f74e7
etmsync l1tmops module: rfpr implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 16 Nov 2017 19:14:52 +0000 |
parents | 095ffce023d4 |
children | 3e272b956ef4 |
comparison
equal
deleted
inserted
replaced
270:095ffce023d4 | 271:dc9dbb2f74e7 |
---|---|
31 } | 31 } |
32 if (rvi_msg_len != 5) { | 32 if (rvi_msg_len != 5) { |
33 fprintf(stderr, "target error: tms response wrong length\n"); | 33 fprintf(stderr, "target error: tms response wrong length\n"); |
34 exit(ERROR_TARGET); | 34 exit(ERROR_TARGET); |
35 } | 35 } |
36 return(0); | |
37 } | |
38 | |
39 do_rfpr(index, retp) | |
40 u_short *retp; | |
41 { | |
42 u_char cmdpkt[5]; | |
43 | |
44 cmdpkt[1] = RF_PARAM_READ; | |
45 cmdpkt[2] = index; | |
46 cmdpkt[3] = index >> 8; | |
47 etm_pkt_exch(cmdpkt, 3); | |
48 if (rvi_msg[3]) { | |
49 fprintf(stderr, "target error %u in response to rfpr\n", | |
50 rvi_msg[3]); | |
51 exit(ERROR_TARGET); | |
52 } | |
53 if (rvi_msg_len != 8) { | |
54 fprintf(stderr, "target error: rfpr response wrong length\n"); | |
55 exit(ERROR_TARGET); | |
56 } | |
57 if (rvi_msg[4] != index) { | |
58 fprintf(stderr, "target error: rfpr response wrong index\n"); | |
59 exit(ERROR_TARGET); | |
60 } | |
61 *retp = rvi_msg[5] | (rvi_msg[6] << 8); | |
36 return(0); | 62 return(0); |
37 } | 63 } |
38 | 64 |
39 do_rfpw(index, value) | 65 do_rfpw(index, value) |
40 { | 66 { |