/* Handler for the CMD_LOAD_ADDRESS command, loading the given device address into a global storage variable for later use, and issuing LOAD EXTENDED ADDRESS commands to the attached device as required.  */
static void V2Protocol_LoadAddress(void)
/* Handler for the CMD_LOAD_ADDRESS command, loading the given device address into a global storage variable for later use, and issuing LOAD EXTENDED ADDRESS commands to the attached device as required.  */
static void V2Protocol_LoadAddress(void)
{
	Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NULL);
	Endpoint_ClearOUT();
	Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
	Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
	if (CurrentAddress & (1UL << 31))
	  MustLoadExtendedAddress = true;
	Endpoint_Write_8(CMD_LOAD_ADDRESS);
	Endpoint_Write_8(STATUS_CMD_OK);
	Endpoint_ClearIN();
}