Scott Lahteine 3 роки тому
джерело
коміт
c488070859

+ 1
- 1
Marlin/Configuration.h Переглянути файл

2363
   //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
2363
   //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
2364
   //#define NEOPIXEL2_PIN    5
2364
   //#define NEOPIXEL2_PIN    5
2365
   //#define NEOPIXEL2_INSERIES     // Default behavior is NeoPixel 2 in parallel
2365
   //#define NEOPIXEL2_INSERIES     // Default behavior is NeoPixel 2 in parallel
2366
-  #define NEOPIXEL_PIXELS 30       // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
2366
+  #define NEOPIXEL_PIXELS 30       // Number of LEDs in the strip, larger of 2 strips if 2 NeoPixel strips are used
2367
   #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
2367
   #define NEOPIXEL_IS_SEQUENTIAL   // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
2368
   #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
2368
   #define NEOPIXEL_BRIGHTNESS 127  // Initial brightness (0-255)
2369
   //#define NEOPIXEL_STARTUP_TEST  // Cycle through colors at startup
2369
   //#define NEOPIXEL_STARTUP_TEST  // Cycle through colors at startup

+ 3
- 6
Marlin/src/feature/leds/leds.cpp Переглянути файл

129
 
129
 
130
   #endif
130
   #endif
131
 
131
 
132
-  #if ENABLED(PCA9632)
133
-    // Update I2C LED driver
134
-    pca9632_set_led_color(incol);
135
-  #endif
136
-
137
-  TERN_(PCA9533, PCA9533_setColor(incol.r, incol.g, incol.b));
132
+  // Update I2C LED driver
133
+  TERN_(PCA9632, PCA9632_set_led_color(incol));
134
+  TERN_(PCA9533, PCA9533_set_rgb(incol.r, incol.g, incol.b));
138
 
135
 
139
   #if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS)
136
   #if EITHER(LED_CONTROL_MENU, PRINTER_EVENT_LEDS)
140
     // Don't update the color when OFF
137
     // Don't update the color when OFF

+ 2
- 6
Marlin/src/feature/leds/leds.h Переглянути файл

104
   bool operator!=(const LEDColor &right) { return !operator==(right); }
104
   bool operator!=(const LEDColor &right) { return !operator==(right); }
105
 
105
 
106
   bool is_off() const {
106
   bool is_off() const {
107
-    return 3 > r + g + b
108
-      #if HAS_WHITE_LED
109
-        + w
110
-      #endif
111
-    ;
107
+    return 3 > r + g + b + TERN0(HAS_WHITE_LED, w);
112
   }
108
   }
113
 } LEDColor;
109
 } LEDColor;
114
 
110
 
156
     #endif
152
     #endif
157
   );
153
   );
158
 
154
 
159
-  inline void set_color(uint8_t r, uint8_t g, uint8_t b
155
+  static inline void set_color(uint8_t r, uint8_t g, uint8_t b
160
     #if HAS_WHITE_LED
156
     #if HAS_WHITE_LED
161
       , uint8_t w=0
157
       , uint8_t w=0
162
       #if ENABLED(NEOPIXEL_LED)
158
       #if ENABLED(NEOPIXEL_LED)

+ 6
- 7
Marlin/src/feature/leds/neopixel.cpp Переглянути файл

53
 #endif
53
 #endif
54
 
54
 
55
 void Marlin_NeoPixel::set_color(const uint32_t color) {
55
 void Marlin_NeoPixel::set_color(const uint32_t color) {
56
-  if (get_neo_index() >= 0) {
57
-    set_pixel_color(get_neo_index(), color);
58
-    set_neo_index(-1);
56
+  if (neoindex >= 0) {
57
+    set_pixel_color(neoindex, color);
58
+    neoindex = -1;
59
   }
59
   }
60
   else {
60
   else {
61
     for (uint16_t i = 0; i < pixels(); ++i) {
61
     for (uint16_t i = 0; i < pixels(); ++i) {
78
 }
78
 }
79
 
79
 
80
 void Marlin_NeoPixel::init() {
80
 void Marlin_NeoPixel::init() {
81
-  set_neo_index(-1);                   // -1 .. NEOPIXEL_PIXELS-1 range
81
+  neoindex = -1;                       // -1 .. NEOPIXEL_PIXELS-1 range
82
   set_brightness(NEOPIXEL_BRIGHTNESS); //  0 .. 255 range
82
   set_brightness(NEOPIXEL_BRIGHTNESS); //  0 .. 255 range
83
   begin();
83
   begin();
84
   show();  // initialize to all off
84
   show();  // initialize to all off
85
 
85
 
86
   #if ENABLED(NEOPIXEL_STARTUP_TEST)
86
   #if ENABLED(NEOPIXEL_STARTUP_TEST)
87
     set_color_startup(adaneo1.Color(255, 0, 0, 0));  // red
87
     set_color_startup(adaneo1.Color(255, 0, 0, 0));  // red
88
-    safe_delay(1000);
88
+    safe_delay(500);
89
     set_color_startup(adaneo1.Color(0, 255, 0, 0));  // green
89
     set_color_startup(adaneo1.Color(0, 255, 0, 0));  // green
90
-    safe_delay(1000);
90
+    safe_delay(500);
91
     set_color_startup(adaneo1.Color(0, 0, 255, 0));  // blue
91
     set_color_startup(adaneo1.Color(0, 0, 255, 0));  // blue
92
-    safe_delay(1000);
93
   #endif
92
   #endif
94
 
93
 
95
   #ifdef NEOPIXEL_BKGD_LED_INDEX
94
   #ifdef NEOPIXEL_BKGD_LED_INDEX

+ 2
- 4
Marlin/src/feature/leds/neopixel.h Переглянути файл

65
       , adaneo2
65
       , adaneo2
66
     #endif
66
     #endif
67
   ;
67
   ;
68
-  static int8_t neoindex;
69
 
68
 
70
 public:
69
 public:
70
+  static int8_t neoindex;
71
+
71
   static void init();
72
   static void init();
72
   static void set_color_startup(const uint32_t c);
73
   static void set_color_startup(const uint32_t c);
73
 
74
 
74
   static void set_color(const uint32_t c);
75
   static void set_color(const uint32_t c);
75
 
76
 
76
-  FORCE_INLINE static void set_neo_index(const int8_t neoIndex) { neoindex = neoIndex; }
77
-  FORCE_INLINE static int8_t get_neo_index() { return neoindex; }
78
-
79
   #ifdef NEOPIXEL_BKGD_LED_INDEX
77
   #ifdef NEOPIXEL_BKGD_LED_INDEX
80
     static void set_color_background();
78
     static void set_color_background();
81
   #endif
79
   #endif

+ 1
- 1
Marlin/src/feature/leds/pca9533.cpp Переглянути файл

62
   PCA9533_writeRegister(PCA9533_REG_SEL, 0);
62
   PCA9533_writeRegister(PCA9533_REG_SEL, 0);
63
 }
63
 }
64
 
64
 
65
-void PCA9533_setColor(uint8_t red, uint8_t green, uint8_t blue) {
65
+void PCA9533_set_rgb(uint8_t red, uint8_t green, uint8_t blue) {
66
   uint8_t r_pwm0 = 0; // Register data - PWM value
66
   uint8_t r_pwm0 = 0; // Register data - PWM value
67
   uint8_t r_pwm1 = 0; // Register data - PWM value
67
   uint8_t r_pwm1 = 0; // Register data - PWM value
68
 
68
 

+ 1
- 1
Marlin/src/feature/leds/pca9533.h Переглянути файл

55
 
55
 
56
 void PCA9533_init();
56
 void PCA9533_init();
57
 void PCA9533_reset();
57
 void PCA9533_reset();
58
-void PCA9533_setColor(uint8_t red, uint8_t green, uint8_t blue);
58
+void PCA9533_set_rgb(uint8_t red, uint8_t green, uint8_t blue);
59
 void PCA9533_setOff();
59
 void PCA9533_setOff();

+ 2
- 2
Marlin/src/feature/leds/pca9632.cpp Переглянути файл

120
   }
120
   }
121
 #endif
121
 #endif
122
 
122
 
123
-void pca9632_set_led_color(const LEDColor &color) {
123
+void PCA9632_set_led_color(const LEDColor &color) {
124
   Wire.begin();
124
   Wire.begin();
125
   if (!PCA_init) {
125
   if (!PCA_init) {
126
     PCA_init = 1;
126
     PCA_init = 1;
138
 
138
 
139
 #if ENABLED(PCA9632_BUZZER)
139
 #if ENABLED(PCA9632_BUZZER)
140
 
140
 
141
-  void pca9632_buzz(const long, const uint16_t) {
141
+  void PCA9632_buzz(const long, const uint16_t) {
142
     uint8_t data[] = PCA9632_BUZZER_DATA;
142
     uint8_t data[] = PCA9632_BUZZER_DATA;
143
     Wire.beginTransmission(I2C_ADDRESS(PCA9632_ADDRESS));
143
     Wire.beginTransmission(I2C_ADDRESS(PCA9632_ADDRESS));
144
     Wire.write(data, sizeof(data));
144
     Wire.write(data, sizeof(data));

+ 2
- 2
Marlin/src/feature/leds/pca9632.h Переглянути файл

29
 struct LEDColor;
29
 struct LEDColor;
30
 typedef LEDColor LEDColor;
30
 typedef LEDColor LEDColor;
31
 
31
 
32
-void pca9632_set_led_color(const LEDColor &color);
32
+void PCA9632_set_led_color(const LEDColor &color);
33
 
33
 
34
 #if ENABLED(PCA9632_BUZZER)
34
 #if ENABLED(PCA9632_BUZZER)
35
   #include <stdint.h>
35
   #include <stdint.h>
36
-  void pca9632_buzz(const long, const uint16_t);
36
+  void PCA9632_buzz(const long, const uint16_t);
37
 #endif
37
 #endif

+ 1
- 1
Marlin/src/feature/password/password.cpp Переглянути файл

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 

+ 1
- 1
Marlin/src/feature/password/password.h Переглянути файл

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once

+ 1
- 1
Marlin/src/gcode/feature/password/M510-M512.cpp Переглянути файл

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 

+ 1
- 1
Marlin/src/gcode/gcode.h Переглянути файл

155
  * M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
155
  * M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
156
  * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
156
  * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
157
  * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
157
  * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
158
- * M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
158
+ * M150 - Set Status LED Color as R<red> U<green> B<blue> W<white> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
159
  * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
159
  * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
160
  * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
160
  * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
161
  * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
161
  * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)

+ 8
- 7
Marlin/src/lcd/menu/menu_led.cpp Переглянути файл

34
   #include "../../feature/leds/leds.h"
34
   #include "../../feature/leds/leds.h"
35
 
35
 
36
   #if ENABLED(LED_COLOR_PRESETS)
36
   #if ENABLED(LED_COLOR_PRESETS)
37
+
37
     void menu_led_presets() {
38
     void menu_led_presets() {
38
       START_MENU();
39
       START_MENU();
39
       #if LCD_HEIGHT > 2
40
       #if LCD_HEIGHT > 2
40
         STATIC_ITEM(MSG_LED_PRESETS, SS_DEFAULT|SS_INVERT);
41
         STATIC_ITEM(MSG_LED_PRESETS, SS_DEFAULT|SS_INVERT);
41
       #endif
42
       #endif
42
       BACK_ITEM(MSG_LED_CONTROL);
43
       BACK_ITEM(MSG_LED_CONTROL);
43
-      ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
44
-      ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red);
44
+      ACTION_ITEM(MSG_SET_LEDS_WHITE,  leds.set_white);
45
+      ACTION_ITEM(MSG_SET_LEDS_RED,    leds.set_red);
45
       ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange);
46
       ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange);
46
-      ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow);
47
-      ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green);
48
-      ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue);
47
+      ACTION_ITEM(MSG_SET_LEDS_YELLOW, leds.set_yellow);
48
+      ACTION_ITEM(MSG_SET_LEDS_GREEN,  leds.set_green);
49
+      ACTION_ITEM(MSG_SET_LEDS_BLUE,   leds.set_blue);
49
       ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo);
50
       ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo);
50
       ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet);
51
       ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet);
51
       END_MENU();
52
       END_MENU();
83
   #endif
84
   #endif
84
 #endif
85
 #endif
85
 
86
 
86
-
87
-
88
 void menu_led() {
87
 void menu_led() {
89
   START_MENU();
88
   START_MENU();
90
   BACK_ITEM(MSG_MAIN);
89
   BACK_ITEM(MSG_MAIN);
90
+
91
   #if ENABLED(LED_CONTROL_MENU)
91
   #if ENABLED(LED_CONTROL_MENU)
92
     bool led_on = leds.lights_on;
92
     bool led_on = leds.lights_on;
93
     EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle);
93
     EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle);
97
     #endif
97
     #endif
98
     SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
98
     SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
99
   #endif
99
   #endif
100
+
100
   //
101
   //
101
   // Set Case light on/off/brightness
102
   // Set Case light on/off/brightness
102
   //
103
   //

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Переглянути файл

81
   #endif
81
   #endif
82
   void MarlinUI::buzz(const long duration, const uint16_t freq) {
82
   void MarlinUI::buzz(const long duration, const uint16_t freq) {
83
     #if ENABLED(PCA9632_BUZZER)
83
     #if ENABLED(PCA9632_BUZZER)
84
-      pca9632_buzz(duration, freq);
84
+      PCA9632_buzz(duration, freq);
85
     #elif USE_BEEPER
85
     #elif USE_BEEPER
86
       buzzer.tone(duration, freq);
86
       buzzer.tone(duration, freq);
87
     #endif
87
     #endif

+ 1
- 1
Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h Переглянути файл

113
 #define FAN1_PIN                            PA8   // FAN  (fan0 on board) e0 cool fan
113
 #define FAN1_PIN                            PA8   // FAN  (fan0 on board) e0 cool fan
114
 #define FAN2_PIN                            PB9   // FAN  (fan1 on board) controller cool fan
114
 #define FAN2_PIN                            PB9   // FAN  (fan1 on board) controller cool fan
115
 
115
 
116
-// One neopixel onboard and a connector for other neopixels
116
+// One NeoPixel onboard and a connector for other NeoPixels
117
 #define NEOPIXEL_PIN                        PC7   // The NEOPIXEL LED driving pin
117
 #define NEOPIXEL_PIN                        PC7   // The NEOPIXEL LED driving pin
118
 
118
 
119
 /**
119
 /**

Завантаження…
Відмінити
Зберегти