Paul Sokolovsky
bae052d420
examples/unix: Rename example be importable as modules.
...
Replace hyphens with undescores in modules.
2016-01-09 12:04:25 +02:00
Damien George
3b936a5f4c
tests: Fix math_fun_special test so it passes with single prec float.
2016-01-08 17:58:02 +00:00
Damien George
da3dffa79d
py/objint: Fix classification of float so it works for OBJ_REPR_D.
2016-01-08 17:57:30 +00:00
Damien George
2adf7ec3dd
py/mpz: Fix conversion of float to mpz so it works on big endian archs.
2016-01-08 17:56:58 +00:00
Damien George
b1fa907d56
tests: Allow float tests to run when MATH_SPECIAL_FUNCTIONS is disabled.
2016-01-08 14:27:21 +00:00
Damien George
978d2e55ef
py/runtime: Use appropriate printf fmt for malloc num_bytes.
2016-01-08 13:49:58 +00:00
Damien George
c1c57eafac
py/smallint: Allow to override MP_SMALL_INT_MIN et al.
...
This allows a port to specify exactly how many bits are in a small
int (eg for a uPy bytecode cross compiler).
2016-01-08 13:43:56 +00:00
Damien George
1fa6be5264
py/obj: For OBJ_REPR_D, use uint32_t cast when extracting qstr value.
2016-01-08 13:43:13 +00:00
Damien George
7dbf74c5b9
py/parse: Include unistd.h for ssize_t definition.
...
In some cases ssize_t is not defined by already included headers.
2016-01-08 13:42:00 +00:00
Damien George
1404d620c0
py/emitglue: Add more feature flags to .mpy persistent bytecode output.
...
Need to record in .mpy file whether unicode is enabled, and how many bits
are in a small int.
2016-01-08 13:35:35 +00:00
Paul Sokolovsky
adfe4ff72a
esp8266: Support CFLAGS_EXTRA.
2016-01-08 01:30:20 +02:00
Damien George
54729247e1
minimal: Add enough code to run minimal build on STM32F4xx hardware.
...
Minimal support code for a Cortex-M CPU is added, along with set-up
code for an STM32F4xx MCU, including a UART for a REPL. Tested on
a pyboard. Code size is 77592 bytes.
2016-01-07 17:43:07 +00:00
Damien George
dd0a0f79d7
py/viper: Truncate viper integer args so they can be up to 32-bit.
2016-01-07 16:48:20 +00:00
Damien George
daa1a455c6
stmhal: Remove custom mod_machine_mem_get_{read,write}_addr functions.
...
They are no longer needed because stm constants can now be 32 bits wide.
2016-01-07 16:34:11 +00:00
Damien George
2621f8a340
stmhal: Make stm constants big ints when they don't fit in a small int.
...
Adds 924 bytes of code, but means that no more hacks and work-arounds are
needed due to large constants becoming negative.
2016-01-07 16:34:11 +00:00
Damien George
ea8be373a9
py/inlinethumb: Remove 30-bit restriction on movwt instruction.
...
movwt can now move a full 32-bit constant into a register.
2016-01-07 16:34:11 +00:00
Damien George
47dc5922ca
py/inlinethumb: Allow assembler to use big ints as args to instructions.
2016-01-07 16:21:07 +00:00
Damien George
22b2265053
py/parse: Improve constant folding to operate on small and big ints.
...
Constant folding in the parser can now operate on big ints, whatever
their representation. This is now possible because the parser can create
parse nodes holding arbitrary objects. For the case of small ints the
folding is still efficient in RAM because the folded small int is stored
inplace in the parse node.
Adds 48 bytes to code size on Thumb2 architecture. Helps reduce heap
usage because more constants can be computed at compile time, leading to
a smaller parse tree, and most importantly means that the constants don't
have to be computed at runtime (perhaps more than once). Parser will now
be a little slower when folding due to calls to runtime to do the
arithmetic.
2016-01-07 14:40:35 +00:00
Damien George
d6b31e4578
py: Change mp_obj_int_is_positive to more general mp_obj_int_sign.
...
This function returns the sign (-1, 0 or 1) of the integer object.
2016-01-07 14:29:12 +00:00
Damien George
93b3726240
py/parse: Optimise away parse node that's just parenthesis around expr.
...
Before this patch, (x+y)*z would be parsed to a tree that contained a
redundant identity parse node corresponding to the parenthesis. With
this patch such nodes are optimised away, which reduces memory
requirements for expressions with parenthesis, and simplifies the
compiler because it doesn't need to handle this identity case.
A parenthesis parse node is still needed for tuples.
2016-01-07 13:07:52 +00:00
Henrik Sölver
67f40fb237
docs: Include extra functions in time documentation for pyboard.
2016-01-04 22:57:21 +00:00
Damien George
1d191fdf03
docs: Add link from pyboard switch tutorial to ISR rules document.
2016-01-04 16:18:44 +00:00
Damien George
43cab7c283
py/modbuiltins: Fix access of mp_obj_t variable, wrap in MP_OBJ_TO_PTR.
2016-01-04 14:19:33 +00:00
Damien George
d4df8f4925
py/objstr: In str.format, handle case of no format spec for string arg.
...
Handles, eg, "{:>20}".format("foo"), where there is no explicit spec for
the type of the argument.
2016-01-04 13:13:39 +00:00
Paul Sokolovsky
824f83fd20
docs: Set author as 'Damien P. George and contributors'.
2016-01-03 22:17:00 +02:00