MCPcopy Create free account
hub / github.com/BruceDevices/firmware / doWrite

Function doWrite

src/modules/others/ibutton.cpp:252–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250static void setAction(MenuAction a) { selectedAction = a; }
251
252static 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
276static void doSave() {
277 if (!keyLoaded) {

Callers 1

selectMenuOptionFunction · 0.85

Calls 9

displayErrorFunction · 0.85
drawMainBorderWithTitleFunction · 0.85
padprintlnFunction · 0.85
bufferToHexStrFunction · 0.85
checkFunction · 0.85
writeKeyFunction · 0.85
displaySuccessFunction · 0.85
fillScreenMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected