@@ -12,6 +12,9 @@ int serialSpeed = 2000000; // serial port speed
12
12
// //////////////////////////////////////////////////////////////////////////////////////////////////
13
13
// /////////////////////// CONFIG SECTION ENDS /////////////////////////////
14
14
// //////////////////////////////////////////////////////////////////////////////////////////////////
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
15
18
16
19
#ifdef THIS_IS_RGBW
17
20
float whiteLimit = 1 .0f ;
@@ -66,7 +69,7 @@ enum class AwaProtocol
66
69
};
67
70
68
71
// static data buffer for the loop
69
- #define MAX_BUFFER 2048
72
+ #define MAX_BUFFER 4096
70
73
uint8_t buffer[MAX_BUFFER];
71
74
AwaProtocol state = AwaProtocol::HEADER_A;
72
75
bool version2 = false ;
@@ -136,14 +139,11 @@ void readSerialData()
136
139
stat_good = 0 ;
137
140
stat_frames = 0 ;
138
141
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 -------------------------" );
147
147
}
148
148
149
149
if (state == AwaProtocol::HEADER_A)
@@ -353,7 +353,7 @@ void setup()
353
353
// Init serial port
354
354
Serial.begin (serialSpeed);
355
355
Serial.setTimeout (50 );
356
- Serial.setRxBufferSize (2048 );
356
+ Serial.setRxBufferSize (MAX_BUFFER );
357
357
358
358
// Display config
359
359
Serial.write (" \r\n Welcome!\r\n Awa driver 6.\r\n " );
0 commit comments