Skip to content

Commit

Permalink
V1.13.3 Updates (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClutchplateDude authored May 12, 2024
1 parent 8158353 commit b119b47
Show file tree
Hide file tree
Showing 15 changed files with 1,239 additions and 38 deletions.
9 changes: 8 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
**V1.13.3 - Updates**
- Allowed ALT steps per revolution to be set directly
- Removed drift alignment and added ability to add it back with define
- Optimized string memory a little
- Lowered ESP32 second core priority
- Added support for informational display

**V1.13.2 - Updates**
- Fix for RA steps being incrrectly set on every boot.
- Fix for RA steps being incorrectly set on every boot.

**V1.13.1 - Updates**
- 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.
Expand Down
14 changes: 14 additions & 0 deletions Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@
#define DISPLAY_TYPE DISPLAY_TYPE_NONE
#endif

#ifndef INFO_DISPLAY_TYPE
#define INFO_DISPLAY_TYPE INFO_DISPLAY_TYPE_NONE
#elif (INFO_DISPLAY_TYPE == INFO_DISPLAY_TYPE_I2C_SSD1306_128x64)
#ifndef INFO_DISPLAY_I2C_ADDRESS
#define INFO_DISPLAY_I2C_ADDRESS 0x3C
#endif
#ifndef INFO_DISPLAY_I2C_SDA_PIN
#define INFO_DISPLAY_I2C_SDA_PIN 5
#endif
#ifndef INFO_DISPLAY_I2C_SCL_PIN
#define INFO_DISPLAY_I2C_SCL_PIN 4
#endif
#endif

// Used RA wheel version. Unless you printed your OAT before March 2020, you're using
// a version 2 or higher (software only differentiates between 1 and more than 1)
#ifndef RA_WHEEL_VERSION
Expand Down
14 changes: 14 additions & 0 deletions ConfigurationValidation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@
#error Unsupported display configuration. Use at own risk.
#endif

// Info Display validations
#if defined(__AVR_ATmega2560__)
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
#if (DISPLAY_TYPE != DISPLAY_TYPE_NONE)
#error Unsupported configuration. Not enough memory to use LCD and OLED at the same time.
#endif
#if (FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE)
#if (BOARD == BOARD_AVR_MKS_GEN_L_V1) || (BOARD == BOARD_AVR_MKS_GEN_L_V2) || (BOARD == BOARD_AVR_MKS_GEN_L_V21)
#warning OLED requires I2C, so E1 port on a MKS GenL is not available. Make sure you are not attempting to use it.
#endif
#endif
#endif
#endif

#if (RA_DRIVER_TYPE == DRIVER_TYPE_TMC2209_UART)
#ifndef RA_DRIVER_ADDRESS
// Serial bus address must be specified for TMC2209 in UART mode
Expand Down
22 changes: 17 additions & 5 deletions Configuration_adv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
#ifndef RA_SLEW_MICROSTEPPING
#define RA_SLEW_MICROSTEPPING 8 // Microstep mode set by MS pin strapping. Use the same microstep mode for both slewing & tracking
#endif
#if defined(RA_TRACKING_MICROSTEPPING) && (RA_TRACKING_MICROSTEPPING != RA_SLEW_MICROSTEPPING)
#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.
#endif
#define RA_TRACKING_MICROSTEPPING RA_SLEW_MICROSTEPPING
#else
#error Unknown RA driver type
Expand All @@ -89,6 +92,9 @@
#define DEC_SLEW_MICROSTEPPING \
16 // Only UART drivers support dynamic switching. Use the same microstep mode for both slewing & guiding
#endif
#if defined(DEC_GUIDE_MICROSTEPPING) && (DEC_GUIDE_MICROSTEPPING != DEC_SLEW_MICROSTEPPING)
#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.
#endif
#define DEC_GUIDE_MICROSTEPPING DEC_SLEW_MICROSTEPPING
#else
#error Unknown DEC driver type
Expand Down Expand Up @@ -399,10 +405,11 @@
// the ratio of the ALT gearbox for AutoPA V2 (40:1)
#define ALT_WORMGEAR_RATIO (40.0f)
#endif

#define ALTITUDE_STEPS_PER_REV \
(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \
* ALT_WORMGEAR_RATIO) // Actually u-steps/rev
#ifndef ALTITUDE_STEPS_PER_REV
#define ALTITUDE_STEPS_PER_REV \
(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / (ALT_PULLEY_TEETH * GT2_BELT_PITCH)) * ALT_STEPPER_SPR * ALT_MICROSTEPPING \
* ALT_WORMGEAR_RATIO) // Actually u-steps/rev
#endif
#endif

#ifndef ALTITUDE_STEPS_PER_ARC_MINUTE
Expand Down Expand Up @@ -549,6 +556,8 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ///
// FEATURE SUPPORT SECTION ///
// FOR MOUNTS WITH ///
// LCD DISPLAY ///
// ///
//////////////////////////////
//
Expand Down Expand Up @@ -589,7 +598,10 @@
#define SUPPORT_MANUAL_CONTROL 0
#define SUPPORT_CALIBRATION 0
#define SUPPORT_INFO_DISPLAY 0

#if SUPPORT_DRIFT_ALIGNMENT == 1
#error "Drift Alignment is only available with a display."
#endif
#define SUPPORT_DRIFT_ALIGNMENT 0
#endif // DISPLAY_TYPE

// Enable Meade protocol communication over serial
Expand Down
13 changes: 12 additions & 1 deletion Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define BOARD_ESP32_ESP32DEV 1001

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

/**
* Supported info display types. Use one of these values for INF_DISPLAY_TYPE configuration matching your used display.
*
* INFO_DISPLAY_TYPE_NONE: No display. Use this if you don't use any display.
* INFO_DISPLAY_TYPE_SSD1306_I2C_128x64: I2C 128x64 OLED display module with SSD1306 controller, attached via I2C
* Amazon: https://www.amazon.com/dp/B06XRBTBTB?_encoding=UTF8&psc=1&ref_=cm_sw_r_cp_ud_dp_DQCWKZ7YB40X84RZSHJ0
**/
#define INFO_DISPLAY_TYPE_NONE 0
#define INFO_DISPLAY_TYPE_I2C_SSD1306_128x64 1

// Supported stepper models
#define STEPPER_TYPE_NONE -1
#define STEPPER_TYPE_ENABLED 1
Expand Down Expand Up @@ -81,4 +91,5 @@
#define DEBUG_GPS 0x0800 // GPS activity
#define DEBUG_FOCUS 0x1000 // Focuser activity
#define DEBUG_COORD_CALC 0x2000 // Calculations of coordinates
#define DEBUG_DISPLAY 0x4000 // Info display
#define DEBUG_ANY 0xFFFF // All debug output
2 changes: 1 addition & 1 deletion Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// Also, numbers are interpreted as simple numbers. _ __ _
// So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/

#define VERSION "V1.13.2"
#define VERSION "V1.13.3"
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
arduino-libraries/LiquidCrystal @ ^1.0.7
lincomatic/LiquidTWI2@^1.2.7
olikraus/U8g2@^2.28.8
https://github.com/ClutchplateDude/[email protected]

[env]
extra_scripts =
Expand Down Expand Up @@ -71,7 +72,6 @@ debug_init_break =
; Always upload firmware when initializing a debug session
debug_load_mode = always


[env:ramps]
extends = common_embedded
; [email protected] is currently broken (can't upload, gets stk500v2_recv errors)
Expand Down
17 changes: 17 additions & 0 deletions src/InfoDisplayRender.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
#include <Arduino.h>

class Mount;

// Base class to implement a
class InfoDisplayRender
{
public:
InfoDisplayRender() {};

virtual void init() {};
virtual void render(Mount *mount) {};
virtual void setConsoleMode(bool active) {};
virtual int addConsoleText(String text, bool tinyFont = true);
virtual void updateConsoleText(int line, String newText);
};
11 changes: 7 additions & 4 deletions src/MeadeCommandProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ bool gpsAqcuisitionComplete(int &indicator); // defined in c72_menuHA_GPS.hpp
//
// :XDnnn#
// Description:
// Run drift alignment
// Run drift alignment (only supported if SUPPORT_DRIFT_ALIGNMENT is enabled)
// Information:
// This runs a drift alignment procedure where the mounts slews east, pauses, slews west and pauses.
// Where nnn is the number of seconds the entire alignment should take. The call is blocking and will
Expand Down Expand Up @@ -1450,7 +1450,7 @@ String MeadeCommandProcessor::handleMeadeSetInfo(String inCmd)
SC: Calendar: If the date is valid 2 <string>s are returned, each string is 31 bytes long.
The first is: "Updating planetary data#" followed by a second string of 30 spaces terminated by '#'
*/
return "1Updating Planetary Data# #"; //
return F("1Updating Planetary Data# #"); //
}
else
{
Expand Down Expand Up @@ -1654,7 +1654,7 @@ String MeadeCommandProcessor::handleMeadeDistance(String inCmd)
/////////////////////////////
String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd)
{
// 0123
#if SUPPORT_DRIFT_ALIGNMENT == 1
// :XDmmm
if (inCmd[0] == 'D') // :XD
{ // Drift Alignemnt
Expand Down Expand Up @@ -1682,7 +1682,9 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd)
_lcdMenu->setCursor(0, 1);
_mount->startSlewing(TRACKING);
}
else if (inCmd[0] == 'G')
else
#endif
if (inCmd[0] == 'G')
{ // Get RA/DEC steps/deg, speedfactor
if (inCmd[1] == 'R') // :XGR#
{
Expand Down Expand Up @@ -2131,6 +2133,7 @@ String MeadeCommandProcessor::processCommand(String inCmd)
LOG(DEBUG_MEADE, "[MEADE]: Processing command '%s'", inCmd.c_str());
char command = inCmd[1];
inCmd = inCmd.substring(2);
_mount->commandReceived();
switch (command)
{
case 'S':
Expand Down
Loading

0 comments on commit b119b47

Please sign in to comment.