-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.ino
82 lines (66 loc) · 1.71 KB
/
debug.ino
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
void tPrint(char* message ){
Serial.print(message);
tft.print(message);
}
void tPrint(int message ){
Serial.print(message);
tft.print(message);
}
void tPrint(const char* message ){
Serial.print(message);
tft.print(message);
}
void tPrintln(char* message ){
Serial.println(message);
tft.println(message);
}
void tPrintln(int message ){
Serial.println(message);
tft.println(message);
}
void tPrintln(const char* message ){
Serial.println(message);
tft.println(message);
}
void tWrite(int message ){
Serial.write(message);
tft.write(message);
}
void dumpVar( char* message, int var, int type = DEC ){
Serial.print(message);
Serial.print(": ");
Serial.print(var, type);
Serial.print("\t");
}
void exposureDump(){
//dump registers relating to exposure
unsigned long t = millis();
dumpVar("ext_config", sensor.getExtConfig(), BIN);
dumpVar("busy", sensor.getBusy() );
dumpVar("manual_fr", sensor.getManualFrameRate());
dumpVar("manual_shut", sensor.getManualShutter());
dumpVar("fp", sensor.getFramePeriod(), HEX );
dumpVar("fp_min", sensor.getFramePeriodMinBound(), HEX);
dumpVar("fp_max", sensor.getFramePeriodMaxBound(), HEX );
dumpVar("shut", sensor.getShutter(), HEX );
dumpVar("shut_max", sensor.getShutterMaxBound(), HEX );
dumpVar("Δt", millis() - t );
dumpVar("me_switch", ui.me_switch );
Serial.println();
}
Stopwatch::Stopwatch(){
}
void Stopwatch::start( char* msg ){
message = msg;
//Serial.print("Starting ");
//Serial.print(message);
//Serial.println("...");
start_time = millis();
}
void Stopwatch::stop(){
long delta_time = millis() - start_time;
Serial.print(message);
Serial.print("ΔT:");
Serial.print(delta_time);
Serial.print("\t");
}