66#define StartupPoleConfirmed 10
77#define StartupCompleted 20
88
9+ #define YES 1
10+ #define NO 2
11+ #define CANCEL 3
12+
913int startupState = StartupIsPointedAtPole;
10- int isAtPole = 1 ;
14+ int isAtPole = NO ;
1115
1216
1317void startupIsCompleted () {
@@ -26,13 +30,13 @@ void processStartupKeys(int key) {
2630 case StartupIsPointedAtPole:
2731 {
2832 if (key == btnLEFT) {
29- isAtPole = adjustWrap (isAtPole, 1 , 0 , 2 );
33+ isAtPole = adjustWrap (isAtPole, 1 , YES, CANCEL );
3034 }
3135 else if (key == btnSELECT) {
32- if (isAtPole == 1 ) { // Yes
36+ if (isAtPole == YES ) {
3337 startupState = StartupSetHATime;
3438 }
35- else if (isAtPole == 0 ) { // No
39+ else if (isAtPole == NO ) {
3640 startupState = StartupWaitForPoleCompletion;
3741 inStartup = false ;
3842 lcdMenu.setCursor (0 , 0 );
@@ -42,7 +46,7 @@ void processStartupKeys(int key) {
4246 // Skip the 'Manual control' prompt
4347 inControlMode = true ;
4448 }
45- else if (isAtPole == 2 ) { // Cancel
49+ else if (isAtPole == CANCEL ) {
4650 startupIsCompleted ();
4751 }
4852 }
@@ -68,7 +72,7 @@ void processStartupKeys(int key) {
6872 break ;
6973
7074 case StartupPoleConfirmed: {
71- isAtPole = true ;
75+ isAtPole = YES ;
7276
7377 // Ask again to confirm
7478 startupState = StartupIsPointedAtPole;
@@ -85,15 +89,15 @@ void prinStartupMenu() {
8589 {
8690 // 0123456789012345
8791 String choices (" Yes No Cancl " );
88- if (isAtPole == 1 ) {
92+ if (isAtPole == YES ) {
8993 choices.setCharAt (0 , ' >' );
9094 choices.setCharAt (4 , ' <' );
9195 }
92- if (isAtPole == 0 ) {
96+ if (isAtPole == NO ) {
9397 choices.setCharAt (5 , ' >' );
9498 choices.setCharAt (8 , ' <' );
9599 }
96- if (isAtPole == 2 ) {
100+ if (isAtPole == CANCEL ) {
97101 choices.setCharAt (9 , ' >' );
98102 choices.setCharAt (15 , ' <' );
99103 }
0 commit comments