| 250 | static void setAction(MenuAction a) { selectedAction = a; } |
| 251 | |
| 252 | static void doWrite() { |
| 253 | if (!keyLoaded) { |
| 254 | displayError("No key in buffer", true); |
| 255 | delay(1500); |
| 256 | return; |
| 257 | } |
| 258 | |
| 259 | tft.fillScreen(bruceConfig.bgColor); |
| 260 | drawMainBorderWithTitle("Write iButton"); |
| 261 | padprintln("UID: " + bufferToHexStr(keyBuffer, 8)); |
| 262 | padprintln(""); |
| 263 | padprintln("Touch blank key to writer..."); |
| 264 | padprintln("[Esc] Cancel"); |
| 265 | |
| 266 | while (oneWire->reset() == 0) { |
| 267 | if (check(EscPress)) return; |
| 268 | delay(50); |
| 269 | } |
| 270 | |
| 271 | writeKey(); |
| 272 | displaySuccess("Key written!"); |
| 273 | delay(1500); |
| 274 | } |
| 275 | |
| 276 | static void doSave() { |
| 277 | if (!keyLoaded) { |
no test coverage detected