@@ -45,7 +45,7 @@ void i_info_handler(struct command_result *res){
45
45
46
46
printf ("\r\n%s\r\n" , BP_HARDWARE_VERSION );
47
47
printf ("%s %s%s%s @ %s (%s%s%s)\r\n" ,
48
- t [ T_INFO_FIRMWARE ] ,
48
+ GET_T ( T_INFO_FIRMWARE ) ,
49
49
ui_term_color_num_float (),
50
50
BP_FIRMWARE_VERSION ,
51
51
ui_term_color_reset (),
@@ -57,61 +57,64 @@ void i_info_handler(struct command_result *res){
57
57
ui_term_color_num_float (),
58
58
BP_HARDWARE_MCU ,
59
59
ui_term_color_reset (),
60
- t [ T_INFO_WITH ] ,
60
+ GET_T ( T_INFO_WITH ) ,
61
61
ui_term_color_num_float (),
62
62
BP_HARDWARE_RAM ,
63
63
ui_term_color_reset (),
64
- t [ T_INFO_RAM ] ,
64
+ GET_T ( T_INFO_RAM ) ,
65
65
ui_term_color_num_float (),
66
66
BP_HARDWARE_FLASH ,
67
67
ui_term_color_reset (),
68
- t [ T_INFO_FLASH ] );
68
+ GET_T ( T_INFO_FLASH ) );
69
69
printf ("%s: %s%016llX%s\r\n" ,
70
- t [ T_INFO_SN ] ,
70
+ GET_T ( T_INFO_SN ) ,
71
71
ui_term_color_num_float (),
72
72
mcu_get_unique_id (),
73
73
ui_term_color_reset ());
74
- printf ("%s\r\n" , t [ T_INFO_WEBSITE ] );
74
+ printf ("%s\r\n" , GET_T ( T_INFO_WEBSITE ) );
75
75
76
76
// TF flash card information
77
77
if (system_config .storage_available ){
78
78
printf ("%s: %s%6.2fGB%s (%s %s)\r\n" ,
79
- t [ T_INFO_TF_CARD ] ,
79
+ GET_T ( T_INFO_TF_CARD ) ,
80
80
ui_term_color_num_float (),
81
81
system_config .storage_size ,
82
82
ui_term_color_reset (),
83
83
storage_fat_type_labels [system_config .storage_fat_type - 1 ],
84
- t [ T_INFO_FILE_SYSTEM ]
84
+ GET_T ( T_INFO_FILE_SYSTEM )
85
85
);
86
86
87
87
}else {
88
- printf ("%s: %s\r\n" , t [ T_INFO_TF_CARD ], t [ T_NOT_DETECTED ] );
88
+ printf ("%s: %s\r\n" , GET_T ( T_INFO_TF_CARD ), GET_T ( T_NOT_DETECTED ) );
89
89
}
90
90
91
91
//config file loaded
92
- printf ("\r\n%s%s:%s %s\r\n" , ui_term_color_info (), t [T_CONFIG_FILE ], ui_term_color_reset (), system_config .config_loaded_from_file ?t [T_LOADED ]:t [T_NOT_DETECTED ]);
92
+ do {
93
+ const char * string = system_config .config_loaded_from_file ? GET_T (T_LOADED ) : GET_T (T_NOT_DETECTED );
94
+ printf ("\r\n%s%s:%s %s\r\n" , ui_term_color_info (), GET_T (T_CONFIG_FILE ), ui_term_color_reset (), string );
95
+ } while (0 );
93
96
94
97
if (system_config .big_buffer_owner != BP_BIG_BUFFER_NONE ){
95
98
printf ("%sBig buffer allocated to:%s #%d\r\n" , ui_term_color_info (), ui_term_color_reset (), system_config .big_buffer_owner );
96
99
}
97
100
98
101
99
102
// Installed modes
100
- printf ("%s%s:%s" , ui_term_color_info (), t [ T_INFO_AVAILABLE_MODES ] , ui_term_color_reset ());
103
+ printf ("%s%s:%s" , ui_term_color_info (), GET_T ( T_INFO_AVAILABLE_MODES ) , ui_term_color_reset ());
101
104
for (i = 0 ; i < count_of (modes ); i ++ ){
102
105
printf (" %s" , modes [i ].protocol_name );
103
106
}
104
107
printf ("\r\n" );
105
108
106
109
// Current mode configuration
107
- printf ("%s%s:%s " , ui_term_color_info (), t [ T_INFO_CURRENT_MODE ] , ui_term_color_reset ());
110
+ printf ("%s%s:%s " , ui_term_color_info (), GET_T ( T_INFO_CURRENT_MODE ) , ui_term_color_reset ());
108
111
//TODO: change to a return type and stick this in the fprint
109
112
modes [system_config .mode ].protocol_settings ();
110
113
printf ("\r\n" );
111
114
112
115
printf ("%s%s:%s %s\r\n" ,
113
116
ui_term_color_info (),
114
- t [ T_INFO_DISPLAY_FORMAT ] ,
117
+ GET_T ( T_INFO_DISPLAY_FORMAT ) ,
115
118
ui_term_color_reset (),
116
119
ui_const_display_formats [system_config .display_format ]);
117
120
@@ -120,40 +123,40 @@ void i_info_handler(struct command_result *res){
120
123
// Data settings and configuration
121
124
printf ("%s%s:%s %d %s, %s %s\r\n" ,
122
125
ui_term_color_info (),
123
- t [ T_INFO_DATA_FORMAT ] ,
126
+ GET_T ( T_INFO_DATA_FORMAT ) ,
124
127
ui_term_color_reset (),
125
128
system_config .num_bits ,
126
- t [ T_INFO_BITS ] ,
129
+ GET_T ( T_INFO_BITS ) ,
127
130
ui_const_bit_orders [system_config .bit_order ],
128
- t [ T_INFO_BITORDER ] );
131
+ GET_T ( T_INFO_BITORDER ) );
129
132
130
- printf ("%s%s:%s %s\r\n" , ui_term_color_info (), t [ T_INFO_PULLUP_RESISTORS ] , ui_term_color_reset (), ui_const_pin_states [system_config .pullup_enabled ]);
133
+ printf ("%s%s:%s %s\r\n" , ui_term_color_info (), GET_T ( T_INFO_PULLUP_RESISTORS ) , ui_term_color_reset (), ui_const_pin_states [system_config .pullup_enabled ]);
131
134
132
135
if (system_config .psu && !system_config .psu_error ){
133
136
printf ("%s%s:%s %s (%u.%uV/%u.%uV)\r\n" ,
134
- ui_term_color_info (), t [ T_INFO_POWER_SUPPLY ] , ui_term_color_reset (), t [ T_ON ] ,
137
+ ui_term_color_info (), GET_T ( T_INFO_POWER_SUPPLY ) , ui_term_color_reset (), GET_T ( T_ON ) ,
135
138
(* hw_pin_voltage_ordered [0 ])/1000 , ((* hw_pin_voltage_ordered [0 ])%1000 )/100 ,
136
139
(system_config .psu_voltage )/10000 , ((system_config .psu_voltage )%10000 )/100 );
137
140
138
141
uint32_t isense = ((hw_adc_raw [HW_ADC_CURRENT_SENSE ]) * ((500 * 1000 )/4095 )); //TODO: move this to a PSU function for all calls
139
142
printf ("%s%s:%s OK (%u.%umA/%u.%umA)\r\n" ,
140
- ui_term_color_info (), t [ T_INFO_CURRENT_LIMIT ] , ui_term_color_reset (),
143
+ ui_term_color_info (), GET_T ( T_INFO_CURRENT_LIMIT ) , ui_term_color_reset (),
141
144
(isense /1000 ), ((isense %1000 )/100 ),
142
145
(system_config .psu_current_limit )/10000 , ((system_config .psu_current_limit )%10000 )/100 );
143
146
}else {
144
- printf ("%s%s:%s %s\r\n" , ui_term_color_info (), t [ T_INFO_POWER_SUPPLY ] , ui_term_color_reset (), t [ T_OFF ] );
147
+ printf ("%s%s:%s %s\r\n" , ui_term_color_info (), GET_T ( T_INFO_POWER_SUPPLY ) , ui_term_color_reset (), GET_T ( T_OFF ) );
145
148
146
149
if (system_config .psu_error ){
147
150
printf ("%s%s:%s %s (exceeded %u.%umA)\r\n" ,
148
- ui_term_color_info (), t [ T_INFO_CURRENT_LIMIT ] , ui_term_color_reset (),
151
+ ui_term_color_info (), GET_T ( T_INFO_CURRENT_LIMIT ) , ui_term_color_reset (),
149
152
ui_const_pin_states [5 ],
150
153
(system_config .psu_current_limit )/10000 , ((system_config .psu_current_limit )%10000 )/100 );
151
154
}
152
155
153
156
154
157
}
155
158
156
- printf ("%s%s:%s %s\r\n" , ui_term_color_info (), t [ T_INFO_FREQUENCY_GENERATORS ] , ui_term_color_reset (), !system_config .pwm_active ? t [ T_OFF ]: " " );
159
+ printf ("%s%s:%s %s\r\n" , ui_term_color_info (), GET_T ( T_INFO_FREQUENCY_GENERATORS ) , ui_term_color_reset (), !system_config .pwm_active ? GET_T ( T_OFF ) : " " );
157
160
158
161
// PWMs
159
162
if (system_config .pwm_active ){
0 commit comments