File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 23
23
#define SPI_MISO 4
24
24
#define SPI_MOSI 3
25
25
#define SPI_SCK 2
26
- #define MAX_BUFFER_SIZE 4096
27
- #define MAX_OPBUF_SIZE 4096
26
+ #define MAX_BUFFER_SIZE 1024
27
+ #define MAX_OPBUF_SIZE 1024
28
+ #define SERIAL_BUFFER_SIZE 1024
28
29
29
30
// Define a global operation buffer and a pointer to track the current position
30
31
uint8_t opbuf [MAX_OPBUF_SIZE ];
@@ -165,10 +166,16 @@ static void command_loop(void)
165
166
break ;
166
167
}
167
168
case S_CMD_Q_SERBUF :
168
- sendbyte_blocking (S_ACK );
169
- sendbyte_blocking (0xFF );
170
- sendbyte_blocking (0xFF );
171
- break ;
169
+ {
170
+ sendbyte_blocking (S_ACK );
171
+
172
+ // Send the buffer size as a 16-bit little-endian value
173
+ uint16_t bufferSizeLE = SERIAL_BUFFER_SIZE & 0xFFFF ;
174
+ sendbyte_blocking ((uint8_t )(bufferSizeLE & 0xFF )); // Lower byte
175
+ sendbyte_blocking ((uint8_t )((bufferSizeLE >> 8 ) & 0xFF )); // Upper byte
176
+
177
+ break ;
178
+ }
172
179
case S_CMD_Q_BUSTYPE :
173
180
sendbyte_blocking (S_ACK );
174
181
sendbyte_blocking ((1 << 3 )); // BUS_SPI
You can’t perform that action at this time.
0 commit comments