 	if (col_i > 7) {
 		col_i = 0;
 		row_i++;
-		if (row_i > 6) row_i = 0;
+		if (row_i > 6) {
+			row_i = 0;
+			if (may_flip) {
+				buf_swap();
+			}
+		}
 	}
 
 	// Column driver latches on rising edge so we can already pull

	}

	// Store the data to back buffer
	buf_back[buf_i++] = data;
	
	// If we have reached the end of frame, flip buffers
	if (buf_i == sizeof(buf_a)) {
		buf_i = 0;
		buf_swap();
		Serial.write('K');
	}
}

uint8_t col_i = 0;
uint8_t row_i = 0;
int buf_i = 0;
volatile uint8_t may_flip = 0;

void buf_swap(void) {
	uint8_t *tmp = buf_front;
	buf_front = buf_back;
	buf_back = tmp;
	if (may_flip) {
		Serial.write('S');
		may_flip = 0;
	}
}

void setup() {
