static void main_put_char(char data)
{
    while(!uart0_tx_byte((u8_t)data))
    {
        ;
    }
}
Example #2
0
File: gsm.c Project: dpmjoshi/ARM7
void gsm_responce(void)
{
  U8 uc_temp_byte = 0;
  U8 uc_count = 0;
  U8 uc_recv_resp[10];
  VICIntEnClr |= (1 << UART0_CHANNEL_NO);
  while(uc_temp_byte != '\r')
  {
  	uc_temp_byte = uart1_rx_byte();
	uart0_tx_byte(uc_temp_byte + 0x26);
  }
  while(uc_temp_byte != '\n')
  {
	uc_temp_byte = uart1_rx_byte();
	uart0_tx_byte(uc_temp_byte + 0x26);
	uc_recv_resp[uc_count] = uc_temp_byte;
	uc_count++;
  }
    VICIntEnable |= (1 << UART0_CHANNEL_NO);
}
Example #3
0
/**
 *  Function to send a byte.
 *  
 *  Every carriage return ("\n") will be intercepted and replaced with a
 *  carriage return, new line sequence ("\r\n").
 */
static int printf_put_char(char data, FILE *stream)
{
    // Recursive function to prepend a carriage return before a new line character
    if(data == '\n')
    {
        printf_put_char('\r',stream);
    }

    // Send character over UART0 and make sure it is buffered
    while(!uart0_tx_byte((uint8)data))
    {
        ;
    }   

    return 0;
}