Serial Port Complete - Latest Microcontroller projects

(lily) #1

Chapter 13


 void transmit_serial_data(void)
{
#if defined firmware_driver_enable
driver_enable = 1;
#endif


while(BusyUSART());
putcUSART (command_response[response_index]);

if (command_response[response_index] == 0x0a)
{
// The entire response has been sent.

#if defined(firmware_driver_enable)

while(BusyUSART());
driver_enable = 0;

#endif

// Prepare to receive another command.

initialize_serial_buffers;
network_state = 'r';
}
else
{
// Prepare to send the next byte.

response_index++;
}
}
Free download pdf