aboutsummaryrefslogtreecommitdiff
path: root/usr/cxx.cpp
blob: beeef80e477f8e120e9e448d287788d36f8e2dc8 (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
25
26
27
28
29
30
extern "C" {
#include <graphics/lfb.h>
#include <usr/string.h>
#include <drivers/uart.h>
};

class Substation {
	public:
		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)
{
	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);
	uart_string(start);
}