本文整理汇总了C++中HardwareTimer::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ HardwareTimer::stop方法的具体用法?C++ HardwareTimer::stop怎么用?C++ HardwareTimer::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HardwareTimer
的用法示例。
在下文中一共展示了HardwareTimer::stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OtaUpdate
void OtaUpdate() {
uint8 slot;
rboot_config bootconf;
Serial.println("Updating...");
hardwareTimer.stop();
reportTimer.stop();
sendToClients("Firmware ota update started...");
// need a clean object, otherwise if run before and failed will not run again
if (otaUpdater)
delete otaUpdater;
otaUpdater = new rBootHttpUpdate();
sendToClients("Firmware ota update started...1");
// select rom slot to flash
bootconf = rboot_get_config();
slot = bootconf.current_rom;
if (slot == 0)
slot = 1;
else
slot = 0;
#ifndef RBOOT_TWO_ROMS
// flash rom to position indicated in the rBoot config rom table
otaUpdater->addItem(bootconf.roms[slot], ROM_0_URL);
#else
// flash appropriate rom
if (slot == 0) {
otaUpdater->addItem(bootconf.roms[slot], ROM_0_URL);
} else {
otaUpdater->addItem(bootconf.roms[slot], ROM_1_URL);
}
#endif
#ifndef DISABLE_SPIFFS
// use user supplied values (defaults for 4mb flash in makefile)
if (slot == 0) {
otaUpdater->addItem(RBOOT_SPIFFS_0, SPIFFS_URL);
} else {
otaUpdater->addItem(RBOOT_SPIFFS_1, SPIFFS_URL);
}
#endif
sendToClients("Firmware ota update started...2");
// request switch and reboot on success
otaUpdater->switchToRom(slot);
// and/or set a callback (called on failure or success without switching requested)
otaUpdater->setCallback(OtaUpdate_CallBack);
// start update
sendToClients("Firmware ota update started...3");
otaUpdater->start();
}