diff options
| author | Your Name <you@example.com> | 2026-05-19 01:44:11 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 01:44:11 +0530 |
| commit | 58a0b5fd115d9687a1292e5e82e6b9fa8454b930 (patch) | |
| tree | dd9f18903d0237edcf5844c58fcb88bcf737b22c /components | |
| parent | 699fc6c03899c3b1ff853d8c7c6cf32173436354 (diff) | |
Dynamic layout for WiFi setup: landscape rotation, responsive render, highlight feedback
- Render functions use axs15231b_get_width/height() instead of hardcoded coords
- render_wifi_setup_list: dynamic item widths, screen-relative cancel button
- render_wifi_setup_password: dynamic field/eye/keyboard from kb_get_layout()
- render_wifi_setup_result: centered on screen, dynamic button placement
- handle_wifi_setup_touch: matching dynamic hit areas, highlight_rect() feedback
- Rotation lifecycle: enter_wifi_setup_rotation/exit wired into all entry/exit paths
- display_enter_wifi_setup + READY/ERROR touch + SUCCESS auto-return + LIST cancel
- Added kb_result_t typedef to keyboard.h (was only in .c)
- Fixed test_keyboard.c: use computed offsets from kb_layout_t defaults
- All 101 unit tests pass (touch:19, keyboard:46, wifi_setup:36)
Diffstat (limited to 'components')
| -rw-r--r-- | components/axs15231b/axs15231b.c | 32 | ||||
| -rw-r--r-- | components/axs15231b/include/axs15231b.h | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/components/axs15231b/axs15231b.c b/components/axs15231b/axs15231b.c index 7424a20..77708dd 100644 --- a/components/axs15231b/axs15231b.c +++ b/components/axs15231b/axs15231b.c | |||
| @@ -37,6 +37,7 @@ static spi_device_handle_t s_spi = NULL; | |||
| 37 | static uint16_t *s_fb = NULL; | 37 | static uint16_t *s_fb = NULL; |
| 38 | static int s_width = AXS15231B_WIDTH; | 38 | static int s_width = AXS15231B_WIDTH; |
| 39 | static int s_height = AXS15231B_HEIGHT; | 39 | static int s_height = AXS15231B_HEIGHT; |
| 40 | static int s_rotation = 0; | ||
| 40 | static uint8_t *s_swap_buf = NULL; | 41 | static uint8_t *s_swap_buf = NULL; |
| 41 | #define SWAP_BUF_PIXELS 2048 | 42 | #define SWAP_BUF_PIXELS 2048 |
| 42 | 43 | ||
| @@ -354,3 +355,34 @@ void axs15231b_flush(void) { | |||
| 354 | 355 | ||
| 355 | int axs15231b_get_width(void) { return s_width; } | 356 | int axs15231b_get_width(void) { return s_width; } |
| 356 | int axs15231b_get_height(void) { return s_height; } | 357 | int axs15231b_get_height(void) { return s_height; } |
| 358 | |||
| 359 | void axs15231b_set_rotation(int rotation) { | ||
| 360 | uint8_t madctl = MADCTL_RGB; | ||
| 361 | switch (rotation) { | ||
| 362 | case 0: | ||
| 363 | madctl = MADCTL_RGB; | ||
| 364 | s_width = AXS15231B_WIDTH; | ||
| 365 | s_height = AXS15231B_HEIGHT; | ||
| 366 | break; | ||
| 367 | case 1: | ||
| 368 | madctl = MADCTL_MX | MADCTL_MV; | ||
| 369 | s_width = AXS15231B_HEIGHT; | ||
| 370 | s_height = AXS15231B_WIDTH; | ||
| 371 | break; | ||
| 372 | case 2: | ||
| 373 | madctl = MADCTL_MX | MADCTL_MY; | ||
| 374 | s_width = AXS15231B_WIDTH; | ||
| 375 | s_height = AXS15231B_HEIGHT; | ||
| 376 | break; | ||
| 377 | case 3: | ||
| 378 | madctl = MADCTL_MY | MADCTL_MV; | ||
| 379 | s_width = AXS15231B_HEIGHT; | ||
| 380 | s_height = AXS15231B_WIDTH; | ||
| 381 | break; | ||
| 382 | default: | ||
| 383 | return; | ||
| 384 | } | ||
| 385 | s_rotation = rotation; | ||
| 386 | qspi_write_cmd_data8(MADCTL, madctl); | ||
| 387 | ESP_LOGI(TAG, "Rotation set to %d (%dx%d)", rotation, s_width, s_height); | ||
| 388 | } | ||
diff --git a/components/axs15231b/include/axs15231b.h b/components/axs15231b/include/axs15231b.h index cddea98..a8c1a37 100644 --- a/components/axs15231b/include/axs15231b.h +++ b/components/axs15231b/include/axs15231b.h | |||
| @@ -23,5 +23,6 @@ void axs15231b_fill_rect(int x, int y, int w, int h, uint16_t color); | |||
| 23 | void axs15231b_flush(void); | 23 | void axs15231b_flush(void); |
| 24 | int axs15231b_get_width(void); | 24 | int axs15231b_get_width(void); |
| 25 | int axs15231b_get_height(void); | 25 | int axs15231b_get_height(void); |
| 26 | void axs15231b_set_rotation(int rotation); | ||
| 26 | 27 | ||
| 27 | #endif | 28 | #endif |