projects
/
rpikern
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
testing minimal program
[rpikern]
/
src
/
main.c
1
#include "config.h"
2
3
#include <string.h>
4
#include <stdint.h>
5
#include "asm.h"
6
#include "serial.h"
7
8
void dbgled(int x);
9
void exit(int x);
10
11
int main(void)
12
{
13
disable_intr();
14
15
dbgled(2);
16
17
init_serial(115200);
18
ser_printstr("starting rpkern\n");
19
20
for(;;) {
21
int c = ser_getchar();
22
if(c == -1) {
23
ser_printstr("error!\n");
24
} else {
25
ser_printstr("got: ");
26
ser_putchar(c);
27
ser_putchar('\r');
28
ser_putchar('\n');
29
}
30
}
31
32
return 0;
33
}
34
35
void panic(void)
36
{
37
dbgled(1);
38
exit(0);
39
}