mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-01 18:38:17 +00:00
wirelesstracker improvements
This commit is contained in:
@@ -40,6 +40,13 @@
|
||||
* and converts each row to RGB565 for the ST7735R. Direct RGB565 to CFB
|
||||
* causes random noise because CFB doesn't drive colour TFTs correctly. */
|
||||
zephyr,display = &mono_tft;
|
||||
|
||||
/* Same panel drawn a second way: the colour overlay renderer writes
|
||||
* raw RGB565 straight to the ST7735R, bypassing the mono wrapper.
|
||||
* A chosen property rather than a `tft` nodelabel because the panel
|
||||
* node lives in the upstream Zephyr DTS, which an overlay cannot
|
||||
* relabel. */
|
||||
zephcore,color-tft = &st7735r_160x80;
|
||||
};
|
||||
|
||||
/* Monochrome wrapper around the ST7735R 160x80 colour TFT */
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
/* Mono-TFT wrapper: presents PIXEL_FORMAT_MONO01 to CFB and converts
|
||||
* each row to RGB565 for the ST7735R colour TFT. */
|
||||
zephyr,display = &mono_tft;
|
||||
|
||||
/* Same panel drawn a second way: the colour overlay renderer writes
|
||||
* raw RGB565 straight to the ST7735R, bypassing the mono wrapper.
|
||||
* Identical panel and init sequence to the T096, so the same badges,
|
||||
* coloured text and activity graph apply here. */
|
||||
zephcore,color-tft = &st7735r_160x80;
|
||||
};
|
||||
|
||||
mono_tft: mono-tft {
|
||||
@@ -27,7 +33,19 @@
|
||||
height = <80>;
|
||||
};
|
||||
|
||||
/* Button chain: short tap scrolls pages, double tap goes back, long press enters. */
|
||||
/*
|
||||
* Button chain: long press enters, taps drive the gesture ladder below.
|
||||
*
|
||||
* 1 tap (400ms wait) → KEY_1 = page next
|
||||
* 2 taps (400ms wait) → KEY_LEFT = page previous
|
||||
* 3 taps (400ms wait) → KEY_B = LED heartbeat toggle
|
||||
* 4 taps (400ms wait) → KEY_C = GPS on/off
|
||||
* 5 taps (immediate) → KEY_E = flood advert
|
||||
*
|
||||
* This is the T096 variant of the 5-tap ladder — page-prev stays at slot
|
||||
* 2 because this board has a screen. Screenless boards use KEY_B there
|
||||
* instead, where page-prev would be a no-op.
|
||||
*/
|
||||
user_btn_longpress {
|
||||
compatible = "zephyr,input-longpress";
|
||||
input = <&buttons>;
|
||||
@@ -40,7 +58,7 @@
|
||||
page_btn_multitap {
|
||||
compatible = "zephcore,input-multi-tap";
|
||||
input-codes = <INPUT_KEY_A>;
|
||||
tap-codes = <INPUT_KEY_1 INPUT_KEY_LEFT>;
|
||||
tap-codes = <INPUT_KEY_1 INPUT_KEY_LEFT INPUT_KEY_B INPUT_KEY_C INPUT_KEY_E>;
|
||||
tap-delay-ms = <400>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ static uint8_t color_op_count;
|
||||
static uint16_t color_line[COLOR_MAX_WIDTH];
|
||||
|
||||
static const struct device *color_dev =
|
||||
DEVICE_DT_GET_OR_NULL(DT_NODELABEL(tft));
|
||||
DEVICE_DT_GET_OR_NULL(MC_DISPLAY_COLOR_NODE);
|
||||
#endif /* MC_DISPLAY_COLOR_PANEL */
|
||||
|
||||
/* Optional symmetric inset (pixels). Shrinks reported width/height and
|
||||
|
||||
@@ -85,12 +85,31 @@ bool mc_display_is_on(void);
|
||||
*/
|
||||
bool mc_display_is_epd(void);
|
||||
|
||||
/* Color overlay support is compiled only when the devicetree has a raw
|
||||
* RGB565 TFT under the `tft` nodelabel (the runtime probe still verifies
|
||||
* pixel format and readiness). Boards without one get constant-false /
|
||||
* mono-fallback inlines so every color code path — including the ~3.8 KB
|
||||
* overlay op queue in display.c — is dropped at compile time. */
|
||||
#define MC_DISPLAY_COLOR_PANEL DT_NODE_EXISTS(DT_NODELABEL(tft))
|
||||
/* Color overlay support is compiled only when the devicetree points at a raw
|
||||
* RGB565 TFT (the runtime probe still verifies pixel format and readiness).
|
||||
* Boards without one get constant-false / mono-fallback inlines so every
|
||||
* color code path — including the ~3.8 KB overlay op queue in display.c —
|
||||
* is dropped at compile time.
|
||||
*
|
||||
* Two ways to name the panel, in priority order:
|
||||
*
|
||||
* 1. chosen { zephcore,color-tft = <&some_panel>; }
|
||||
* 2. the `tft` nodelabel on the panel node
|
||||
*
|
||||
* (1) exists for boards whose panel node lives in an upstream Zephyr DTS:
|
||||
* an overlay cannot add a nodelabel to an existing node, but it can always
|
||||
* set a chosen property. (2) is kept because every in-tree board that had
|
||||
* color before this indirection names its panel `tft:` — they need no edit.
|
||||
*/
|
||||
#if DT_HAS_CHOSEN(zephcore_color_tft)
|
||||
#define MC_DISPLAY_COLOR_NODE DT_CHOSEN(zephcore_color_tft)
|
||||
#elif DT_NODE_EXISTS(DT_NODELABEL(tft))
|
||||
#define MC_DISPLAY_COLOR_NODE DT_NODELABEL(tft)
|
||||
#else
|
||||
#define MC_DISPLAY_COLOR_NODE DT_INVALID_NODE
|
||||
#endif
|
||||
|
||||
#define MC_DISPLAY_COLOR_PANEL DT_NODE_EXISTS(MC_DISPLAY_COLOR_NODE)
|
||||
|
||||
/**
|
||||
* @return true when a raw RGB565-capable color panel is available for
|
||||
|
||||
Reference in New Issue
Block a user