/* Interrupt handler for TC00. Record the number of bytes received, and then restart a read transfer on the USART if the transfer was stopped.  */
void TC00_Handler(void)
/* Interrupt handler for TC00. Record the number of bytes received, and then restart a read transfer on the USART if the transfer was stopped.  */
void TC00_Handler(void)
{
	static int32_t input_data = 0;
	static int32_t cnt = 0;
	tc_get_status(TC0, 0);
	ioport_toggle_pin_level(PIN_PCCK_INPUT);
	cnt++;
	if (cnt == 1) {
		place_data_to_port(input_data++);
		if (input_data == BUFFER_SIZE ) {
			input_data = 0;
		}
	} else if (cnt == 2) {
		cnt =0;
	}
}