cleanup of the nextion code

This commit is contained in:
Robert Schauklies 2026-01-14 23:32:01 +01:00
parent 1a5c58c31c
commit 502afc9a5f

View file

@ -29,11 +29,6 @@ impl<'a> Nextion<'a> {
let _ = &self.interface.write(b"\xff\xff\xff"); let _ = &self.interface.write(b"\xff\xff\xff");
} }
fn read_frame(&mut self, buf: &mut [u8]) -> Result<usize, RxError> { fn read_frame(&mut self, buf: &mut [u8]) -> Result<usize, RxError> {
let size: usize = 0;
let mut tmp_buf: [u8; 20] = [0; 20];
let mut cmd_end_ctr = 0;
let mut i = 0;
let mut read_header = false;
loop { loop {
if !self.interface.read_ready() { if !self.interface.read_ready() {
continue; continue;
@ -70,7 +65,6 @@ impl<'a> Nextion<'a> {
UartStatemachine::Terminator(n) => { UartStatemachine::Terminator(n) => {
if byte == b'\xff' { if byte == b'\xff' {
if n >= 2 { if n >= 2 {
rprintln!("SENDING {:?}",buf);
let idx = self.idx; let idx = self.idx;
self.reset(); self.reset();
return Ok(idx); return Ok(idx);