From 6384d0ea2e9ccb304ce3f4e4d03b9efec26ada39 Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Thu, 28 Dec 2023 11:22:55 +0100 Subject: [PATCH] wip: xfer size --- arduino/arduino.ino | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arduino/arduino.ino b/arduino/arduino.ino index 84841a7..ed2f069 100644 --- a/arduino/arduino.ino +++ b/arduino/arduino.ino @@ -95,6 +95,9 @@ void write() { /* Serial.print(","); */ /* } */ /* Serial.println("."); */ + // transfer the size in LE + SPI.transfer(static_cast(size)); + SPI.transfer(static_cast(size >> 8)); SPI.transfer(buffer, size); Serial.write(ControlBytes::WRITE); @@ -154,6 +157,14 @@ void loop() { break; } case ControlBytes::WRITE: { + digitalWrite(LEDG, LOW); + digitalWrite(LEDR, HIGH); + read(); + digitalWrite(LEDR, LOW); + digitalWrite(LEDG, HIGH); + break; + } + case ControlBytes::READ: { digitalWrite(LEDG, LOW); digitalWrite(LEDR, HIGH); write();