diff options
| author | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-10-04 21:45:04 +0200 |
|---|---|---|
| committer | Glenn Ruben Bakke <glennbakke@gmail.com> | 2017-10-04 21:45:04 +0200 |
| commit | bcab2ba0a80297100919366add6bada140c6ed75 (patch) | |
| tree | 5133218f4fc010d5688f006dbdd1e2f346a843f7 /lib | |
| parent | 4468731e3d039a3f72ac25aa43e936cf5ebb3f78 (diff) | |
| parent | f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c (diff) | |
ports/nrf: Upmerging port with upstream master
Diffstat (limited to 'lib')
| m--------- | lib/berkeley-db-1.xx | 0 | ||||
| -rw-r--r-- | lib/embed/abort_.c | 2 | ||||
| -rw-r--r-- | lib/libm/math.c | 7 | ||||
| -rw-r--r-- | lib/netutils/netutils.c | 5 | ||||
| m--------- | lib/stm32lib | 0 | ||||
| -rw-r--r-- | lib/utils/pyexec.c | 1 |
6 files changed, 9 insertions, 6 deletions
diff --git a/lib/berkeley-db-1.xx b/lib/berkeley-db-1.xx -Subproject dab957dacddcbf6cbc85d42df62e189e4877bb7 +Subproject 35aaec4418ad78628a3b935885dd189d41ce779 diff --git a/lib/embed/abort_.c b/lib/embed/abort_.c index a6df8143c..2fba0de4e 100644 --- a/lib/embed/abort_.c +++ b/lib/embed/abort_.c @@ -3,5 +3,5 @@ NORETURN void abort_(void); NORETURN void abort_(void) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_RuntimeError, "abort() called")); + mp_raise_msg(&mp_type_RuntimeError, "abort() called"); } diff --git a/lib/libm/math.c b/lib/libm/math.c index 984636627..5e00740d1 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -61,7 +61,12 @@ float log2f(float x) { return logf(x) / (float)_M_LN2; } static const float _M_LN10 = 2.30258509299404; // 0x40135d8e float log10f(float x) { return logf(x) / (float)_M_LN10; } -float tanhf(float x) { return sinhf(x) / coshf(x); } +float tanhf(float x) { + if (isinf(x)) { + return copysignf(1, x); + } + return sinhf(x) / coshf(x); +} /*****************************************************************************/ /*****************************************************************************/ diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index a32452161..06c3ff9b0 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -29,8 +29,7 @@ #include <stdio.h> #include <string.h> -#include "py/obj.h" -#include "py/nlr.h" +#include "py/runtime.h" #include "lib/netutils/netutils.h" // Takes an array with a raw IPv4 address and returns something like '192.168.0.1'. @@ -80,7 +79,7 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian } else if (i > 0 && s < s_top && *s == '.') { s++; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid arguments")); + mp_raise_ValueError("invalid arguments"); } } } diff --git a/lib/stm32lib b/lib/stm32lib new file mode 160000 +Subproject d2bcfda543d3b99361e44112aca929225bdcc07 diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index d3500b42b..1e99aa649 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -29,7 +29,6 @@ #include <stdint.h> #include <string.h> -#include "py/nlr.h" #include "py/compile.h" #include "py/runtime.h" #include "py/repl.h" |
