Commit Graph

98 Commits

Author SHA1 Message Date
Émilie Feral
3f6647f3ae [ion][python] Implement an architecture-dependant collect_registers.
setjmp is not guaranteed to collect all registers without modification
on all platforms.

This fixes the following bug: when the pointer of a newly allocated
object on the Python heap is stored in rpb registers on x86_64 arch, it
was not collected by the garbarge collector.
2020-05-18 14:39:46 +02:00
Romain Goyet
240e60cb68 [liba] Include strlcat in the bridge too 2020-04-15 09:16:32 -04:00
Romain Goyet
cbb0110c2f [liba] Define UINT8_MAX
This will be needed in python to check that some QSTRs aren't too big.
And it doesn't cost anything to add it straight away.
2020-04-14 01:17:25 -07:00
Léa Saviot
2ed354710f [build/simulator] NDEBUG flag in release mode
This way, asserts are not performed on simulator platforms
2020-04-10 00:49:15 -07:00
Romain Goyet
a840e7fb05 [liba] Define SEEK_CUR
For some reason it was defined in Python and raised re-def errors
2020-04-06 09:51:04 +02:00
Jacob Young
a8783fe21f Remove a duplicate function, cleanup sorting and use consistent argument names in math.h.
Add missing math.h tests and make each test a single line for easier comparison with math.h.
Add missing cmath undefs and functions and use constexpr instead of static.
2020-03-16 15:00:40 +01:00
Romain Goyet
02a19fc83d [liba] Add strlcat 2020-02-17 10:31:24 -05:00
Léa Saviot
0a21ed2cfb [liba] strlcpy third argument in size, not length 2020-02-12 15:13:17 +01:00
Léa Saviot
0a1c6a3d1d [poincare/tree_pool] Store node offsets, not node pointers
This saves place because we store uint16_t, not uint32_t
2020-02-12 15:13:16 +01:00
Romain Goyet
9db16997af [liba] Update the bool type to use _Bool
_Bool is defined in C99 which we use already. In practice it's 1 byte
just like char, so this shouldn't have any impact on the built object.

But this patch removes LTO errors when linking C code with C++ code.
Indeed, the linker would raise type mismatch because in C++ bool is
defined to _Bool whereas in C it would be defined to char.
2019-09-18 10:52:20 +02:00
Léa Saviot
a450ce3855 Merge branch 'master' into f7 2019-08-06 17:40:14 +02:00
Ruben Dashyan
f8fd654157 [liba/stdint] Define int16_t limits 2019-07-30 14:15:08 +02:00
Romain Goyet
d8199ff186 [liba] Define calloc
To silence a warning in LZ4. The code is not even built.
2019-05-28 16:47:03 +02:00
Ruben Dashyan
efde8c6c9e [liba] Add strncmp 2018-11-23 12:04:05 +01:00
Romain Goyet
fc80180d46 [liba] Define ptrdiff_t 2018-10-19 10:59:17 +02:00
Émilie Feral
e7619633bd [liba] Add fmax in math.h header 2018-07-18 16:32:49 +02:00
Émilie Feral
2a05247629 [liba] Add hypot in math.h header 2018-07-18 16:32:49 +02:00
Romain Goyet
55e4c955f4 Upgrade to MicroPython 1.9.3 2018-04-09 14:43:15 +02:00
Léa Saviot
92789330de [code] Search function in the code Toolbox.
When the user types a letter, the toolbox scrolls to the first row that begins
with said letter (without considering if it is lower or upper case). If
there is not such a row, the toolbox scrolls to the first row that has a
letter higher than the typed letter.

Change-Id: I353d23560d8a4d618d96426c393b024e7fb487af
2017-11-21 17:30:04 +01:00
Léa Saviot
fe3d470d2d [liba] Fixed Gamma function bug.
There was a problem with the definition of ldexp, used in b_log__D.c

Change-Id: I83d012815e38b76efa730c1a3d259ec276e15f11
2017-11-17 14:05:23 +01:00
Léa Saviot
5de4b5cd67 [code] Each script has a name, stored in the accordeon buffer.
A script can now be imported in the console.
Moved all the MicroPython functions to python/port files.

Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7
2017-11-17 11:59:50 +01:00
Romain Goyet
f265822792 [liba] Add extra math functions (erf erfc log2 logb tgamma rint scalb) 2017-11-17 11:59:49 +01:00
Romain Goyet
0ca52e201f [liba] Add extra libm symbols (ldexp, fmod, trunc, atan2) 2017-11-17 11:59:49 +01:00
Romain Goyet
b9e83231e6 [liba] Add extra math functions (frexpf, modff, truncf) 2017-11-17 11:59:49 +01:00
Romain Goyet
e46d157fe6 Add a bridge for a missing alloca.h on windows 2017-11-12 02:10:19 +01:00
Romain Goyet
b671a812e1 [liba] Mark abort() as noreturn
Fix #213
2017-10-20 19:59:45 +02:00
Romain Goyet
5a2446eff7 [liba] Proper support for function-like macros for math functions 2017-10-19 17:31:40 +02:00
Jacob Young
da1e66e798 Fix #115 by fixing the math.h and cmath includes. 2017-10-13 18:08:15 +02:00
Émilie Feral
feeec6b826 [escher] Add behaviour for end and origin events
Change-Id: I363dad3c566289a285179a9f26d3a779f0ff812f
2017-09-27 10:28:16 +02:00
Jacob Young
4d9e8c40b8 Fix #102. 2017-09-21 13:32:27 +02:00
Jacob Young
7e2cc375d2 Fix potential overflow in complex radius calculation. 2017-09-20 12:04:35 +02:00
Jacob Young
2a2112396e ARM only has 32-bit integer registers, so using types smaller than 32-bits produces larger/slower code. 2017-09-18 15:13:00 +02:00
Émilie Feral
9ac25fc03a Repair windows build 2017-09-06 10:05:17 +02:00
Émilie Feral
925f404382 [liba] Add aeabi long conversion 2017-08-31 15:17:22 +02:00
Émilie Feral
6b783346cc [liba] Add setjmp and longjmp
Change-Id: I3a57787199308900de8e7c6ce5961b2a26f6d38e
2017-08-25 11:20:49 +02:00
Émilie Feral
818c56bd45 [python] Enable float
Change-Id: I94111dd821fb3a9ef1e22ae5133c3a48285c52d5
2017-08-25 11:20:49 +02:00
Émilie Feral
1964d61fdc [libaxx] add cmath and use cmath instead of math.h when required
Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
2017-08-16 09:55:29 +02:00
Émilie Feral
9f0bbe0e75 [liba] Avoid implicit declarations
Change-Id: I4ee85185a2a35550b7dcdec383a8335423ac1156
2017-08-16 09:55:29 +02:00
Émilie Feral
44328a9faa [liba] Expose copysign libm function
Change-Id: Ib38f94a9bab141c5ed417d5ea2cf654aef9179f5
2017-08-16 09:55:28 +02:00
Émilie Feral
f8f81505bc [liba] Add DBL_MAX, DBL_MIN, DBL_EPSILON
Change-Id: Ib7f3e170c5305269624410b0464d44a16d961aa3
2017-08-09 16:42:13 +02:00
Romain Goyet
741eaba19a [liba] Add empty setjmp.h and limits.h
MicroPython requires them but, in our case, doesn't use them.

Change-Id: Ide003974c71accb1e9cc42f0839f1f64d07b0390
2017-08-04 17:56:23 +02:00
Romain Goyet
159b6f7429 [liba] Add strchr to string.h
Change-Id: I6651daa030ad6dc5e567bb78f2f22d48f07524aa
2017-08-04 17:56:23 +02:00
Romain Goyet
3ef709502e [liba] Add memcmp to strings.h
Change-Id: Ied4281e588d423e2b00dced10018a690455544d5
2017-08-04 17:56:23 +02:00
Romain Goyet
2898ec916c [liba] Add memmove to string.h
Change-Id: I99b412dc7404e2711dbf7753f0d619694dee3d19
2017-08-04 17:56:23 +02:00
Romain Goyet
301e0a7891 [liba] Add alloca.h
Change-Id: I190dd8a0836a60fa95cd159f6f636f7850fe7b63
2017-08-04 17:56:23 +02:00
Romain Goyet
c5d917c360 [liba] Cleaner __builtin-based defines
Change-Id: I4b58ab36f25e9cb136c21375166921c04882dd21
2017-08-04 17:56:23 +02:00
Romain Goyet
1972b30a77 [liba] Support for variadic functions (va_arg)
Change-Id: Ic4ea2bce521ad8149198433afe74214018998afc
2017-08-04 17:56:23 +02:00
Romain Goyet
878d86df71 [liba] Add intptr_t and uintptr_t to stdint.h
Change-Id: I7bb28aa1d449da0413c751e66e69f17dc9492d8f
2017-08-04 17:56:23 +02:00
Romain Goyet
15725a5cc8 [liba] Add ENOENT to errno.h
Change-Id: Ie25fae6abff7c384ee7bea02aa1d2dbba82c06c4
2017-08-04 17:55:53 +02:00
Romain Goyet
c8e2b0d2be [liba] Define ssize_t and offsetof
Change-Id: Icbf546cd09f4e3c3e849f830bb3c60ffa3c13b6c
2017-08-04 17:55:53 +02:00