- UsbCommand c = {CMD_SET_LF_DIVISOR, {strtol(Cmd, NULL, 0), 0, 0}};
- if (c.arg[0] < 19 || c.arg[0] > 255) {
- PrintAndLog("divisor must be between 19 and 255");
- } else {
- SendCommand(&c);
- PrintAndLog("Divisor set, expected freq=%dHz", 12000000 / (c.arg[0]+1));
- }
- return 0;
+ UsbCommand c = {CMD_SET_LF_DIVISOR, {strtol(Cmd, NULL, 0), 0, 0}};
+
+ if (c.arg[0] < 19 || c.arg[0] > 255) {
+ PrintAndLog("divisor must be between 19 and 255");
+ return 1;
+ }
+
+ clearCommandBuffer();
+ SendCommand(&c);
+ PrintAndLog("Divisor set, expected freq=%dHz", 12000000 / (c.arg[0]+1));
+ return 0;