Browse Source

Fix pca9632_set_led_color

…when used with an I2C screen.

Co-Authored-By: soimy <soimy@163.com>
Scott Lahteine 7 years ago
parent
commit
1b921b246b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/feature/leds/pca9632.cpp

+ 1
- 1
Marlin/src/feature/leds/pca9632.cpp View File

100
 #endif
100
 #endif
101
 
101
 
102
 void pca9632_set_led_color(const LEDColor &color) {
102
 void pca9632_set_led_color(const LEDColor &color) {
103
+  Wire.begin();
103
   if (!PCA_init) {
104
   if (!PCA_init) {
104
     PCA_init = 1;
105
     PCA_init = 1;
105
-    Wire.begin();
106
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE);
106
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE);
107
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
107
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
108
   }
108
   }

Loading…
Cancel
Save