@@ -3,7 +3,7 @@ use core::sync::atomic::Ordering;
33use crate :: types:: { InterchangeResponse , Responder } ;
44
55use ctaphid_app:: { App , Command , Error } ;
6- use heapless_bytes:: Bytes ;
6+ use heapless_bytes:: { Bytes , BytesView } ;
77use ref_swap:: OptionRefSwap ;
88use trussed_core:: InterruptFlag ;
99
@@ -34,8 +34,8 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
3434
3535 fn find_app < ' a , ' b > (
3636 command : Command ,
37- apps : & ' a mut [ & ' b mut dyn App < ' interrupt , N > ] ,
38- ) -> Option < & ' a mut & ' b mut dyn App < ' interrupt , N > > {
37+ apps : & ' a mut [ & ' b mut dyn App < ' interrupt > ] ,
38+ ) -> Option < & ' a mut & ' b mut dyn App < ' interrupt > > {
3939 apps. iter_mut ( )
4040 . find ( |app| app. commands ( ) . contains ( & command) )
4141 }
@@ -75,7 +75,7 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
7575 }
7676
7777 #[ inline( never) ]
78- fn call_app ( & mut self , app : & mut dyn App < ' interrupt , N > , command : Command , request : & Bytes < N > ) {
78+ fn call_app ( & mut self , app : & mut dyn App < ' interrupt > , command : Command , request : & BytesView ) {
7979 let response_buffer = self
8080 . responder
8181 . response_mut ( )
@@ -106,9 +106,9 @@ impl<'pipe, 'interrupt, const N: usize> Dispatch<'pipe, 'interrupt, N> {
106106 }
107107
108108 #[ inline( never) ]
109- pub fn poll ( & mut self , apps : & mut [ & mut dyn App < ' interrupt , N > ] ) -> bool {
109+ pub fn poll ( & mut self , apps : & mut [ & mut dyn App < ' interrupt > ] ) -> bool {
110110 // We could call take_request directly, but for some reason this doubles stack usage.
111- let mut message_buffer = Bytes :: new ( ) ;
111+ let mut message_buffer = Bytes :: < 1024 > :: new ( ) ;
112112 if let Ok ( ( command, message) ) = self . responder . request ( ) {
113113 // info_now!("cmd: {}", u8::from(command));
114114 // info_now!("cmd: {:?}", command);
0 commit comments