Skip to content

Commit b119b47

Browse files
V1.13.3 Updates (#243)
1 parent 8158353 commit b119b47

15 files changed

+1239
-38
lines changed

Changelog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
**V1.13.3 - Updates**
2+
- Allowed ALT steps per revolution to be set directly
3+
- Removed drift alignment and added ability to add it back with define
4+
- Optimized string memory a little
5+
- Lowered ESP32 second core priority
6+
- Added support for informational display
7+
18
**V1.13.2 - Updates**
2-
- Fix for RA steps being incrrectly set on every boot.
9+
- Fix for RA steps being incorrectly set on every boot.
310

411
**V1.13.1 - Updates**
512
- Fix for uploading on AVR platform. Apparently [email protected] (current stable) is broken and can't upload, so we peg it at [email protected] for now.

Configuration.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@
6161
#define DISPLAY_TYPE DISPLAY_TYPE_NONE
6262
#endif
6363

64+
#ifndef INFO_DISPLAY_TYPE
65+
#define INFO_DISPLAY_TYPE INFO_DISPLAY_TYPE_NONE
66+
#elif (INFO_DISPLAY_TYPE == INFO_DISPLAY_TYPE_I2C_SSD1306_128x64)
67+
#ifndef INFO_DISPLAY_I2C_ADDRESS
68+
#define INFO_DISPLAY_I2C_ADDRESS 0x3C
69+
#endif
70+
#ifndef INFO_DISPLAY_I2C_SDA_PIN
71+
#define INFO_DISPLAY_I2C_SDA_PIN 5
72+
#endif
73+
#ifndef INFO_DISPLAY_I2C_SCL_PIN
74+
#define INFO_DISPLAY_I2C_SCL_PIN 4
75+
#endif
76+
#endif
77+
6478
// Used RA wheel version. Unless you printed your OAT before March 2020, you're using
6579
// a version 2 or higher (software only differentiates between 1 and more than 1)
6680
#ifndef RA_WHEEL_VERSION

ConfigurationValidation.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
#error Unsupported display configuration. Use at own risk.
3535
#endif
3636

37+
// Info Display validations
38+
#if defined(__AVR_ATmega2560__)
39+
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
40+
#if (DISPLAY_TYPE != DISPLAY_TYPE_NONE)
41+
#error Unsupported configuration. Not enough memory to use LCD and OLED at the same time.
42+
#endif
43+
#if (FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE)
44+
#if (BOARD == BOARD_AVR_MKS_GEN_L_V1) || (BOARD == BOARD_AVR_MKS_GEN_L_V2) || (BOARD == BOARD_AVR_MKS_GEN_L_V21)
45+
#warning OLED requires I2C, so E1 port on a MKS GenL is not available. Make sure you are not attempting to use it.
46+
#endif
47+
#endif
48+
#endif
49+
#endif
50+
3751
#if (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
3852
#ifndef RA_DRIVER_ADDRESS
3953
// Serial bus address must be specified for TMC2209 in UART mode

Configuration_adv.hpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
#ifndef RA_SLEW_MICROSTEPPING
7070
#define RA_SLEW_MICROSTEPPING 8 // Microstep mode set by MS pin strapping. Use the same microstep mode for both slewing & tracking
7171
#endif
72+
#if defined(RA_TRACKING_MICROSTEPPING) && (RA_TRACKING_MICROSTEPPING != RA_SLEW_MICROSTEPPING)
73+
#error With A4988 drivers or TMC2209 drivers in Standalone mode, RA microstepping must be the same for slewing and tracking. Delete RA_TRACKING_MICROSTEPPING from your config.
74+
#endif
7275
#define RA_TRACKING_MICROSTEPPING RA_SLEW_MICROSTEPPING
7376
#else
7477
#error Unknown RA driver type
@@ -89,6 +92,9 @@
8992
#define DEC_SLEW_MICROSTEPPING \
9093
16 // Only UART drivers support dynamic switching. Use the same microstep mode for both slewing & guiding
9194
#endif
95+
#if defined(DEC_GUIDE_MICROSTEPPING) && (DEC_GUIDE_MICROSTEPPING != DEC_SLEW_MICROSTEPPING)
96+
#error With A4988 drivers or TMC2209 drivers in Standalone mode, DEC microstepping must be the same for slewing and guiding. Delete DEC_GUIDE_MICROSTEPPING from your config.
97+
#endif
9298
#define DEC_GUIDE_MICROSTEPPING DEC_SLEW_MICROSTEPPING
9399
#else
94100
#error Unknown DEC driver type
@@ -399,10 +405,11 @@
399405
// the ratio of the ALT gearbox for AutoPA V2 (40:1)
400406
#define ALT_WORMGEAR_RATIO (40.0f)
401407
#endif
402-
403-
#define ALTITUDE_STEPS_PER_REV \
404-
(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \
405-
* ALT_WORMGEAR_RATIO) // Actually u-steps/rev
408+
#ifndef ALTITUDE_STEPS_PER_REV
409+
#define ALTITUDE_STEPS_PER_REV \
410+
(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \
411+
* ALT_WORMGEAR_RATIO) // Actually u-steps/rev
412+
#endif
406413
#endif
407414

408415
#ifndef ALTITUDE_STEPS_PER_ARC_MINUTE
@@ -549,6 +556,8 @@
549556
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
550557
// ///
551558
// FEATURE SUPPORT SECTION ///
559+
// FOR MOUNTS WITH ///
560+
// LCD DISPLAY ///
552561
// ///
553562
//////////////////////////////
554563
//
@@ -589,7 +598,10 @@
589598
#define SUPPORT_MANUAL_CONTROL 0
590599
#define SUPPORT_CALIBRATION 0
591600
#define SUPPORT_INFO_DISPLAY 0
592-
601+
#if SUPPORT_DRIFT_ALIGNMENT == 1
602+
#error "Drift Alignment is only available with a display."
603+
#endif
604+
#define SUPPORT_DRIFT_ALIGNMENT 0
593605
#endif // DISPLAY_TYPE
594606

595607
// Enable Meade protocol communication over serial

Constants.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define BOARD_ESP32_ESP32DEV 1001
2121

2222
/**
23-
* Supported display types. Use one of these values for DISPLAY_TYPE configuration matching your used display.
23+
* Supported keypad/display types. Use one of these values for DISPLAY_TYPE configuration matching your used display and keypad.
2424
*
2525
* DISPLAY_TYPE_NONE: No display. Use this if you don't use any display.
2626
* DISPLAY_TYPE_LCD_KEYPAD: 1602 LCD Keypad shield which can be mounted directly to an Arduino UNO / Mega boards.
@@ -39,6 +39,16 @@
3939
#define DISPLAY_TYPE_LCD_KEYPAD_I2C_MCP23017 3
4040
#define DISPLAY_TYPE_LCD_JOY_I2C_SSD1306 4
4141

42+
/**
43+
* Supported info display types. Use one of these values for INF_DISPLAY_TYPE configuration matching your used display.
44+
*
45+
* INFO_DISPLAY_TYPE_NONE: No display. Use this if you don't use any display.
46+
* INFO_DISPLAY_TYPE_SSD1306_I2C_128x64: I2C 128x64 OLED display module with SSD1306 controller, attached via I2C
47+
* Amazon: https://www.amazon.com/dp/B06XRBTBTB?_encoding=UTF8&psc=1&ref_=cm_sw_r_cp_ud_dp_DQCWKZ7YB40X84RZSHJ0
48+
**/
49+
#define INFO_DISPLAY_TYPE_NONE 0
50+
#define INFO_DISPLAY_TYPE_I2C_SSD1306_128x64 1
51+
4252
// Supported stepper models
4353
#define STEPPER_TYPE_NONE -1
4454
#define STEPPER_TYPE_ENABLED 1
@@ -81,4 +91,5 @@
8191
#define DEBUG_GPS 0x0800 // GPS activity
8292
#define DEBUG_FOCUS 0x1000 // Focuser activity
8393
#define DEBUG_COORD_CALC 0x2000 // Calculations of coordinates
94+
#define DEBUG_DISPLAY 0x4000 // Info display
8495
#define DEBUG_ANY 0xFFFF // All debug output

Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// Also, numbers are interpreted as simple numbers. _ __ _
44
// So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/
55

6-
#define VERSION "V1.13.2"
6+
#define VERSION "V1.13.3"

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ lib_deps =
1313
arduino-libraries/LiquidCrystal @ ^1.0.7
1414
lincomatic/LiquidTWI2@^1.2.7
1515
olikraus/U8g2@^2.28.8
16+
https://github.com/ClutchplateDude/[email protected]
1617

1718
[env]
1819
extra_scripts =
@@ -71,7 +72,6 @@ debug_init_break =
7172
; Always upload firmware when initializing a debug session
7273
debug_load_mode = always
7374

74-
7575
[env:ramps]
7676
extends = common_embedded
7777
; [email protected] is currently broken (can't upload, gets stk500v2_recv errors)

src/InfoDisplayRender.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
#include <Arduino.h>
3+
4+
class Mount;
5+
6+
// Base class to implement a
7+
class InfoDisplayRender
8+
{
9+
public:
10+
InfoDisplayRender() {};
11+
12+
virtual void init() {};
13+
virtual void render(Mount *mount) {};
14+
virtual void setConsoleMode(bool active) {};
15+
virtual int addConsoleText(String text, bool tinyFont = true);
16+
virtual void updateConsoleText(int line, String newText);
17+
};

src/MeadeCommandProcessor.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
640640
//
641641
// :XDnnn#
642642
// Description:
643-
// Run drift alignment
643+
// Run drift alignment (only supported if SUPPORT_DRIFT_ALIGNMENT is enabled)
644644
// Information:
645645
// This runs a drift alignment procedure where the mounts slews east, pauses, slews west and pauses.
646646
// Where nnn is the number of seconds the entire alignment should take. The call is blocking and will
@@ -1450,7 +1450,7 @@ String MeadeCommandProcessor::handleMeadeSetInfo(String inCmd)
14501450
SC: Calendar: If the date is valid 2 <string>s are returned, each string is 31 bytes long.
14511451
The first is: "Updating planetary data#" followed by a second string of 30 spaces terminated by '#'
14521452
*/
1453-
return "1Updating Planetary Data# #"; //
1453+
return F("1Updating Planetary Data# #"); //
14541454
}
14551455
else
14561456
{
@@ -1654,7 +1654,7 @@ String MeadeCommandProcessor::handleMeadeDistance(String inCmd)
16541654
/////////////////////////////
16551655
String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd)
16561656
{
1657-
// 0123
1657+
#if SUPPORT_DRIFT_ALIGNMENT == 1
16581658
// :XDmmm
16591659
if (inCmd[0] == 'D') // :XD
16601660
{ // Drift Alignemnt
@@ -1682,7 +1682,9 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd)
16821682
_lcdMenu->setCursor(0, 1);
16831683
_mount->startSlewing(TRACKING);
16841684
}
1685-
else if (inCmd[0] == 'G')
1685+
else
1686+
#endif
1687+
if (inCmd[0] == 'G')
16861688
{ // Get RA/DEC steps/deg, speedfactor
16871689
if (inCmd[1] == 'R') // :XGR#
16881690
{
@@ -2131,6 +2133,7 @@ String MeadeCommandProcessor::processCommand(String inCmd)
21312133
LOG(DEBUG_MEADE, "[MEADE]: Processing command '%s'", inCmd.c_str());
21322134
char command = inCmd[1];
21332135
inCmd = inCmd.substring(2);
2136+
_mount->commandReceived();
21342137
switch (command)
21352138
{
21362139
case 'S':

0 commit comments

Comments
 (0)