| 95 | } |
| 96 | |
| 97 | void doSwitch() |
| 98 | { |
| 99 | auto before = ota.getRunningPartition(); |
| 100 | auto after = ota.getNextBootPartition(); |
| 101 | |
| 102 | Serial << _F("Swapping from ") << before.name() << " @ 0x" << String(before.address(), HEX) << " to " |
| 103 | << after.name() << " @ 0x" << String(after.address(), HEX) << endl; |
| 104 | if(ota.setBootPartition(after)) { |
| 105 | Serial.println(F("Restarting...\r\n")); |
| 106 | System.restart(); |
| 107 | } else { |
| 108 | Serial.println(F("Switch failed.")); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | void showInfo() |
| 113 | { |
no test coverage detected