 #define DEBUG 0
 
 const uint16_t MAX_BUFFER_SIZE = SERIAL_RX_BUFFER_SIZE - 1;
-//const uint32_t BLOCK_SIZE = 32 * 1024;
-const uint32_t BLOCK_SIZE = 2000 * 1024;
-//uint16_t buffer_size = 0
-uint16_t buffer_size = 240;
+const uint32_t BLOCK_SIZE = 32 * 1024L;
+uint16_t buffer_size = 0;
 uint32_t threshold = 0;
-
-void message(const __FlashStringHelper *msg)
-{
-	Serial.print(F("M"));
-	Serial.println(msg);
-}
 
 void setup()
 {


void loop()
{
	// Flush
	Serial.flush();
	while (Serial.available() > 0) {
#if DEBUG

	while (n) {
		int a;
		while (n && (a = Serial.available()) > 0) {
#if DEBUG
			Serial.print(F("Dn="));
			Serial.println(n);
#endif
			c = Serial.read();
			// Process the data
			delayMicroseconds(50);
#if DEBUG
			Serial.print(F("Dc = "));
			Serial.print(c);
