Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Продлевать таймер настройки на 10мин при каждом переходе вебстраниц настроек #305

Open
dontsovcmc opened this issue Nov 24, 2023 · 0 comments
Labels
attiny85 attiny firmware esp esp firmware

Comments

@dontsovcmc
Copy link
Owner

Т.к. таймер нужен для "подстраховке", что ватериус не оставили включенным, то во время настройки корректно "сбрасывать" его в 10мин каждый раз когда пользователь проявляет активность. К примеру, переходит со страницы на страницу, настраивая Ватериус.

  1. Добавить команду в attiny
#define PING_ACK 0xAA

    case 'P': // ESP продолжается настройка
        esp.wake_up_timestamp = millis();
        txBuffer[0] = PING_ACK;
        break;
  1. Добавить в ESP команду
#define PING_ACK 0xAA
void MasterI2C::ping()
{
    uint8_t crc = init_crc;
    uint8_t ack;  # для проверки
    if (!sendCmd('P') || !getByte(ack, crc) || ack != PING_ACK)
    {
        LOG_ERROR(F("Ping failed. Check i2c line."));
    } else 
    {
        LOG_ERROR(F("Ping Attiny OK"));
    }
}
  1. Добавить вызов ping()
    в onPostApiSetup, onPostApiSetupConnect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attiny85 attiny firmware esp esp firmware
Projects
None yet
Development

No branches or pull requests

1 participant