Skip to content

Fix SSD1306 build #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**V1.13.15 - Updates**
- Check `INFO_DISPLAY_TYPE` builds in CI
- Fix `INFO_DISPLAY_TYPE_I2C_SSD1306_128x64` for esp32 builds

**V1.13.14 - Updates**
- Improved Serial command handling (made it less 'blocking'), which should improve general performance
- Guide pulses are ignored when tracking is disabled (for example, when at the limits)
Expand Down
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.14"
#define VERSION "V1.13.15"
41 changes: 39 additions & 2 deletions matrix_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@

CONTINUE_ON_ERROR = False

BOARDS = [
MKS_GENL_BOARDS = [
"mksgenlv21",
"mksgenlv2",
"mksgenlv1",
"esp32",
]
AVR_BOARDS = MKS_GENL_BOARDS + [
"ramps",
]
BOARDS = AVR_BOARDS + [
"esp32",
]

STEPPER_TYPES = [
"STEPPER_TYPE_NONE",
Expand All @@ -47,6 +51,11 @@
"DISPLAY_TYPE_LCD_JOY_I2C_SSD1306",
]

INFO_DISPLAY_TYPES = [
"INFO_DISPLAY_TYPE_NONE",
"INFO_DISPLAY_TYPE_I2C_SSD1306_128x64",
]

BUILD_FLAGS = {
"CONFIG_VERSION": "1",
"RA_STEPPER_TYPE": [x for x in STEPPER_TYPES if x != "STEPPER_TYPE_NONE"],
Expand All @@ -62,6 +71,7 @@
"FOCUS_STEPPER_TYPE": STEPPER_TYPES,
"FOCUS_DRIVER_TYPE": DRIVER_TYPES,
"DISPLAY_TYPE": DISPLAY_TYPES,
"INFO_DISPLAY_TYPE": INFO_DISPLAY_TYPES,
"TEST_VERIFY_MODE": BOOLEAN_VALUES,
"DEBUG_LEVEL": ["DEBUG_NONE", "DEBUG_ANY"],
"RA_MOTOR_CURRENT_RATING": "1",
Expand Down Expand Up @@ -236,6 +246,25 @@ def driver_supports_stepper(d, s):
problem.addConstraint(driver_supports_stepper, ["AZ_DRIVER_TYPE", "AZ_STEPPER_TYPE"])
problem.addConstraint(driver_supports_stepper, ["FOCUS_DRIVER_TYPE", "FOCUS_STEPPER_TYPE"])

# AVR boards can't have both DISPLAY_TYPE and INFO_DISPLAY_TYPE enabled
def avr_display_exclusivity(board, display, info_display):
if board not in AVR_BOARDS:
return True
return (
display == "DISPLAY_TYPE_NONE" or
info_display == "INFO_DISPLAY_TYPE_NONE"
)
problem.addConstraint(avr_display_exclusivity, ["BOARD", "DISPLAY_TYPE", "INFO_DISPLAY_TYPE"])

# MKS GenL boards must not have a focus stepper when info display is enabled
def mksgenl_focus_exclusivity(board, info_display, focus_stepper):
if board not in MKS_GENL_BOARDS:
return True
if info_display != "INFO_DISPLAY_TYPE_NONE":
return focus_stepper == "STEPPER_TYPE_NONE"
return True
problem.addConstraint(mksgenl_focus_exclusivity, ["BOARD", "INFO_DISPLAY_TYPE", "FOCUS_STEPPER_TYPE"])


# Define constraints for excluded tests
def set_test_constraints(problem):
Expand Down Expand Up @@ -267,6 +296,14 @@ def set_ci_constraints(problem):
problem.addConstraint(InSetConstraint({"DISPLAY_TYPE_NONE", "DISPLAY_TYPE_LCD_KEYPAD"}), ["DISPLAY_TYPE"])
# problem.addConstraint(InSetConstraint({"DRIVER_TYPE_ULN2003"}), ["ALT_DRIVER_TYPE"])

# Restrict INFO_DISPLAY_TYPE_I2C_SSD1306_128x64 to mksgenlv21 and esp32 only
# (just to reduce compile times)
def info_display_constraint(board, info_display):
if info_display == "INFO_DISPLAY_TYPE_I2C_SSD1306_128x64":
return board in ["mksgenlv21", "esp32"]
return True
problem.addConstraint(info_display_constraint, ["BOARD", "INFO_DISPLAY_TYPE"])


def print_solutions_matrix(solutions, short_strings=False):
def get_value(vb, vk):
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lib_deps =
arduino-libraries/LiquidCrystal @ ^1.0.7
lincomatic/LiquidTWI2@^1.2.7
olikraus/U8g2@^2.28.8
https://github.com/ClutchplateDude/esp8266-oled-ssd1306#4.6.0
https://github.com/ClutchplateDude/esp8266-oled-ssd1306#4.6.2

[env]
extra_scripts =
Expand Down
11 changes: 11 additions & 0 deletions src/SSD1306_128x64_Display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
#include "Mount.hpp"
#include "InfoDisplayRender.hpp"

#if defined(ESP32)
/*
* ESP32 PROGMEM is fake, and its pgm_read_byte macro makes a useless cast
* which errors out with Werror=useless-cast, which can't be suppressed by
* our PUSH/POP_NO_WARNINGS because the macro expands in OUR code, not their
* header :/
*/
#undef pgm_read_byte
#define pgm_read_byte(addr) (*(addr))
#endif

const float sineSize = 18.0;
const uint8_t sineTable[] PROGMEM = {0, 22, 44, 66, 87, 108, 128, 146, 164, 180, 195, 209, 221, 231, 240, 246, 251, 254, 255, 255};

Expand Down