Skip to content
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

Neopixel_caselight_enable #541

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions config/hardware/lights/neopixel_caselight.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Neopixel leds used as general printer lights

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_caselight_enabled = True
variable_status_leds_effects_enabled = False
variable_status_leds_caselight_led_name: "caselight"
Expand Down
1 change: 1 addition & 0 deletions config/hardware/lights/neopixel_caselight_effects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# using LED_effects

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_caselight_enabled = True
variable_status_leds_effects_enabled = True
variable_status_leds_caselight_led_name: "caselight"
Expand Down
1 change: 1 addition & 0 deletions config/hardware/lights/status_leds.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Neopixel leds used on the toolhead (stealthburner style)

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: False
variable_status_leds_logo_led_name: "status_leds"
Expand Down
1 change: 1 addition & 0 deletions config/hardware/lights/status_leds_effects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# using LED_effects

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: True
variable_status_leds_logo_led_name: "status_leds"
Expand Down
1 change: 1 addition & 0 deletions config/hardware/lights/status_leds_rainbow_barf.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# in a rainbow barf pattern PCB

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: False
variable_status_leds_logo_led_name: "status_leds"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# in a rainbow barf pattern PCB using LED_effects

[gcode_macro _USER_VARIABLES]
variable_neopixel_leds_enabled = True
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: True
variable_status_leds_logo_led_name: "status_leds"
Expand Down
4 changes: 2 additions & 2 deletions config/machine.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[virtual_sdcard]
path: ~/printer_data/gcodes
on_error_gcode:
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
STATUS_LEDS COLOR="ERROR"
{% endif %}
{% if printer["gcode_macro _USER_VARIABLES"].probe_type_enabled == "dockable" or printer["gcode_macro _USER_VARIABLES"].probe_type_enabled == "dockable_virtual" %}
Expand All @@ -23,7 +23,7 @@ gcode:
{% if printer["gcode_macro _USER_VARIABLES"].light_enabled %}
LIGHT_OFF
{% endif %}
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
STATUS_LEDS COLOR="OFF"
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions macros/base/cancel_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gcode:
{% set mmu_unload_on_cancel_print = printer["gcode_macro _USER_VARIABLES"].mmu_unload_on_cancel_print %}
{% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %}
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %}
{% set filter_default_time = printer["gcode_macro _USER_VARIABLES"].filter_default_time_on_end_print|default(600)|int %}
Expand Down Expand Up @@ -62,7 +62,7 @@ gcode:
{% if light_enabled %}
LIGHT_ON S={light_intensity_end_print}
{% endif %}
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="OFF"
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions macros/base/control.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
description: Turn off the printer
gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set display_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_minidisplay_enabled %}
M84 ; turn steppers off
TURN_OFF_HEATERS ; turn bed / hotend off
M107 ; turn print cooling fan off
{% if light_enabled %}
LIGHT_OFF ; turn off light
{% endif %}
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="SHUTDOWN" ; turn off status LEDs
{% endif %}
{% if display_leds_enabled %}
Expand Down
4 changes: 2 additions & 2 deletions macros/base/end_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gcode:
{% set mmu_unload = params.MMU_UNLOAD_AT_END|default(printer["gcode_macro _USER_VARIABLES"].mmu_unload_on_end_print)|default(0)|int %}
{% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %}
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set filter_default_time = printer["gcode_macro _USER_VARIABLES"].filter_default_time_on_end_print|default(600)|int %}
{% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %}
Expand Down Expand Up @@ -63,7 +63,7 @@ gcode:
{% if light_enabled %}
LIGHT_ON S={light_intensity_end_print}
{% endif %}
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="DONE_PRINTING"
{% endif %}

Expand Down
6 changes: 3 additions & 3 deletions macros/base/homing/homing_conditional.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[gcode_macro _CG28]
description: Homing only if necessary
gcode:
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}

{% if "xyz" not in printer.toolhead.homed_axes %}
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="HOMING"
{% endif %}
G28
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}
{% endif %}
6 changes: 3 additions & 3 deletions macros/base/homing/homing_override.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gcode:
{% set y_driver = printer["gcode_macro _USER_VARIABLES"].y_driver %}
{% set z_driver = printer["gcode_macro _USER_VARIABLES"].z_driver %}
{% set z_drop_speed = printer["gcode_macro _USER_VARIABLES"].z_drop_speed * 60 %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}

{% set homing_first = printer["gcode_macro _USER_VARIABLES"].homing_first|string|upper %}
Expand All @@ -33,7 +33,7 @@ gcode:
# reset parameters
{% set X, Y, Z = False, False, False %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="HOMING"
{% endif %}

Expand Down Expand Up @@ -345,7 +345,7 @@ gcode:
_EXIT_POINT FUNCTION=homing_override
{% endif %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}

Expand Down
6 changes: 3 additions & 3 deletions macros/base/homing/z_calibration.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ description: Perform the Z calibration using the physical Z endstop and the dock
gcode:
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="CALIBRATING_Z"
{% endif %}

Expand Down Expand Up @@ -34,6 +34,6 @@ gcode:
_BASE_CALIBRATE_Z BED_POSITION="{ZRPx},{ZRPy}"
{% endif %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}
6 changes: 3 additions & 3 deletions macros/base/probing/overrides/qgl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rename_existing: _BASE_QUAD_GANTRY_LEVEL
description: Conform a moving, twistable gantry to the shape of a stationary bed with klicky automount
gcode:
{% set tilting_travel_accel = printer["gcode_macro _USER_VARIABLES"].tilting_travel_accel %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}

{% if verbose %}
Expand All @@ -17,7 +17,7 @@ gcode:

_CG28

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="LEVELING"
{% endif %}

Expand All @@ -34,6 +34,6 @@ gcode:

DEACTIVATE_PROBE

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}
6 changes: 3 additions & 3 deletions macros/base/probing/overrides/z_tilt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rename_existing: _BASE_Z_TILT_ADJUST
description: Conform a moving bed to the shape of a stationary gantry with dockable probe automount
gcode:
{% set tilting_travel_accel = printer["gcode_macro _USER_VARIABLES"].tilting_travel_accel %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}


Expand All @@ -18,7 +18,7 @@ gcode:

_CG28

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="LEVELING"
{% endif %}

Expand All @@ -35,6 +35,6 @@ gcode:

DEACTIVATE_PROBE

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}
20 changes: 10 additions & 10 deletions macros/base/start_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set light_intensity_start_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_start_print %}
{% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set force_homing_in_start_print = printer["gcode_macro _USER_VARIABLES"].force_homing_in_start_print %}
{% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
Expand All @@ -79,7 +79,7 @@ gcode:
# --------------------------------
# Let's do the START_PRINT actions
# --------------------------------
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="BUSY"
{% endif %}

Expand Down Expand Up @@ -200,7 +200,7 @@ gcode:
{% endif %}

# And.... Goooo!
{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="PRINTING"
{% endif %}

Expand Down Expand Up @@ -245,15 +245,15 @@ gcode:
{% set SOAK = printer["gcode_macro START_PRINT"].soak %}
{% set CHAMBER_TEMP = printer["gcode_macro START_PRINT"].chamber_temp %}

{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %}

{% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed * 60 %}

{% set max_x = printer.toolhead.axis_maximum.x|float %}
{% set max_y = printer.toolhead.axis_maximum.y|float %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="HEATING"
{% endif %}

Expand Down Expand Up @@ -335,7 +335,7 @@ gcode:
{% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %}

{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %}
{% set purge_and_brush_enabled = printer["gcode_macro _USER_VARIABLES"].purge_and_brush_enabled %}
{% set purgeclean_servo_enabled = printer["gcode_macro _USER_VARIABLES"].purgeclean_servo_enabled %}
Expand All @@ -346,7 +346,7 @@ gcode:
{% set max_x = printer.toolhead.axis_maximum.x|float %}
{% set max_y = printer.toolhead.axis_maximum.y|float %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="HEATING"
{% endif %}

Expand Down Expand Up @@ -429,7 +429,7 @@ gcode:

{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}

{% if bed_mesh_enabled %}
{% if BED_MESH_PROFILE == "" %}
Expand All @@ -450,11 +450,11 @@ gcode:
gcode:
# Preheat the nozzle to safe probing temperature.
{% set safe_extruder_temp = printer["gcode_macro _USER_VARIABLES"].safe_extruder_temp|float %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set probe_type_enabled = printer["gcode_macro _USER_VARIABLES"].probe_type_enabled %}
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="HEATING"
{% endif %}
{% if verbose %}
Expand Down
2 changes: 1 addition & 1 deletion macros/hardware_functions/status_leds.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ gcode:
{ action_raise_error("COLOR is not valid!") }
{% endif %}

{% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %}
_SET_LEDS_BY_NAME LEDS="logo" COLOR={status_color[color].logo} TRANSMIT={logo_transmit}
_SET_LEDS_BY_NAME LEDS="nozzle" COLOR={status_color[color].nozzle} TRANSMIT=1
Expand Down
12 changes: 6 additions & 6 deletions macros/helpers/nozzle_cleaning.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Wipe the nozzle on the brush
gcode:
{% set purge_and_brush_enabled = printer["gcode_macro _USER_VARIABLES"].purge_and_brush_enabled %}
{% set purgeclean_servo_enabled = printer["gcode_macro _USER_VARIABLES"].purgeclean_servo_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set brush_clean_accel = printer["gcode_macro _USER_VARIABLES"].brush_clean_accel %}
{% set brush_over_y_axis = printer["gcode_macro _USER_VARIABLES"].brush_over_y_axis %}
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
Expand All @@ -15,7 +15,7 @@ gcode:

{% set Bx, By, Bz = printer["gcode_macro _USER_VARIABLES"].brush_xyz|map('float') %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="CLEANING"
{% endif %}

Expand Down Expand Up @@ -59,7 +59,7 @@ gcode:
{% endif %}
{% endif %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}

Expand All @@ -74,7 +74,7 @@ gcode:

{% set purge_and_brush_enabled = printer["gcode_macro _USER_VARIABLES"].purge_and_brush_enabled %}
{% set purgeclean_servo_enabled = printer["gcode_macro _USER_VARIABLES"].purgeclean_servo_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set neopixel_leds_enabled = printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %}
{% set re_enable_filament_sensor = 0 %}
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
Expand All @@ -83,7 +83,7 @@ gcode:
{% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed * 60 %}
{% set Sz = printer["gcode_macro _USER_VARIABLES"].z_drop_speed * 60 %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="CLEANING"
{% endif %}

Expand Down Expand Up @@ -126,7 +126,7 @@ gcode:
{% endif %}
{% endif %}

{% if status_leds_enabled %}
{% if neopixel_leds_enabled %}
STATUS_LEDS COLOR="READY"
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion macros/miscs/startup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gcode:

[gcode_macro _INIT_LEDS]
gcode:
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled or printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].neopixel_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].caselight_on_at_startup|default(False) %}
STATUS_LEDS COLOR="READY"
{% else %}
Expand Down