Skip to content

Add bounded split application messages - #984

Open
colonelpanic8 wants to merge 5 commits into
rmk-rs:mainfrom
colonelpanic8:glove80-rmk/split-app
Open

Add bounded split application messages#984
colonelpanic8 wants to merge 5 commits into
rmk-rs:mainfrom
colonelpanic8:glove80-rmk/split-app

Conversation

@colonelpanic8

Copy link
Copy Markdown
Contributor

What

  • add a 26-byte opaque application payload to the split wire protocol
  • expose bounded central-to-peripheral, peripheral-to-central, and receive queues
  • expose split-link state so applications can resynchronize after reconnects
  • keep key events ahead of application traffic and use drop-on-full semantics to preserve split responsiveness

Why

RMK-based firmware sometimes needs to coordinate application-owned state across halves without adding hardware-specific meaning to the core split protocol. Per-key lighting is one consumer, but this API stays opaque and allocation-free.

Impact

Existing split behavior is unchanged unless the new queues are used. The implementation currently targets a single split peripheral and documents that limitation.

Checks

  • repository formatter
  • full RMK feature-matrix tests
  • Rynk host tests, doctests, WASM checks/package typecheck, and clippy

@Schievel1

Copy link
Copy Markdown
Contributor

Iirc this is also useful to transport state of the keyboard to the peripheral that is not available in the usual split protocol right?

Like for example I have a special function in my firmware that moves the mouse pointer a bit automatically when it's active. And I have a display on the peripheral that should display whether it's active.
Could I use this PR for that?

@HaoboGu
HaoboGu force-pushed the feat/rynk branch 5 times, most recently from c09015e to d2c97ab Compare July 31, 2026 14:10
@colonelpanic8
colonelpanic8 force-pushed the glove80-rmk/split-app branch from 6f436cf to 0195a61 Compare August 5, 2026 08:12
@colonelpanic8
colonelpanic8 changed the base branch from feat/rynk to main August 5, 2026 08:12
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Size Report

Example main PR Diff .text .data .bss
use_config/nrf52832_ble 398.7 KiB 398.7 KiB +0.00% 0 0 0
use_config/nrf52840_ble 440.8 KiB 440.8 KiB +0.00% ⬇️ -4 0 0
use_config/nrf52840_ble_split (central) 506.3 KiB 512.0 KiB +1.12% ⬆️ +1984 +48 +3792
use_config/nrf52840_ble_split (peripheral) 317.5 KiB 323.0 KiB +1.73% ⬆️ +2004 +48 +3592
use_config/pi_pico_w_ble 673.9 KiB 673.9 KiB +0.00% ⬆️ +8 0 0
use_config/rp2040 146.1 KiB 146.1 KiB +0.00% 0 0 0
use_config/rp2040_split (central) 159.8 KiB 165.2 KiB +3.41% ⬆️ +1740 0 +3852
use_config/rp2040_split (peripheral) 27.9 KiB 33.1 KiB +18.69% ⬆️ +1720 +52 +3568
use_config/stm32f1 62.7 KiB 62.7 KiB +0.00% ⬇️ -4 0 0
use_config/stm32h7 100.9 KiB 100.9 KiB +0.00% ⬆️ +4 0 0
use_rust/nrf52832_ble 386.8 KiB 386.8 KiB +0.00% 0 0 0
use_rust/nrf52840_ble 436.3 KiB 436.3 KiB +0.00% 0 0 0
use_rust/nrf52840_ble_split (central) 508.4 KiB 514.1 KiB +1.12% ⬆️ +1996 +48 +3792
use_rust/nrf52840_ble_split (peripheral) 315.2 KiB 320.7 KiB +1.74% ⬆️ +1984 +48 +3592
use_rust/pi_pico_w_ble 673.3 KiB 673.3 KiB +0.00% 0 0 0
use_rust/rp2040 145.6 KiB 145.6 KiB +0.00% ⬇️ -4 0 0
use_rust/rp2040_split (central) 158.4 KiB 163.6 KiB +3.27% ⬆️ +1480 0 +3832
use_rust/rp2040_split (peripheral) 28.2 KiB 33.5 KiB +18.50% ⬆️ +1732 +52 +3568
use_rust/stm32f1 61.9 KiB 61.9 KiB +0.00% 0 0 0
use_rust/stm32h7 119.3 KiB 119.3 KiB +0.00% 0 0 0
use_config/nrf52832_ble — 398.7 KiB → 398.7 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 365736	   8620	  33952	 408308	  63af4	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 365736	   8620	  33952	 408308	  63af4	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +288  [ = ]       0    .debug_info
  +0.1%    +250  [ = ]       0    .debug_line
  +0.0%     +26  [ = ]       0    .debug_str
  -1.7%      -1  [ = ]       0    [Unmapped]
  -0.0%     -10  [ = ]       0    .debug_loc
  -0.0%     -37  [ = ]       0    .strtab
  +0.0%    +516  [ = ]       0    TOTAL
use_config/nrf52840_ble — 440.8 KiB → 440.8 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 398760	   8628	  43984	 451372	  6e32c	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 398764	   8628	  43984	 451376	  6e330	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +2.71Ki  [ = ]       0    .debug_str
  +0.1%    +428  [ = ]       0    .strtab
  +0.0%     +88  [ = ]       0    .debug_line
  +0.0%     +73  [ = ]       0    .debug_info
  +0.5%     +39  [ = ]       0    .debug_abbrev
  +7.8%      +4  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  -0.0%     -10  [ = ]       0    .debug_loc
  +0.0% +3.32Ki  -0.0%      -4    TOTAL
use_config/nrf52840_ble_split (central) — 506.3 KiB → 512.0 KiB (+1.12% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 461652	   8732	  53928	 524312	  80018	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 459668	   8684	  50136	 518488	  7e958	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.9% +44.0Ki  [ = ]       0    .debug_str
  +0.6% +13.5Ki  [ = ]       0    .debug_info
  [ = ]       0  +7.7% +3.70Ki    .bss
  +0.5% +2.08Ki  [ = ]       0    .strtab
  +0.4% +1.68Ki  +0.4% +1.68Ki    .text
  +0.4% +1.45Ki  [ = ]       0    .debug_line
  +0.5% +1.23Ki  [ = ]       0    .debug_ranges
  +0.1%    +962  [ = ]       0    .debug_loc
  +0.4%    +576  [ = ]       0    .symtab
  +0.5%    +292  [ = ]       0    .debug_frame
  +0.6%    +264  +0.6%    +264    .rodata
  +0.3%    +144  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
   +27%     +13  [ = ]       0    [Unmapped]
  +1.0%      +9  [ = ]       0    .defmt
  -0.5%     -39  [ = ]       0    .debug_abbrev
  +0.7% +66.2Ki  +1.1% +5.69Ki    TOTAL
use_config/nrf52840_ble_split (peripheral) — 317.5 KiB → 323.0 KiB (+1.73% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 293400	   8556	  28776	 330732	  50bec	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 291396	   8508	  25184	 325088	  4f5e0	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.8% +57.8Ki  [ = ]       0    .debug_str
  +1.0% +16.6Ki  [ = ]       0    .debug_info
  [ = ]       0   +15% +3.51Ki    .bss
  +0.6% +3.15Ki  [ = ]       0    .debug_loc
  +1.2% +3.07Ki  [ = ]       0    .strtab
  +1.2% +1.88Ki  [ = ]       0    .debug_ranges
  +0.8% +1.87Ki  [ = ]       0    .debug_line
  +0.7% +1.73Ki  +0.7% +1.73Ki    .text
  +0.9%    +912  [ = ]       0    .symtab
  +1.4%    +456  [ = ]       0    .debug_frame
  +0.7%    +228  +0.7%    +228    .rodata
  +0.5%    +224  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +1.4%      +9  [ = ]       0    .defmt
  +4.3%      +2  [ = ]       0    [Unmapped]
  -0.2%     -16  [ = ]       0    .debug_abbrev
  +1.3% +88.0Ki  +1.7% +5.51Ki    TOTAL
use_config/pi_pico_w_ble — 673.9 KiB → 673.9 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 636096	      0	  54016	 690112	  a87c0	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 636088	      0	  54016	 690104	  a87b8	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +37  [ = ]       0    .debug_info
  +0.0%     +10  [ = ]       0    .debug_loc
  +0.0%      +4  +0.0%      +4    .rodata
  +0.0%      +4  +0.0%      +4    .text
  -0.0%      -1  [ = ]       0    .strtab
 -11.1%      -6  [ = ]       0    [Unmapped]
  +0.0%     +48  +0.0%      +8    TOTAL
use_config/rp2040 — 146.1 KiB → 146.1 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135704	      0	  13900	 149604	  24864	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135704	      0	  13900	 149604	  24864	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +30  [ = ]       0    .debug_str
  +0.0%     +14  [ = ]       0    .strtab
  +3.7%      +2  [ = ]       0    [Unmapped]
  -0.0%     -10  [ = ]       0    .debug_loc
  -0.0%     -44  [ = ]       0    .debug_line
  -0.0%      -8  [ = ]       0    TOTAL
use_config/rp2040_split (central) — 159.8 KiB → 165.2 KiB (+3.41% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 150492	      0	  18696	 169188	  294e4	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 148752	      0	  14844	 163596	  27f0c	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.4% +47.2Ki  [ = ]       0    .debug_str
  +1.4% +15.8Ki  [ = ]       0    .debug_info
  +1.7% +6.04Ki  [ = ]       0    .debug_loc
  [ = ]       0   +28% +3.76Ki    .bss
  +1.2% +1.63Ki  [ = ]       0    .strtab
  +0.9% +1.61Ki  [ = ]       0    .debug_line
  +1.2% +1.46Ki  +1.2% +1.46Ki    .text
  +1.4% +1.25Ki  [ = ]       0    .debug_ranges
  +0.9%    +320  [ = ]       0    .symtab
  +1.1%    +196  +1.1%    +196    .rodata
  +1.0%    +188  [ = ]       0    .debug_frame
  +0.5%     +96  [ = ]       0    .debug_aranges
   +29%     +52   +37%     +52    .data
  +0.2%      +1  [ = ]       0    .defmt
 -17.5%     -11  [ = ]       0    [Unmapped]
  +1.8% +75.8Ki  +3.4% +5.46Ki    TOTAL
use_config/rp2040_split (peripheral) — 27.9 KiB → 33.1 KiB (+18.69% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  27416	    112	   6372	  33900	   846c	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25696	     60	   2804	  28560	   6f90	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +6.3% +53.2Ki  [ = ]       0    .debug_str
  +4.8% +18.5Ki  [ = ]       0    .debug_info
  +5.2% +3.64Ki  [ = ]       0    .debug_loc
  [ = ]       0  +200% +3.48Ki    .bss
  +3.2% +1.83Ki  [ = ]       0    .debug_line
   +10% +1.69Ki  [ = ]       0    .debug_ranges
  +6.2% +1.52Ki  [ = ]       0    .strtab
  +7.4% +1.49Ki  +7.4% +1.49Ki    .text
  +3.6%    +320  [ = ]       0    .symtab
  +4.2%    +196  +4.2%    +196    .rodata
  +2.9%    +160  [ = ]       0    .debug_frame
  +0.7%     +96  [ = ]       0    .debug_aranges
   +52%     +52   +87%     +52    .data
  +0.4%     +26  [ = ]       0    .debug_abbrev
  +0.5%      +1  [ = ]       0    .defmt
 -18.0%      -9  [ = ]       0    [Unmapped]
  +5.7% +82.7Ki   +19% +5.21Ki    TOTAL
use_config/stm32f1 — 62.7 KiB → 62.7 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57784	     28	   6360	  64172	   faac	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57788	     28	   6360	  64176	   fab0	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +63  [ = ]       0    .debug_str
  +0.0%     +52  [ = ]       0    .debug_info
  +0.0%      +9  [ = ]       0    .strtab
  -0.0%      -4  -0.0%      -4    .text
  +0.0%    +120  -0.0%      -4    TOTAL
use_config/stm32h7 — 100.9 KiB → 100.9 KiB (+0.00% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  94928	    264	   8112	 103304	  19388	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  94924	    264	   8112	 103300	  19384	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +4  +0.0%      +4    .text
  -6.7%      -4  [ = ]       0    [Unmapped]
  -0.0%      -9  [ = ]       0    .strtab
  -0.0%     -52  [ = ]       0    .debug_info
  -0.0%     -63  [ = ]       0    .debug_str
  -0.0%    -124  +0.0%      +4    TOTAL
use_rust/nrf52832_ble — 386.8 KiB → 386.8 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 353560	   8620	  33896	 396076	  60b2c	rmk-nrf52832

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 353560	   8620	  33896	 396076	  60b2c	rmk-nrf52832

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +33  [ = ]       0    .strtab
  -2.1%      -1  [ = ]       0    [Unmapped]
  -0.0%     -10  [ = ]       0    .debug_line
  -0.0%     -10  [ = ]       0    .debug_loc
  -0.0%     -48  [ = ]       0    .debug_str
  -0.0%     -72  [ = ]       0    .debug_info
  -0.0%    -108  [ = ]       0    TOTAL
use_rust/nrf52840_ble — 436.3 KiB → 436.3 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 396892	   8628	  41216	 446736	  6d110	rmk-nrf52840

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 396892	   8628	  41216	 446736	  6d110	rmk-nrf52840

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +72  [ = ]       0    .debug_info
  +0.0%     +37  [ = ]       0    .debug_str
  -6.0%      -4  [ = ]       0    [Unmapped]
  -0.0%     -33  [ = ]       0    .strtab
  -0.1%    -232  [ = ]       0    .debug_line
  -0.0%    -160  [ = ]       0    TOTAL
use_rust/nrf52840_ble_split (central) — 508.4 KiB → 514.1 KiB (+1.12% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 462276	   8732	  55480	 526488	  80898	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 460280	   8684	  51688	 520652	  7f1cc	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.9% +42.6Ki  [ = ]       0    .debug_str
  +0.6% +13.3Ki  [ = ]       0    .debug_info
  [ = ]       0  +7.5% +3.70Ki    .bss
  +0.6% +2.54Ki  [ = ]       0    .strtab
  +0.5% +1.81Ki  [ = ]       0    .debug_line
  +0.7% +1.80Ki  [ = ]       0    .debug_ranges
  +0.4% +1.69Ki  +0.4% +1.69Ki    .text
  +0.2% +1.32Ki  [ = ]       0    .debug_loc
  +0.3%    +528  [ = ]       0    .symtab
  +0.5%    +264  [ = ]       0    .debug_frame
  +0.6%    +264  +0.6%    +264    .rodata
  +0.3%    +136  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +0.5%     +39  [ = ]       0    .debug_abbrev
  +1.0%      +9  [ = ]       0    .defmt
   +18%      +8  [ = ]       0    [Unmapped]
  +0.7% +66.3Ki  +1.1% +5.70Ki    TOTAL
use_rust/nrf52840_ble_split (peripheral) — 315.2 KiB → 320.7 KiB (+1.74% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 291292	   8556	  28544	 328392	  502c8	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 289308	   8508	  24952	 322768	  4ecd0	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.9% +59.9Ki  [ = ]       0    .debug_str
  +1.1% +17.9Ki  [ = ]       0    .debug_info
  [ = ]       0   +15% +3.51Ki    .bss
  +0.6% +3.01Ki  [ = ]       0    .debug_loc
  +1.1% +2.92Ki  [ = ]       0    .strtab
  +1.0% +2.29Ki  [ = ]       0    .debug_line
  +1.4% +2.22Ki  [ = ]       0    .debug_ranges
  +0.7% +1.71Ki  +0.7% +1.71Ki    .text
  +0.7%    +736  [ = ]       0    .symtab
  +1.1%    +376  [ = ]       0    .debug_frame
  +0.7%    +236  +0.7%    +236    .rodata
  +0.5%    +192  [ = ]       0    .debug_aranges
  +0.6%     +48  +0.6%     +48    .data
  +1.4%      +9  [ = ]       0    .defmt
 -27.3%     -15  [ = ]       0    [Unmapped]
  -0.2%     -16  [ = ]       0    .debug_abbrev
  +1.4% +91.5Ki  +1.7% +5.49Ki    TOTAL
use_rust/pi_pico_w_ble — 673.3 KiB → 673.3 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 635720	      0	  53696	 689416	  a8508	rmk-pi-pico-w

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 635720	      0	  53696	 689416	  a8508	rmk-pi-pico-w

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +227  [ = ]       0    .debug_info
  +0.0%     +19  [ = ]       0    .debug_line
  +0.0%     +10  [ = ]       0    .debug_loc
  +1.4%      +1  [ = ]       0    [Unmapped]
  -0.2%    -622  [ = ]       0    .strtab
  -0.1% -4.21Ki  [ = ]       0    .debug_str
  -0.0% -4.57Ki  [ = ]       0    TOTAL
use_rust/rp2040 — 145.6 KiB → 145.6 KiB (+0.00% ⬇️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 135332	      0	  13732	 149064	  24648	rmk-rp2040

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 135336	      0	  13732	 149068	  2464c	rmk-rp2040

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +132  [ = ]       0    .debug_str
  +0.1%    +124  [ = ]       0    .debug_line
  +0.0%     +37  [ = ]       0    .debug_info
  +0.0%     +15  [ = ]       0    .strtab
  +0.0%     +10  [ = ]       0    .debug_loc
   +16%      +6  [ = ]       0    [Unmapped]
  -0.0%      -4  -0.0%      -4    .text
  +0.0%    +320  -0.0%      -4    TOTAL
use_rust/rp2040_split (central) — 158.4 KiB → 163.6 KiB (+3.27% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 149132	      0	  18420	 167552	  28e80	central

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 147652	      0	  14588	 162240	  279c0	central

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +2.4% +46.7Ki  [ = ]       0    .debug_str
  +1.4% +16.0Ki  [ = ]       0    .debug_info
  +1.6% +5.36Ki  [ = ]       0    .debug_loc
  [ = ]       0   +28% +3.74Ki    .bss
  +2.0% +1.80Ki  [ = ]       0    .debug_ranges
  +1.3% +1.65Ki  [ = ]       0    .strtab
  +0.8% +1.40Ki  [ = ]       0    .debug_line
  +1.0% +1.20Ki  +1.0% +1.20Ki    .text
  +1.2%    +416  [ = ]       0    .symtab
  +1.1%    +196  +1.1%    +196    .rodata
  +1.0%    +188  [ = ]       0    .debug_frame
  +0.6%    +104  [ = ]       0    .debug_aranges
   +29%     +52   +37%     +52    .data
  +0.2%      +1  [ = ]       0    .defmt
 -22.2%     -10  [ = ]       0    [Unmapped]
  +1.8% +75.0Ki  +3.3% +5.19Ki    TOTAL
use_rust/rp2040_split (peripheral) — 28.2 KiB → 33.5 KiB (+18.50% ⬆️)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  27528	    112	   6636	  34276	   85e4	peripheral

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  25796	     60	   3068	  28924	   70fc	peripheral

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +6.3% +53.7Ki  [ = ]       0    .debug_str
  +5.0% +19.3Ki  [ = ]       0    .debug_info
   +13% +8.96Ki  [ = ]       0    .debug_loc
  [ = ]       0  +175% +3.48Ki    .bss
  +3.2% +1.84Ki  [ = ]       0    .debug_line
  +9.9% +1.62Ki  [ = ]       0    .debug_ranges
  +6.4% +1.54Ki  [ = ]       0    .strtab
  +7.4% +1.50Ki  +7.5% +1.50Ki    .text
  +4.8%    +416  [ = ]       0    .symtab
  +4.1%    +200  +4.2%    +200    .rodata
  +3.0%    +160  [ = ]       0    .debug_frame
  +0.7%     +96  [ = ]       0    .debug_aranges
   +52%     +52   +87%     +52    .data
   +16%      +8  [ = ]       0    [Unmapped]
  +0.5%      +1  [ = ]       0    .defmt
  +6.1% +89.3Ki   +19% +5.23Ki    TOTAL
use_rust/stm32f1 — 61.9 KiB → 61.9 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
  57120	     28	   6280	  63428	   f7c4	rmk-stm32f1

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
  57120	     28	   6280	  63428	   f7c4	rmk-stm32f1

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL
use_rust/stm32h7 — 119.3 KiB → 119.3 KiB (+0.00%)

cargo size (PR):

   text	   data	    bss	    dec	    hex	filename
 107836	    320	  14012	 122168	  1dd38	rmk-stm32h7

cargo size (main):

   text	   data	    bss	    dec	    hex	filename
 107836	    320	  14012	 122168	  1dd38	rmk-stm32h7

Bloaty diff (PR vs main):

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +8.0%      +4  [ = ]       0    [Unmapped]
  -0.0%      -6  [ = ]       0    .strtab
  -0.0%     -10  [ = ]       0    .debug_loc
  -0.0%     -16  [ = ]       0    .debug_str
  -0.0%     -28  [ = ]       0    TOTAL

@colonelpanic8
colonelpanic8 marked this pull request as ready for review August 5, 2026 08:59
@HaoboGu

HaoboGu commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

what is this message used for?

@Schievel1

Copy link
Copy Markdown
Contributor

Would be good to have some docs on how to use this.

colonelpanic8 and others added 4 commits August 20, 2026 01:44
Add an opaque, bounded application payload that firmware can exchange
between the split central and peripheral alongside the normal split
traffic, without ever taking priority over key events.

* `split_app` module: `SplitAppData` (a small, `MaxSize`, postcard
  length-prefixed payload) plus four statics — `SPLIT_APP_TX`
  (central -> peripheral), `SPLIT_APP_PERIPH_TX` (peripheral ->
  central), the symmetric `SPLIT_APP_RX` inbox, and the `SPLIT_APP_LINK`
  watch that reports split-link state to the application.
* Producers use `try_send` only (bounded, drop-on-full) so the split
  read/write loops never block or get starved by application traffic;
  key events are always polled first.
* The split driver and peripheral drain the application queues as the
  lowest-priority arm of their outgoing selects and forward received
  `SplitMessage::Application` payloads into the inbox.
* `SPLIT_APP_LINK` is state-based (a `Watch`), so a late-subscribing
  application still observes the current link state; the `false -> true`
  edge is a resync trigger. Link-down edges are emitted from a drop
  guard so they survive async cancellation of the split session.
* On the peripheral the link is raised on the FIRST inbound message from
  the central rather than on bare connection: over BLE, notifications to
  a central that has not yet subscribed are silently dropped, so the
  connection alone is not proof the application channel is usable.

Developed for a split keyboard port.
Move the duplicated inline LinkDownGuard structs into split_app as a
single LinkGuard that also owns the idempotent link-up edge, extract the
peripheral's central-message match into handle_central_message so it is
no longer nested five levels deep inside run(), share the drop-on-full
inbox delivery between both sides, and trim comments down to the
non-obvious facts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The TX side is sized for a whole snapshot burst, but the RX side held 8
payloads and deliver_received drops on full. BLE's connection interval
paced arrivals enough to hide it; a wired transport delivers the burst
faster than the consumer drains, so the receiver must hold it too. The
peripheral's own TX channel gets headroom for the same reason.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@colonelpanic8
colonelpanic8 force-pushed the glove80-rmk/split-app branch from 68390bf to 0f51210 Compare August 20, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants