forked from mohr/ArduinoIO
		
	some more output, can be disabled optionally
This commit is contained in:
		@@ -3,6 +3,12 @@
 | 
			
		||||
 | 
			
		||||
static const uint8_t COMMAND_TRANSFER_SPI = 1;
 | 
			
		||||
 | 
			
		||||
// Can be set to one for additional programming information from the primary
 | 
			
		||||
// serial port which is usually also used to flash the Arduino
 | 
			
		||||
// Can be disabled if this output interferes with the usual
 | 
			
		||||
// serial communication logic
 | 
			
		||||
#define PROGRAMMING_OUTPUT      1
 | 
			
		||||
 | 
			
		||||
#define BAUD_RATE               115200
 | 
			
		||||
#define SERIAL_RX_BUFFER_SIZE   256
 | 
			
		||||
#define RING_BUFFER_SIZE        100
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								main.cpp
									
									
									
									
									
								
							@@ -142,7 +142,8 @@ void handleNewData() {
 | 
			
		||||
	if (result == HasReturnvaluesIF::RETURN_OK) {
 | 
			
		||||
		handlePacket(packet, packetLen);
 | 
			
		||||
 | 
			
		||||
		//after handling the packet, we can delete it from the raw stream, it has been copied to packet
 | 
			
		||||
		// after handling the packet, we can delete it from the raw stream,
 | 
			
		||||
		// it has been copied to packet
 | 
			
		||||
		toDelete += readSize;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -170,16 +171,18 @@ void setup() {
 | 
			
		||||
	// if no transfer is going on.
 | 
			
		||||
	CS_PORT = 0xff;
 | 
			
		||||
	Serial.begin(BAUD_RATE);
 | 
			
		||||
	Serial.println("Setting up Arduino IO interface board.");
 | 
			
		||||
	Serial.print("Configured baud rate for serial communication: ");
 | 
			
		||||
#if PROGRAMMING_OUTPUT == 1
 | 
			
		||||
	Serial.println("-AI- Setting up Arduino IO interface board.");
 | 
			
		||||
	Serial.print("-AI- Configured baud rate for serial communication: ");
 | 
			
		||||
	Serial.println(BAUD_RATE, DEC);
 | 
			
		||||
	Serial.print("Size of serial receiver buffer: ");
 | 
			
		||||
	Serial.print(SERIAL_RX_BUFFER_SIZE, DEC);Serial.print(" bytes");
 | 
			
		||||
	Serial.print("-AI- Size of serial receiver buffer: ");
 | 
			
		||||
	Serial.print(SERIAL_RX_BUFFER_SIZE, DEC);
 | 
			
		||||
	Serial.println(" bytes");
 | 
			
		||||
#endif
 | 
			
		||||
	SPI.begin();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void loop() {
 | 
			
		||||
;
 | 
			
		||||
	handleNewData();
 | 
			
		||||
	delay(1000);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user