This fixes the bug that the USB communication breaks when collecting PACE nonces with no delay. The delay functionality has not been removed (it doesn't hurt to keep it), but using a delay of 0 is now possible without a high risk of getting too many errors.
ack->arg[0] = step;
// last return code
ack->arg[1] = func_return;
-
- // send the USB packet
- UsbSendPacket((void *)ack, sizeof(UsbCommand));
// power down the field
EPA_Finish();
+
+ // send the USB packet
+ UsbSendPacket((void *)ack, sizeof(UsbCommand));
}
//-----------------------------------------------------------------------------