Skip to content

Commit

Permalink
updated sending data
Browse files Browse the repository at this point in the history
  • Loading branch information
tainfante committed Jan 21, 2018
1 parent 367e3d4 commit 55eed5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,19 @@ int main()

//time - 36 bits result

uint16_t receivedData;

alt_putstr("KCC Project!\n");

// register the timer irq to be serviced by handle_timer_interrupt() function
// alt_irq_register(SYS_TIMER_IRQ, 0, handle_timer_interrupt);

while (1)
{
SendLong(time);
receivedData=ReceiveData();
if(receivedData==66){
SendLong(time);
}

PIO_SetBit(LED_PORT, LED_0);
delayMs(400);
Expand Down
5 changes: 5 additions & 0 deletions src/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ static void sendByte(char byte)
IOWR_ALT_UP_RS232_DATA(UART_0_BASE, byte);
}

uint16_t ReceiveData(USART_TypeDef* USARTx){

IORD_ALT_UP_RS232_DATA(UART_0_BASE);
}

void sendStrig(char* s)
{
while(*s)
Expand Down

0 comments on commit 55eed5e

Please sign in to comment.