From 974f1a7eb28f56221f53cedb87b505bafa02d8a5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 29 Jan 2019 11:43:15 +0100 Subject: add sysinfo application --- src/app/sysinfo/Makefile.inc | 1 + src/app/sysinfo/main.cc | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/app/sysinfo/Makefile.inc create mode 100644 src/app/sysinfo/main.cc (limited to 'src') diff --git a/src/app/sysinfo/Makefile.inc b/src/app/sysinfo/Makefile.inc new file mode 100644 index 0000000..4cc2151 --- /dev/null +++ b/src/app/sysinfo/Makefile.inc @@ -0,0 +1 @@ +loop = 1 diff --git a/src/app/sysinfo/main.cc b/src/app/sysinfo/main.cc new file mode 100644 index 0000000..a2e2660 --- /dev/null +++ b/src/app/sysinfo/main.cc @@ -0,0 +1,33 @@ +#include "arch.h" +#include "driver/gpio.h" +#include "driver/stdout.h" +#include "driver/uptime.h" + +void loop(void) +{ + static unsigned char done = 0; + + if (!done) { + kout << "sizeof(char) = " << sizeof(char) << endl; + kout << "sizeof(short) = " << sizeof(short) << endl; + kout << "sizeof(int) = " << sizeof(int) << endl; + kout << "sizeof(long int) = " << sizeof(long int) << endl; + kout << "sizeof(long long) = " << sizeof(long long) << endl; + kout << "sizeof(float) = " << sizeof(float) << endl; + kout << "sizeof(double) = " << sizeof(double) << endl; + done = 1; + } +} + +int main(void) +{ + arch.setup(); + gpio.setup(); + kout.setup(); + + kout << "Hello, World!" << endl; + + arch.idle_loop(); + + return 0; +} -- cgit v1.2.3