From e568f80a08cdc3b324d3f5a054141d2fbf14ec4f Mon Sep 17 00:00:00 2001
From: CNLohr <lohr85@gmail.com>
Date: Sat, 6 May 2023 17:14:11 -0400
Subject: [PATCH] Add note about the extra wait being weird.

---
 minichlink/pgm-esp32s2-ch32xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/minichlink/pgm-esp32s2-ch32xx.c b/minichlink/pgm-esp32s2-ch32xx.c
index 0672a6d..11d0048 100644
--- a/minichlink/pgm-esp32s2-ch32xx.c
+++ b/minichlink/pgm-esp32s2-ch32xx.c
@@ -236,7 +236,10 @@ int ESPBlockWrite64( void * dev, uint32_t address_to_write, uint8_t * data )
 	{
 		ESPFlushLLCommands( dev );
 	} while( eps->replylen < 2 );
+	
+	// Not sure why this is needed.
 	ESPWaitForDoneOp( dev, 0 );
+
 	return eps->reply[1];
 }
 
@@ -358,7 +361,6 @@ int ESPPollTerminal( void * dev, uint8_t * buffer, int maxlen, uint32_t leavefla
 
 	memcpy( buffer, eps->reply + 2, rlen - 1 );
 
-
 	return rlen - 1;
 }
 
-- 
GitLab