Skip to content

Commit

Permalink
fixed nozzle and status led on/off. (Frix-x#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioguareschi authored and Frix-x committed Feb 13, 2024
1 parent 7964dbe commit 3468ad6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions config/hardware/lights/neopixel_caselight.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_caselight_enabled = True
variable_status_leds_effects_enabled = False
variable_status_leds_caselight_led_name: "caselight"
gcode:

Expand Down
3 changes: 2 additions & 1 deletion config/hardware/lights/neopixel_caselight_effects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_caselight_enabled = True
variable_status_leds_caselight_led_name: "caselight_effects"
variable_status_leds_effects_enabled = True
variable_status_leds_caselight_led_name: "caselight"
gcode:

# Also include directly the leds control macros from here
Expand Down
1 change: 1 addition & 0 deletions config/hardware/lights/status_leds.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: False
variable_status_leds_logo_led_name: "status_leds"
variable_status_leds_logo_idx: '1'
variable_status_leds_nozzle_led_name: "status_leds"
Expand Down
5 changes: 3 additions & 2 deletions config/hardware/lights/status_leds_effects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_enabled: True
variable_status_leds_logo_led_name: "status_leds_effects"
variable_status_leds_effects_enabled: True
variable_status_leds_logo_led_name: "status_leds"
variable_status_leds_logo_idx: '1'
variable_status_leds_nozzle_led_name: "status_leds_effects"
variable_status_leds_nozzle_led_name: "status_leds"
variable_status_leds_nozzle_idx: '2,3'
gcode:

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 @@ -3,6 +3,7 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_enabled: True
variable_status_leds_effects_enabled: False
variable_status_leds_logo_led_name: "status_leds"
variable_status_leds_logo_idx: '1,2,3,4,5,6,7,8'
variable_status_leds_nozzle_led_name: "status_leds"
Expand Down
5 changes: 3 additions & 2 deletions config/hardware/lights/status_leds_rainbow_barf_effects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

[gcode_macro _USER_VARIABLES]
variable_status_leds_enabled: True
variable_status_leds_logo_led_name: "status_leds_effects"
variable_status_leds_effects_enabled: True
variable_status_leds_logo_led_name: "status_leds"
variable_status_leds_logo_idx: '1,2,3,4,5,6,7,8'
variable_status_leds_nozzle_led_name: "status_leds_effects"
variable_status_leds_nozzle_led_name: "status_leds"
variable_status_leds_nozzle_idx: '9,10'
gcode:

Expand Down
12 changes: 8 additions & 4 deletions macros/hardware_functions/status_leds.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ gcode:
{% set led = params.LED|string %}
{% set idx = (params.IDX|string).split(',') %}
{% set transmit_last = params.TRANSMIT|default(1) %}

{% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled %}
STOP_LED_EFFECTS LEDS="neopixel:"{led}" ("{params.IDX}")"
{% endif %}

{% for led_index in idx %}
{% set transmit=transmit_last if loop.last else 0 %}
Expand Down Expand Up @@ -198,19 +202,19 @@ gcode:
{% endif %}

{% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_logo_led_name == "status_leds"%}
{% 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
{% elif printer["gcode_macro _USER_VARIABLES"].status_leds_logo_led_name == "status_leds_effects"%}
{% else %}
SET_LED_EFFECT EFFECT={"sb_logo_" + status_color[color].logo} REPLACE=1 FADETIME=0.5
SET_LED_EFFECT EFFECT={"sb_nozzle_" + status_color[color].nozzle} REPLACE=1 FADETIME=0.5
{% endif %}
{% endif %}

{% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled%}
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_led_name == "caselight"%}
{% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %}
_SET_ALLLEDS_BY_NAME LEDS="caselight" COLOR={status_color[color].caselight} TRANSMIT=1
{% elif printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_led_name == "caselight_effects"%}
{% else %}
SET_LED_EFFECT EFFECT={"cl_" + status_color[color].caselight} REPLACE=1 FADETIME=0.5
{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion moonraker/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ enable_auto_refresh: True
type: git_repo
path: ~/klippain_config
origin: https://github.com/Frix-x/klippain.git
primary_branch: main
primary_branch: develop
managed_services: moonraker klipper
install_script: install.sh

0 comments on commit 3468ad6

Please sign in to comment.