Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "myorca_uart.h"
// Main must be the first function body in this file
int main(void)
{
static int data1 = 20;
static int data2 = 5;
static int result;
result = data1 * data2;
// Store the value in a6
asm volatile("mv a6,%0\n\t"
"rdtime a5"
:
: "r" (result)
: "a6");
uart_printf("M\r\n");
unsigned int uart_send_fifo_count = uart_get_send_fifo_count();
unsigned int uart_read_fifo_count = 0;
while (1) {
wait(1000);
uart_read_fifo_count = uart_get_read_fifo_count();
if (uart_read_fifo_count > 0) {
char read_value = uart_read_char();
uart_printf("Received value from Uart: (");
uart_printc(read_value);
uart_printf(").\r\n");
}
}
return 0;
}