@@ -12,6 +12,9 @@ int serialSpeed = 2000000; // serial port speed
1212// //////////////////////////////////////////////////////////////////////////////////////////////////
1313// /////////////////////// CONFIG SECTION ENDS /////////////////////////////
1414// //////////////////////////////////////////////////////////////////////////////////////////////////
15+ #if ESP_ARDUINO_VERSION_MAJOR >= 2
16+ #error "Please use esp32 board manager version 1.x. Versions 2.x and above are unsupported."
17+ #endif
1518
1619#ifdef THIS_IS_RGBW
1720 float whiteLimit = 1 .0f ;
@@ -66,7 +69,7 @@ enum class AwaProtocol
6669};
6770
6871// static data buffer for the loop
69- #define MAX_BUFFER 2048
72+ #define MAX_BUFFER 4096
7073uint8_t buffer[MAX_BUFFER];
7174AwaProtocol state = AwaProtocol::HEADER_A;
7275bool version2 = false ;
@@ -136,14 +139,11 @@ void readSerialData()
136139 stat_good = 0 ;
137140 stat_frames = 0 ;
138141
139- Serial.write (" HyperSerialESP32 version 6.\r\n Statistics for the last full 1 second cycle.\r\n " );
140- Serial.write (" Frames per second: " );
141- Serial.print (stat_final_frames);
142- Serial.write (" \r\n Good frames: " );
143- Serial.print (stat_final_good);
144- Serial.write (" \r\n Bad frames: " );
145- Serial.print (stat_final_frames - stat_final_good);
146- Serial.write (" \r\n -------------------------\r\n " );
142+ Serial.println ((String)" HyperSerialESP32 version 6.1\r\n Statistics for the last full 1 second cycle." +
143+ (String)" \r\n Frames per second: " + stat_final_frames +
144+ (String)" \r\n Good frames: " + stat_final_good +
145+ (String)" \r\n Bad frames: " + (int )(stat_final_frames - stat_final_good) +
146+ (String)" \r\n -------------------------" );
147147 }
148148
149149 if (state == AwaProtocol::HEADER_A)
@@ -353,7 +353,7 @@ void setup()
353353 // Init serial port
354354 Serial.begin (serialSpeed);
355355 Serial.setTimeout (50 );
356- Serial.setRxBufferSize (2048 );
356+ Serial.setRxBufferSize (MAX_BUFFER );
357357
358358 // Display config
359359 Serial.write (" \r\n Welcome!\r\n Awa driver 6.\r\n " );
0 commit comments