FreeCalypso > hg > ice1-trau-tester
comparison ater/activate.c @ 44:16715bd149e0
ater: add support for data mode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 12 Sep 2024 09:01:50 +0000 |
parents | 237687e2be6c |
children | 13fffc41f989 |
comparison
equal
deleted
inserted
replaced
43:55f02d4aee79 | 44:16715bd149e0 |
---|---|
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 /* good to proceed now */ | 66 /* good to proceed now */ |
67 at->is_active = true; | 67 at->is_active = true; |
68 at->is_data = false; | |
68 at->is_efr = is_efr; | 69 at->is_efr = is_efr; |
69 init_trau_ul_frame(nr); | 70 init_trau_ul_frame(nr); |
70 at->ul_frame.c_bits[16] = dtxd; | 71 at->ul_frame.c_bits[16] = dtxd; |
71 trau_frame_from_record(init_frame, is_efr, &at->ul_frame); | 72 trau_frame_from_record(init_frame, is_efr, &at->ul_frame); |
72 free(init_frame); | 73 free(init_frame); |
74 } | |
75 | |
76 void cmd_activate_csd(int argc, char **argv) | |
77 { | |
78 int nr; | |
79 bool ir_16k; | |
80 struct ater_subslot *at; | |
81 | |
82 if (argc != 3) { | |
83 usage: fprintf(stderr, "usage: %s 0|1|2|3 8|16\n", argv[0]); | |
84 return; | |
85 } | |
86 if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1]) | |
87 goto usage; | |
88 nr = argv[1][0] - '0'; | |
89 if (!strcmp(argv[2], "8")) | |
90 ir_16k = false; | |
91 else if (!strcmp(argv[2], "16")) | |
92 ir_16k = true; | |
93 else | |
94 goto usage; | |
95 | |
96 at = &subslots[nr]; | |
97 if (at->is_active) { | |
98 fprintf(stderr, "error: subslot %d is already active\n", nr); | |
99 return; | |
100 } | |
101 | |
102 /* good to proceed now */ | |
103 at->is_active = true; | |
104 at->is_data = true; | |
105 init_trau_ul_frame_csd(nr, ir_16k); | |
73 } | 106 } |
74 | 107 |
75 void cmd_deact(int argc, char **argv) | 108 void cmd_deact(int argc, char **argv) |
76 { | 109 { |
77 int nr; | 110 int nr; |