Digit Mode for frequency field (#1298)

* Remove 'auto' step mode

* Support per-digit edits on the freq field.

* Swizzle instead of raw accessor

* Fix debug ui after swizzle
This commit is contained in:
Kyle Reed 2023-07-24 09:09:22 -07:00 committed by GitHub
parent e2bca9aebb
commit 3514a9a608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 230 additions and 95 deletions

View file

@ -20,6 +20,7 @@
*/
#include "ui.hpp"
#include "irq_controls.hpp"
#include "sine_table.hpp"
#include "utility.hpp"
@ -102,4 +103,14 @@ Point fast_polar_to_point(int32_t angle, uint32_t distance) {
(int16_sin_s4(((1 << 16) * (-angle - 90)) / 360) * distance) / (1 << 16));
}
bool key_is_long_pressed(KeyEvent key) {
if (key < KeyEvent::Back) {
// TODO: this would make more sense as a flag on KeyEvent
// passed up to the UI via event dispatch.
return switch_is_long_pressed(static_cast<Switch>(key));
}
return false;
}
} /* namespace ui */