diff options
Diffstat (limited to 'usr/cxx.cpp')
-rw-r--r-- | usr/cxx.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/usr/cxx.cpp b/usr/cxx.cpp new file mode 100644 index 0000000..0c41cca --- /dev/null +++ b/usr/cxx.cpp @@ -0,0 +1,24 @@ +extern "C" { +#include <drivers/uart.h> +}; + +class TestClass { + public: + unsigned long value; + TestClass(unsigned long v) { + value = v; + } + void increment() { + value++; + } + void increment(unsigned long v) { + value += v; + } +}; + +extern "C" void cpp_demo(unsigned long v) +{ + TestClass tc = TestClass(v); + tc.increment(); + uart_hexn(tc.value); +} |