Skip to content

Commit

Permalink
Merge pull request #2 from tainfante/master
Browse files Browse the repository at this point in the history
updated sending data
  • Loading branch information
opetany93 authored Jan 21, 2018
2 parents d4438bf + 55eed5e commit 8a42500
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 @@ -108,14 +108,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 8a42500

Please sign in to comment.