File tree Expand file tree Collapse file tree 12 files changed +53
-43
lines changed
Software/Arduino code/OpenAstroTracker Expand file tree Collapse file tree 12 files changed +53
-43
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
#include " Globals.h"
18
18
19
- String version = " V1.6.51 " ;
19
+ String version = " V1.6.52 " ;
20
20
21
21
// /////////////////////////////////////////////////////////////////////////
22
22
// Please see the Globals.h file for configuration of the firmware.
Original file line number Diff line number Diff line change @@ -140,10 +140,10 @@ class LcdButtons {
140
140
return _analogKeyValue;
141
141
}
142
142
143
- bool keyChanged (byte& newKey ) {
143
+ bool keyChanged (byte* pNewKey ) {
144
144
checkKey ();
145
145
if (_newKey != _lastNewKey) {
146
- newKey = _newKey;
146
+ *pNewKey = _newKey;
147
147
_lastNewKey = _newKey;
148
148
return true ;
149
149
}
Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ void startupIsCompleted() {
29
29
30
30
bool processStartupKeys () {
31
31
byte key;
32
- bool waitForRelease = true ;
32
+ bool waitForRelease = false ;
33
33
switch (startupState) {
34
34
case StartupIsInHomePosition: {
35
- if (lcdButtons.keyChanged (key))
35
+ if (lcdButtons.keyChanged (& key))
36
36
{
37
+ waitForRelease = true ;
37
38
if (key == btnLEFT) {
38
39
isInHomePosition = adjustWrap (isInHomePosition, 1 , YES, CANCEL);
39
40
}
@@ -88,7 +89,7 @@ bool processStartupKeys() {
88
89
}
89
90
90
91
91
- void prinStartupMenu () {
92
+ void printStartupMenu () {
92
93
93
94
switch (startupState) {
94
95
case StartupIsInHomePosition: {
Original file line number Diff line number Diff line change 1
1
#ifndef HEADLESS_CLIENT
2
2
bool processRAKeys () {
3
3
byte key;
4
- bool waitForRelease = true ;
4
+ bool waitForRelease = false ;
5
5
if (lcdButtons.currentState () == btnUP) {
6
6
if (RAselect == 0 ) mount.targetRA ().addHours (1 );
7
7
if (RAselect == 1 ) mount.targetRA ().addMinutes (1 );
8
8
if (RAselect == 2 ) mount.targetRA ().addSeconds (1 );
9
9
10
10
// slow down key repetitions
11
11
mount.delay (200 );
12
- waitForRelease = false ;
13
12
}
14
13
else if (lcdButtons.currentState () == btnDOWN) {
15
14
if (RAselect == 0 ) mount.targetRA ().addHours (-1 );
@@ -18,9 +17,9 @@ bool processRAKeys() {
18
17
19
18
// slow down key repetitions
20
19
mount.delay (200 );
21
- waitForRelease = false ;
22
20
}
23
- else if (lcdButtons.keyChanged (key)) {
21
+ else if (lcdButtons.keyChanged (&key)) {
22
+ waitForRelease = true ;
24
23
switch (key)
25
24
{
26
25
case btnLEFT: {
Original file line number Diff line number Diff line change 1
1
#ifndef HEADLESS_CLIENT
2
2
bool processDECKeys () {
3
3
byte key;
4
- bool waitForRelease = true ;
4
+ bool waitForRelease = false ;
5
5
if (lcdButtons.currentState () == btnUP) {
6
6
if (DECselect == 0 ) mount.targetDEC ().addDegrees (1 );
7
7
if (DECselect == 1 ) mount.targetDEC ().addMinutes (1 );
8
8
if (DECselect == 2 ) mount.targetDEC ().addSeconds (1 );
9
9
// slow down key repetitions
10
10
mount.delay (200 );
11
- waitForRelease = false ;
12
11
}
13
12
else if (lcdButtons.currentState () == btnDOWN) {
14
13
if (DECselect == 0 ) mount.targetDEC ().addDegrees (-1 );
15
14
if (DECselect == 1 ) mount.targetDEC ().addMinutes (-1 );
16
15
if (DECselect == 2 ) mount.targetDEC ().addSeconds (-1 );
17
16
// slow down key repetitions
18
17
mount.delay (200 );
19
- waitForRelease = false ;
20
18
}
21
- else if (lcdButtons.keyChanged (key)) {
19
+ else if (lcdButtons.keyChanged (&key)) {
20
+ waitForRelease = true ;
22
21
switch (key)
23
22
{
24
23
case btnLEFT: {
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ byte homePOI = sizeof(pointOfInterest) / sizeof(pointOfInterest[0]) - 2;
33
33
34
34
bool processPOIKeys () {
35
35
byte key;
36
- if (lcdButtons.keyChanged (key)) {
36
+ bool waitForRelease = false ;
37
+ if (lcdButtons.keyChanged (&key)) {
38
+ waitForRelease = true ;
37
39
switch (key) {
38
40
case btnSELECT: {
39
41
mount.stopSlewing (ALL_DIRECTIONS);
@@ -70,7 +72,7 @@ bool processPOIKeys() {
70
72
}
71
73
}
72
74
73
- return true ;
75
+ return waitForRelease ;
74
76
}
75
77
76
78
void printPOISubmenu () {
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ byte subGoIndex = 0;
3
3
4
4
bool processHomeKeys () {
5
5
byte key;
6
- if (lcdButtons.keyChanged (key)) {
6
+ bool waitForRelease = false ;
7
+
8
+ if (lcdButtons.keyChanged (&key)) {
9
+ waitForRelease = true ;
7
10
switch (key) {
8
11
case btnSELECT: {
9
12
if (subGoIndex == 0 ) {
@@ -29,7 +32,7 @@ bool processHomeKeys() {
29
32
}
30
33
}
31
34
32
- return true ;
35
+ return waitForRelease ;
33
36
}
34
37
35
38
void printHomeSubmenu () {
Original file line number Diff line number Diff line change 2
2
3
3
bool processHAKeys () {
4
4
byte key;
5
- bool waitForRelease = true ;
5
+ bool waitForRelease = false ;
6
6
if (lcdButtons.currentState () == btnUP) {
7
7
DayTime ha (mount.HA ());
8
8
if (HAselect == 0 ) ha.addHours (1 );
@@ -11,7 +11,6 @@ bool processHAKeys() {
11
11
12
12
// slow down key repetitions
13
13
mount.delay (200 );
14
- waitForRelease = false ;
15
14
}
16
15
else if (lcdButtons.currentState () == btnDOWN) {
17
16
DayTime ha (mount.HA ());
@@ -21,9 +20,9 @@ bool processHAKeys() {
21
20
22
21
// slow down key repetitions
23
22
mount.delay (200 );
24
- waitForRelease = false ;
25
23
}
26
- else if (lcdButtons.keyChanged (key)) {
24
+ else if (lcdButtons.keyChanged (&key)) {
25
+ waitForRelease = true ;
27
26
switch (key) {
28
27
case btnLEFT: {
29
28
HAselect = adjustWrap (HAselect, 1 , 0 , 1 );
Original file line number Diff line number Diff line change @@ -34,10 +34,12 @@ bool processKeyStateChanges(int key, int dir)
34
34
35
35
bool processControlKeys () {
36
36
byte key;
37
+ bool waitForRelease = false ;
37
38
38
39
// User must use SELECT to enter manual control.
39
40
if (!inControlMode) {
40
- if (lcdButtons.keyChanged (key)) {
41
+ if (lcdButtons.keyChanged (&key)) {
42
+ waitForRelease = true ;
41
43
if (key == btnSELECT) {
42
44
inControlMode = true ;
43
45
mount.stopSlewing (ALL_DIRECTIONS);
@@ -46,11 +48,12 @@ bool processControlKeys() {
46
48
lcdMenu.setNextActive ();
47
49
}
48
50
}
49
- return true ;
51
+ return waitForRelease ;
50
52
}
51
53
52
54
if (confirmZeroPoint) {
53
- if (lcdButtons.keyChanged (key)) {
55
+ if (lcdButtons.keyChanged (&key)) {
56
+ waitForRelease = true ;
54
57
if (key == btnSELECT) {
55
58
if (setZeroPoint) {
56
59
// Leaving Control Menu, so set stepper motor positions to zero.
@@ -79,7 +82,7 @@ bool processControlKeys() {
79
82
setZeroPoint = !setZeroPoint;
80
83
}
81
84
}
82
- return true ;
85
+ return waitForRelease ;
83
86
}
84
87
85
88
mount.loop ();
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ bool processCalibrationKeys() {
151
151
calState = HIGHLIGHT_DRIFT;
152
152
}
153
153
154
- if (checkForKeyChange && lcdButtons.keyChanged (key)) {
154
+ if (checkForKeyChange && lcdButtons.keyChanged (& key)) {
155
155
waitForRelease = true ;
156
156
157
157
switch (calState) {
You can’t perform that action at this time.
0 commit comments