Merge pull request #7177 from s-hadinger/h801

Fix flashing H801 led at boot (#7165, #649)
This commit is contained in:
Theo Arends 2019-12-10 22:19:07 +01:00 committed by GitHub
commit a9d8c8fde3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -9,6 +9,7 @@
- Add Wifi Signal Strength in dBm in addition to RSSI Wifi Experience by Andreas Schultz (#7145)
- Add Yaw, Pitch and Roll support for MPU6050 by Philip Barclay (#7058)
- Add reporting of raw weight to JSON from HX711 to overcome auto-tare functionality by @tobox (#7171)
- Fix flashing H801 led at boot (#7165, #649)
### 7.1.2.3 20191208

View File

@ -1286,15 +1286,19 @@ void GpioInit(void)
}
#endif // USE_SONOFF_SC
if (!light_type) {
for (uint32_t i = 0; i < MAX_PWMS; i++) { // Basic PWM control only
if (pin[GPIO_PWM1 +i] < 99) {
pwm_present = true;
pinMode(pin[GPIO_PWM1 +i], OUTPUT);
if (light_type) {
// force PWM GPIOs to low or high mode, see #7165
analogWrite(pin[GPIO_PWM1 +i], bitRead(pwm_inverted, i) ? Settings.pwm_range : 0);
} else {
pwm_present = true;
analogWrite(pin[GPIO_PWM1 +i], bitRead(pwm_inverted, i) ? Settings.pwm_range - Settings.pwm_value[i] : Settings.pwm_value[i]);
}
}
}
for (uint32_t i = 0; i < MAX_RELAYS; i++) {
if (pin[GPIO_REL1 +i] < 99) {
pinMode(pin[GPIO_REL1 +i], OUTPUT);