mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-19 12:57:19 +00:00
Native fixes for millis and dimmer
This commit is contained in:
parent
dae5a89ff1
commit
3593ce20b3
@ -138,7 +138,7 @@ void setup()
|
||||
gpioSetup();
|
||||
#endif
|
||||
|
||||
mainLastLoopTime = millis() - 1000; // reset loop counter
|
||||
mainLastLoopTime = millis(); // - 1000; // reset loop counter
|
||||
printf("%s %d\n", __FILE__, __LINE__);
|
||||
// delay(250);
|
||||
}
|
||||
|
@ -324,7 +324,9 @@ void gpioSetup(void)
|
||||
gpioSavePinConfig(0, 3, hasp_gpio_type_t::POWER_RELAY, 0, -1, false);
|
||||
gpioSavePinConfig(1, 4, hasp_gpio_type_t::LIGHT_RELAY, 0, -1, false);
|
||||
gpioSavePinConfig(2, 13, hasp_gpio_type_t::LED, 0, -1, false);
|
||||
gpioConfig[2].max = 255;
|
||||
gpioSavePinConfig(3, 14, hasp_gpio_type_t::DAC, 0, -1, false);
|
||||
gpioConfig[2].max = 4095;
|
||||
gpioSavePinConfig(4, 5, hasp_gpio_type_t::MOTION, 0, -1, false);
|
||||
}
|
||||
IRAM_ATTR void gpioLoop(void)
|
||||
@ -490,7 +492,7 @@ static bool gpio_set_output_value(hasp_gpio_config_t* gpio, bool power, uint16_t
|
||||
gpio->power = val == 0 ? 0 : power;
|
||||
|
||||
// Only update the current value if power set to 1, otherwise retain previous value
|
||||
if(power) gpio->val = gpio_limit(val, 0, gpio->max);
|
||||
if(val != 0) gpio->val = gpio_limit(val, 0, gpio->max);
|
||||
|
||||
switch(gpio->type) {
|
||||
case hasp_gpio_type_t::POWER_RELAY:
|
||||
|
Loading…
x
Reference in New Issue
Block a user