Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tc420/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from random import random, randint
from datetime import datetime
from typing import Callable, Tuple
from time import sleep

import click
import usb.core
Expand Down Expand Up @@ -290,6 +291,7 @@ def finalize(ctx: Context, _):
Finalize command chain
"""
if ctx.obj.mode_stop_neded:
sleep(0.01)
# Close mode commands
print("Finalizing modes...", end=" ", flush=True)
check_result(ctx.obj.dev.mode_stop())
Expand Down
4 changes: 4 additions & 0 deletions tc420/tc420.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datetime import datetime, time
from struct import pack, unpack
from time import time as timestamp
from time import sleep
import sys

from threading import Thread
Expand Down Expand Up @@ -327,6 +328,9 @@ def send(self, packet: TC420Packet, check=True) -> bool:
# It seems in case of error they just repeat the sent package from pos 2.
res = res_pkt.data_len == 1 and res_pkt.data == self.OK

# give time for processing even though it returned success, issue #9
sleep(0.01)

return res

def time_sync(self, date: datetime = None) -> bool:
Expand Down