Új hozzászólás Aktív témák

  • daninet

    veterán

    Sziasztok!
    Valaki validálná nekem, hogy az alábbi kód helyes? Azt akarom, ha ez a loop eléri az auto9.g sorszámot ugorjon vissza nullára (vagyis a számlálóban 1-re amiből kivonunk egyet).
    Ezek a fájlok majdnem 6 óráig futnak ezért szeretném tudni a hosszú teszt előtt, hogy amit belekontárkodtam működik :)
    void CardReader::autofile_begin() {
    autofile_index = 1;
    (void)autofile_check();
    }
    bool CardReader::autofile_check() {
    if (!autofile_index) return false;
    if (!isMounted())
    mount();
    else if (ENABLED(SDCARD_EEPROM_EMULATION))
    settings.first_load();
    // Don't run auto#.g when a PLR file exists
    if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) {
    char autoname[10];
    sprintf_P(autoname, PSTR("/auto%c.g"), '0' + autofile_index - 1);
    if (fileExists(autoname)) {
    cdroot();
    openAndPrintFile(autoname);
    if (autofile_index = 10)
    autofile_index = 1;
    else if (autofile_index < 10)
    autofile_index++;
    return true;
    }
    }
    autofile_cancel();
    return false;
    }

Új hozzászólás Aktív témák