diff options
Diffstat (limited to 'usr/cxx.cpp')
-rw-r--r-- | usr/cxx.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/usr/cxx.cpp b/usr/cxx.cpp index 0c41cca..2240d25 100644 --- a/usr/cxx.cpp +++ b/usr/cxx.cpp @@ -1,24 +1,28 @@ extern "C" { -#include <drivers/uart.h> +#include <graphics/lfb.h> +#include <usr/string.h> }; -class TestClass { +class Substation { public: - unsigned long value; - TestClass(unsigned long v) { - value = v; - } - void increment() { - value++; - } - void increment(unsigned long v) { - value += v; + unsigned long temperature; + unsigned long critical_temperature; + unsigned long current_production; + unsigned long max_production; + unsigned long current_load; + Substation(unsigned long ct, unsigned long mp) { + temperature = 0; + current_production = 0; + current_load = 0; + critical_temperature = ct; + max_production = mp; } }; extern "C" void cpp_demo(unsigned long v) { - TestClass tc = TestClass(v); - tc.increment(); - uart_hexn(tc.value); + Substation s = Substation(120000+10*v, 95000000 - 23*v); + char str[14]; + char* start = ulong_to_string(s.max_production, str); + draw_string(0, 15, start); } |