The CC3100 only allows to set a timeout for receiving data, not for accept,
connect or send. But it can set non-blocking for all these operations and
this patch uses that feature to implement socket timeout in terms of non-
blocking behaviour combined with a loop.
Also, rename Direction.IN to Direction.INPUT and Direction.OUT to Direction.OUTPUT.
This simplifies using them. Prior to the nativeio split this would have led to
clutter in the top-level namespace but having digitalio prevents this.
Fixes#152
This method follows the new HW API and allows to set a hard or soft IRQ
callback when a Pin has a level change. It still remains to make this
method return a IRQ object.
In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order. To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
These implementations are incorrect (eg f2d and d2f don't handle special
values like 0.0) and proper versions can be provided by libgcc (or
equivalent depending on the toolchain).
libgcc is now linked with the stmhal port so that library will provide
these functions from now on.
The latest fashion is pushing certificate sub-chains, instead of a single
certificate, during TLS handshake. These are pushed via single TLS record
and effectively put minimum size limit on TLS record buffer. Recently,
these commonly grew over 4K, so we have little choice but to adjust.
This patch fixes 2 things when printing a floating-point number that
requires rounding up of the mantissa:
- retain the correct precision; eg 0.99 becomes 1.0, not 1.00
- if the exponent goes from -1 to 0 then render it as +0, not -0
A previous fix improved the duty_cycle channel value computation by
removing the reliance on the PER register which gave old values. It
saved the period on the object but failed to set anything for reused
timers. So, this breaks it out into a separate array that can be
shared across all object regardless of whether it used a new or
existing timer.
Baremetal ports standardized on providing localtime(). localtime() offers
more functionality, in particular, strftime() can be completely implemented
in Python with localtime().
This fixes a hard lock that happens when using a second channel on an
in use TCC. The lock occurred when setting the duty cycle on the channel
because the hw address was not available to ASF.
Thanks to @ladyada for finding the bug.
rather than 24bit. Setting the period for more than a 16bit number
caused the TCC to be in a weird state where resetting it would hard
crash.
Fixes#153