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
11 changed files with 230 additions and 95 deletions

View File

@@ -34,6 +34,10 @@ using Dim = int16_t;
constexpr uint16_t screen_width = 240;
constexpr uint16_t screen_height = 320;
/* Dimensions for the default font character. */
constexpr uint16_t char_width = 8;
constexpr uint16_t char_height = 16;
struct Color {
uint16_t v; // rrrrrGGGGGGbbbbb
@@ -328,7 +332,7 @@ struct Bitmap {
const uint8_t* const data;
};
enum class KeyEvent {
enum class KeyEvent : uint8_t {
/* Ordinals map to bit positions reported by CPLD */
Right = 0,
Left = 1,
@@ -356,6 +360,11 @@ Point polar_to_point(float angle, uint32_t distance);
Point fast_polar_to_point(int32_t angle, uint32_t distance);
/* Default font glyph size. */
constexpr Size char_size{char_width, char_height};
bool key_is_long_pressed(KeyEvent key);
} /* namespace ui */
#endif /*__UI_H__*/