aboutsummaryrefslogtreecommitdiff
path: root/usr/cxx.cpp
blob: 0c41cca8b9b709e92c27521f904acbb2eb90fe99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
}