|
|
|
|
131
|
|
131
|
|
132
|
// Code seen bit was set. If not found, value_ptr is unchanged.
|
132
|
// Code seen bit was set. If not found, value_ptr is unchanged.
|
133
|
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
|
133
|
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
|
134
|
- // This is volatile because its side-effects are important
|
|
|
135
|
- static volatile bool seen(const char c) {
|
|
|
|
|
134
|
+ static bool seen(const char c) {
|
136
|
const uint8_t ind = LETTER_OFF(c);
|
135
|
const uint8_t ind = LETTER_OFF(c);
|
137
|
if (ind >= COUNT(param)) return false; // Only A-Z
|
136
|
if (ind >= COUNT(param)) return false; // Only A-Z
|
138
|
const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind));
|
137
|
const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind));
|
|
|
|
|
148
|
|
147
|
|
149
|
// Code is found in the string. If not found, value_ptr is unchanged.
|
148
|
// Code is found in the string. If not found, value_ptr is unchanged.
|
150
|
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
|
149
|
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
|
151
|
- // This is volatile because its side-effects are important
|
|
|
152
|
- static volatile bool seen(const char c) {
|
|
|
|
|
150
|
+ static bool seen(const char c) {
|
153
|
const char *p = strchr(command_args, c);
|
151
|
const char *p = strchr(command_args, c);
|
154
|
const bool b = !!p;
|
152
|
const bool b = !!p;
|
155
|
if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;
|
153
|
if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;
|