Skip to content

Commit 0914f2a

Browse files
Renamed HEADLESS_CLIENT to DISPLAY_TYPE
1 parent f9e5f7d commit 0914f2a

22 files changed

+56
-61
lines changed

.github/workflows/platformio.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
name: ${{ matrix.board }} STEPPER=${{ matrix.stepper }} DRIVER=${{ matrix.driver }} GPS=${{ matrix.gps }} GYRO=${{ matrix.gyro }} ALTAZ=${{ matrix.azalt }} HEADLESS=${{ matrix.headless }}
13+
name: ${{ matrix.board }} STEPPER=${{ matrix.stepper }} DRIVER=${{ matrix.driver }} GPS=${{ matrix.gps }} GYRO=${{ matrix.gyro }} ALTAZ=${{ matrix.azalt }} DISPLAY=${{ matrix.display }}
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
@@ -20,7 +20,7 @@ jobs:
2020
gps: [0, 1]
2121
gyro: [0, 1]
2222
azalt: [0, 1]
23-
headless: [0, 1]
23+
display: [0, 1]
2424
exclude:
2525
- { stepper: 1, driver: 0 } # NEMA17 & ULN2003
2626
- { stepper: 0, driver: 1 } # 28BYJ48 & GENERIC
@@ -50,4 +50,4 @@ jobs:
5050
-D USE_GPS=${{ matrix.gps }}
5151
-D USE_GYRO_LEVEL=${{ matrix.gyro }}
5252
-D AZIMUTH_ALTITUDE_MOTORS=${{ matrix.azalt }}
53-
-D HEADLESS_CLIENT=${{ matrix.headless }}
53+
-D DISPLAY_TYPE=${{ matrix.display }}

Software/Arduino code/OpenAstroTracker/Configuration.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
#define NORTHERN_HEMISPHERE 1
4141
#endif
4242

43+
// Used display
44+
#ifndef DISPLAY_TYPE
45+
#define DISPLAY_TYPE DISPLAY_TYPE_LCD_KEYPAD
46+
#endif
47+
4348
// Used RA wheel version. Unless you printed your OAT before March 2020, you're using
4449
// a version 2 or higher (software only differentiates between 1 and more than 1)
4550
#ifndef RA_WHEEL_VERSION

Software/Arduino code/OpenAstroTracker/Configuration_adv.hpp

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
#include "Configuration.hpp"
44

5+
/**
6+
* This file contains advanced configurations. Edit values here only if you know what you are doing. Invalid values
7+
* can lead to OAT misbehaving very bad and in worst case could even lead to hardware damage. The default values here
8+
* were chosen after many tests and can are currently concidered to work the best.
9+
**/
10+
511
// This is how many steps your stepper needs for a full rotation.
612
#if RA_STEPPER_TYPE == STEPPER_TYPE_28BYJ48
713
#define RA_STEPPER_SPR 4096 // 28BYJ-48 = 4096 | NEMA 0.9° = 400 | NEMA 1.8° = 200
@@ -122,20 +128,6 @@
122128
#define DISPLAY_UPDATE_TIME 200
123129

124130

125-
////////////////////////////
126-
//
127-
// HEADLESS CLIENT
128-
// If you do not have a LCD shield on your Arduino Mega, set this to 1 on the line below. This is
129-
// useful if you are always going to run the mount from a laptop anyway.
130-
#ifndef HEADLESS_CLIENT
131-
#define HEADLESS_CLIENT 0
132-
#endif
133-
134-
#ifdef __AVR_ATmega328P__ // UNO must use headless
135-
#undef HEADLESS_CLIENT
136-
#define HEADLESS_CLIENT 1
137-
#endif
138-
139131
////////////////////////////
140132
//
141133
// LCD BUTTON TEST
@@ -160,7 +152,8 @@
160152
#define ALTITUDE_ARC_SECONDS_PER_STEP (0.61761f)
161153
#define ALTITUDE_STEPS_PER_ARC_MINUTE (60.0f/ALTITUDE_ARC_SECONDS_PER_STEP)
162154

163-
#if HEADLESS_CLIENT == 0 // <-- Ignore this line
155+
#if DISPLAY_TYPE > 0
156+
164157
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
165158
// ///
166159
// FEATURE SUPPORT SECTION ///
@@ -171,9 +164,6 @@
171164
// and disable features to help manage memory usage.
172165
// If you run the tracker with an Arduino Mega, you can set all the features to 1.
173166
//
174-
// If you would like to drive your OAT mount with only the LCD Shield, or are on a Uno,
175-
// you should set SUPPORT_SERIAL_CONTROL to 0
176-
//
177167
// If you feel comfortable with configuring the OAT at startup manually, you should set
178168
// SUPPORT_GUIDED_STARTUP to 0 (maybe after you've used it for a while you know what to do).
179169
//
@@ -197,14 +187,17 @@
197187
// Set this to 1 to support INFO menu that displays various pieces of information about the mount.
198188
#define SUPPORT_INFO_DISPLAY 1
199189

200-
// Set this to 1 to support Serial Meade LX200 protocol support
201-
#define SUPPORT_SERIAL_CONTROL 1
202-
203-
#endif // HEADLESS_CLIENT <-- Ignore this
190+
#endif // DISPLAY_TYPE
204191

192+
// Enable Meade protocol communication over serial
193+
#ifdef __AVR_ATmega328P__
194+
#define SUPPORT_SERIAL_CONTROL 0
195+
#else
196+
#define SUPPORT_SERIAL_CONTROL 1
197+
#endif
205198

206199

207-
#if defined(ESP8266) || defined(ESP32) // <-- ignore this line
200+
#if defined(ESP8266) || defined(ESP32)
208201
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
209202
// //////////
210203
// WIFI SETTINGS //////////
@@ -214,8 +207,8 @@
214207
//
215208
// Define some things, dont change: ///
216209
#define ESPBOARD
217-
#undef HEADLESS_CLIENT
218-
#define HEADLESS_CLIENT 1
210+
#undef DISPLAY_TYPE
211+
#define DISPLAY_TYPE DISPLAY_TYPE_NONE
219212
// #define BLUETOOTH_ENABLED
220213
#define WIFI_ENABLED
221214
#if defined(ESP8266)
@@ -306,15 +299,6 @@
306299
#error "Sorry, Arduino Uno only supports 28BYJ48 steppers."
307300
#endif
308301

309-
310-
311-
////////////////////////////
312-
// Misc stuff, ignore
313-
314-
#if HEADLESS_CLIENT == 1
315-
#define SUPPORT_SERIAL_CONTROL 1
316-
#endif
317-
318302
// Set this to 1 this to enable the heating menu
319303
// NOTE: Heating is currently not supported!
320304
#define SUPPORT_HEATING 0

Software/Arduino code/OpenAstroTracker/Constants.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
#pragma once
22

33
/*
4-
* This file contains constants that should not be changed.
4+
* This file contains constants that SHOULD NOT BE CHANGED by oat users!
5+
* If you are a developer and want to add new hardware support, add a
6+
* proper definition here with increased value.
57
*/
68

7-
// Supported stepper models, do not modify these values.
9+
// Supported display types
10+
#define DISPLAY_TYPE_NONE 0
11+
#define DISPLAY_TYPE_LCD_KEYPAD 1
12+
13+
// Supported stepper models
814
#define STEPPER_TYPE_28BYJ48 0
915
#define STEPPER_TYPE_NEMA17 1
1016

11-
// Supported stepper driver models, do not modify these values.
17+
// Supported stepper driver models
1218
#define DRIVER_TYPE_ULN2003 0
1319
#define DRIVER_TYPE_GENERIC 1
1420
#define DRIVER_TYPE_TMC2209_STANDALONE 2

Software/Arduino code/OpenAstroTracker/src/LcdMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "EPROMStore.hpp"
33
#include "LcdMenu.hpp"
44

5-
#if HEADLESS_CLIENT == 0
5+
#if DISPLAY_TYPE > 0
66

77
// Class that drives the LCD screen with a menu
88
// You add a string and an id item and this class handles the display and navigation

Software/Arduino code/OpenAstroTracker/src/LcdMenu.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _LCDMENU_HPP_
33

44
#include <Arduino.h>
5-
#if HEADLESS_CLIENT == 0
5+
#if DISPLAY_TYPE > 0
66
#include <LiquidCrystal.h>
77
#endif
88
#include "../Configuration_adv.hpp"
@@ -77,7 +77,7 @@ class LcdMenu {
7777
void printChar(char ch);
7878

7979
private:
80-
#if HEADLESS_CLIENT == 0
80+
#if DISPLAY_TYPE > 0
8181
LiquidCrystal _lcd; // The LCD screen that we'll display the menu on
8282
MenuItem** _menuItems; // The first menu item (linked list)
8383
byte _numMenuItems;

Software/Arduino code/OpenAstroTracker/src/Mount.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,7 @@ void Mount::moveSteppersTo(float targetRA, float targetDEC) {
22592259
//
22602260
/////////////////////////////////
22612261
void Mount::displayStepperPosition() {
2262-
#if HEADLESS_CLIENT == 0
2262+
#if DISPLAY_TYPE > 0
22632263

22642264
String disp;
22652265

@@ -2323,7 +2323,7 @@ void Mount::displayStepperPosition() {
23232323
//
23242324
/////////////////////////////////
23252325
void Mount::displayStepperPositionThrottled() {
2326-
#if HEADLESS_CLIENT == 0
2326+
#if DISPLAY_TYPE > 0
23272327
long elapsed = millis() - _lastDisplayUpdate;
23282328
if (elapsed > DISPLAY_UPDATE_TIME) {
23292329
displayStepperPosition();

Software/Arduino code/OpenAstroTracker/src/Mount.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _MOUNT_HPP_
22
#define _MOUNT_HPP_
33

4-
#if HEADLESS_CLIENT == 0
4+
#if DISPLAY_TYPE > 0
55
#include <LiquidCrystal.h>
66
#endif
77

Software/Arduino code/OpenAstroTracker/src/a_inits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <AccelStepper.h>
4-
#if HEADLESS_CLIENT == 0
4+
#if DISPLAY_TYPE > 0
55
#include <LiquidCrystal.h>
66
#endif
77
#include "inc/Globals.hpp"

Software/Arduino code/OpenAstroTracker/src/b_setup.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void finishSetup()
191191
lcdMenu.setCursor(5, 1);
192192
lcdMenu.printMenu(VERSION);
193193

194-
#if HEADLESS_CLIENT == 0
194+
#if DISPLAY_TYPE > 0
195195
// Check for EEPROM reset (Button down during boot)
196196
if (lcdButtons.currentState() == btnDOWN){
197197
LOGV1(DEBUG_INFO, F("Erasing configuration in EEPROM!"));
@@ -278,7 +278,7 @@ void finishSetup()
278278
LOGV1(DEBUG_ANY, F("Start Tracking..."));
279279
mount.startSlewing(TRACKING);
280280

281-
#if HEADLESS_CLIENT == 0
281+
#if DISPLAY_TYPE > 0
282282
LOGV1(DEBUG_ANY, F("Setup menu system..."));
283283

284284
// Create the LCD top-level menu items

0 commit comments

Comments
 (0)