23 lines
		
	
	
		
			306 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			306 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include "sys.h"
 | |
| 
 | |
| int strlen(const char* str) {
 | |
|   int i = 0;
 | |
|   while(str[i] != '\0') {
 | |
|     i++;
 | |
|   }
 | |
|   return i;
 | |
| }
 | |
| 
 | |
| void log(const char* stuff) {
 | |
|   uart_writen(uart0, stuff, strlen(stuff));
 | |
| }
 | |
| 
 | |
| int main() {
 | |
|   led0->output = 37;
 | |
| 
 | |
|   while(1) {
 | |
|     uint8_t c = uart_read(uart0);
 | |
|     uart_write(uart0, c);
 | |
|   }
 | |
| }
 |