Commit Graph

5 Commits

Author SHA1 Message Date
Pavol Rusnak 18d8cb3c56
add project website (trezor.io) to license header 2017-11-05 17:47:23 +01:00
Saleem Rashid 25b9bfd97b timer: Use Cortex-M3 SysTick timers
Removed `usbDelay(uint32_t cycles)`, added `usbSleep(uint32_t millis)`

The same method signature could cause silent code breakage at runtime,
as opposed to noisy code breakage at compile time which is the better
kind.
2016-11-17 02:07:46 +01:00
Jochen Hoenicke 9287dd7e04
Poll USB during BIP39 derivation.
This patch adds calls to usbPoll in the progress callback.  This
should address #98.

We call usbDelay instead of Poll, to call usbd_poll several times.
Otherwise it would only handle one event instead of handling all
events that were pending so far.  The ugly magic number 5 is a guess.

Note that we also need to set usbTiny, so that we don't recursively
process messages.  Since we don't know whether usbTiny is set, we
need to store the old value (especially true for u2f).

This fix also relies on another fix in libopencm3.
2016-11-09 16:17:50 +01:00
Jochen Hoenicke 218b9984bb New usbDelay that delays and handles USB requests
Added usbDelay that polls usb port (for system requests) while delaying.
This is called instead of delay in the button and pin delay functions.
Experimental evaluation gave that the cycle count should be roughly divided
by 28.5.
2015-04-29 19:10:48 +02:00
Pavol Rusnak 0d0a1ab5f2 import v1.0.0 2014-04-29 14:38:32 +02:00