Damien George
0e3f29cc99
py: Check that second argument to hasattr is actually a string.
Fixes issue #1623 .
9 years ago
Damien George
a8aa1998ce
extmod/modure: Use correct integer type for n_args argument.
9 years ago
Damien George
44e6e348d6
py/emitglue: Implement persistent saving and loading of const objects.
9 years ago
Damien George
39a8deb95f
py/emitglue: Add feature-flag header to .mpy to detect bytecode compat.
Loading .mpy files will now check to make sure that the target VM can
support the bytecode.
9 years ago
Paul Sokolovsky
9f10d3fb63
unix/main: Get rid of perror() which uses stdio.
9 years ago
Paul Sokolovsky
4120f32292
tests/int_big_*: Add more tests for result normalization.
Tested by comparability to small int/casting to bool.
9 years ago
Paul Sokolovsky
b3be4710aa
py/mpz: Normalize (remove leading zeros) xor operation result.
9 years ago
Paul Sokolovsky
b56c635d64
tests/int_big_xor: Test that xor result is normalized.
And thus can be successfully used in comparisons, etc.
9 years ago
Paul Sokolovsky
3d6240ba1b
py/formatfloat: Handle calculation of integer digit for %f format properly.
%f prints true integer digit, so its calculation should happen before any
exponential scaling.
9 years ago
Paul Sokolovsky
3c4c069802
py/formatfloat: Workaround (fix?) incorrect rounding for %f format.
9 years ago
Paul Sokolovsky
b64e0575fd
tests/float/string_format: Add testcase for incorrect rounding for %f.
9 years ago
Paul Sokolovsky
9aaccd4735
py/formatfloat: Convert to fully portable implementation.
This takes previous IEEE-754 single precision float implementation, and
converts it to fully portable parametrizable implementation using C99
functions like signbit(), isnan(), isinf(). As long as those functions
are available (they can be defined in adhoc manner of course), and
compiler can perform standard arithmetic and comparison operations on a
float type, this implementation will work with any underlying float type
(including types whose mantissa is larger than available intergral integer
type).
9 years ago
Paul Sokolovsky
1818da2ef3
lib/utils/printf: Fix issue with putchar define for some ports.
9 years ago
Paul Sokolovsky
8ee43e24f3
lib/utils/printf: Add extra prototypes.
9 years ago
Paul Sokolovsky
c3280d83e7
unix: Use printf() implementation in terms of mp_printf().
In other words, unix port now uses overriden printf(), instead of using
libc's. This should remove almost all dependency on libc stdio (which
is bloated).
9 years ago
Paul Sokolovsky
ede1f547e7
unix/modsocket: Use snprintf(), as defined by lib/utils/printf.c.
9 years ago
Paul Sokolovsky
295ea12411
py/emitglue: Host definition of mp_verbose_flag.
This may not seem like the ideal place, but is actually the only place
in py/ where it gets referenced, so is just right.
9 years ago
Paul Sokolovsky
72bd172b30
py/modsys: Consistently use indented #if's.
9 years ago
Paul Sokolovsky
3ba61656bd
unix/modsocket: Implement sockaddr() function to decode raw socket address.
Return tuple of (address_family, net_addr, [port, [extra_data]]). net_addr
is still raw network address as bytes object, but suitable for passing to
inet_ntop() function. At the very least, sockaddr() will separate address
family value from binary socket address (and currently, only AF_INET family
is decoded).
9 years ago
Paul Sokolovsky
2ae7ced721
unix/modsocket: Removed dangling references to sockaddr_in_type.
9 years ago
Paul Sokolovsky
acb743da64
unix/modffi: Mark 'O' type specifier as implemented.
9 years ago
Damien George
83229d3ffe
py: Use MP_OBJ_NULL instead of NULL when appropriate.
9 years ago
Damien George
54df549b5f
unix/moduselect: Initialise variable so can compile in non-debug mode.
9 years ago
Damien George
b5b1f2c527
py/emitglue: Add mp_raw_code_load_mem to load raw-code from memory.
9 years ago
Damien George
f148727b78
py/emitglue: Only compile raw-code fatfs loader when on thumb2 platform.
Here we are assuming that a thumb2 port will have fatfs, which is only
roughly true. We need a better way of enabling specific raw-code file
readers.
9 years ago
Damien George
d4dba88236
py/compile: Add mp_compile_to_raw_code() to return raw code object.
This can then be passed to mp_raw_code_save_file to save a .mpy file.
9 years ago
Igor Gatis
f5c554dfe3
py: Added Cygwin support to py/nlrx86.S.
9 years ago
Damien George
593faf14c4
py/map: Store key/value in earliest possible slot in hash table.
This change makes the code behave how it was supposed to work when first
written. The avail_slot variable is set to the first free slot when
looking for a key (which would come from deleting an entry). So it's
more efficient (for subsequent lookups) to insert a new key into such a
slot, rather than the very last slot that was searched.
9 years ago
danicampora
db0a5aed39
cc3200: Bump version to 1.1.1.
9 years ago
danicampora
efc4da4be9
cc3200/README.md: Correct cc3200's update file name.
9 years ago
Chris Liechti
426f326d35
docs/wipy: Make wifi/wlan naming consistent with tutorial.rst.
9 years ago
Jason Hildebrand
9142179f81
docs/wipy: Add warning about losing wlan connection when changing mode.
Also provide workarounds, link to other revelant sections,
and fix some typos.
9 years ago
Gary Ashton-Jones
7080e9632c
cc3200/appsign.sh: Use md5 if running under Darwin.
9 years ago
Noah
00960133c2
docs: Update docs for WiPy wlan.connect().
- The link establishment timeout is infinite by default
- Fix typo in notes about the auth kwarg
9 years ago
Dave Hylands
f3308daa6f
docs/wipy: Fixed some typos in the WiPy's tutorials.
9 years ago
Damien George
994ff738c8
py/mpstate: Make mp_pending_exception volatile.
It can change asynchronously.
9 years ago
Damien George
a24eafacc9
py/modmath: Make log2, log10 and hyperbolic funcs be SPECIAL_FUNCTIONS.
Will be included only when MICROPY_PY_MATH_SPECIAL_FUNCTIONS is enabled.
Also covers cmath module (but only log10 is there at the moment).
9 years ago
Damien George
2c83894257
py: Implement default and star args for lambdas.
9 years ago
Damien George
cbd9ae5256
py/compile: Don't unnecessarily save state when compiling param list.
Parameter lists can't be nested so there is no need to save the global
state when compiling them.
9 years ago
danicampora
e4404fbef0
cc3200: Unmount all user file systems after a soft reset.
9 years ago
Paul Sokolovsky
65971f5160
unix: Add "uselect" module, with poll() function.
Underlyingly, uses standard POSIX poll() for portability.
9 years ago
Paul Sokolovsky
79c4ec1102
unix/input: Switch to POSIX I/O for history reading/writing.
9 years ago
Paul Sokolovsky
f8bc3f6964
tools: Update to upip 0.6.2. Fixes issue due to MacOSX undocumented behavior.
9 years ago
Paul Sokolovsky
3862ef9a9f
tools: Update upip to 0.6.1. Fixes normal installs without -p switch.
9 years ago
Paul Sokolovsky
ec314c951d
unix/modos: getenv(): Handle non-existing envvar correctly.
9 years ago
Paul Sokolovsky
16d42368a6
stmhal/modmachine: Initial attempt to add I2C & SPI classes.
In new hardware API, these classes implement master modes of interfaces,
and "mode" parameter is not accepted. Trying to implement new HW API
in terms of older pyb module leaves variuos corner cases:
In new HW API, I2C(1) means "I2C #1 in master mode" (? depends on
interpretation), while in old API, it means "I2C #1 , with no settings
changes".
For I2C class, it's easy to make mode optional, because that's last
positional param, but for SPI, there's "baudrate" after it (which
is inconsistent with I2C, which requires "baudrate" to be kwonly-arg).
9 years ago
Paul Sokolovsky
908f5159cf
unix/modos: Add Windows workaround for mkdir().
9 years ago
stijn
5be60d6929
windows: Define ssize_t and use renamed mphal header
This fixes the build after changes in [66fd3e4
] and [3a6b3d2
]
9 years ago
Paul Sokolovsky
863d4cd862
py/modmath: Don't create symbol entry for expm1() if not needed.
9 years ago
Paul Sokolovsky
0d6116d86b
py/modmath: Make expm1() be in MICROPY_PY_MATH_SPECIAL_FUNCTIONS.
9 years ago