Rami Ali
65574f817a
tests/basics: Add tests to improve coverage of binary.c.
8 years ago
Damien George
ea6a958393
py/objint: Simplify mp_int_format_size and remove unreachable code.
One never needs to format integers with a base larger than 16 (but code
can be easily extended beyond this value if needed in the future).
8 years ago
Damien George
44bf8e1f2b
py/mpprint: Add assertion for, and comment about, valid base values.
8 years ago
Damien George
ca7af9a778
py/parsenum: Fix warning for signed/unsigned comparison.
8 years ago
Damien George
43384ad7e7
tests/basics: Add tests for parsing of ints with base 36.
8 years ago
Damien George
2d9440e2d1
py/mpz: Fix assertion in mpz_set_from_str which checks value of base.
8 years ago
Damien George
c2dd494bd9
py/parsenum: Simplify and generalise decoding of digit values.
This function should be able to parse integers with any value for the
base, because it is called by int('xxx', base).
8 years ago
Paul Sokolovsky
25f44c19f1
cc3200: Re-add support for UART REPL (MICROPY_STDIO_UART setting).
UART REPL support was lost in os.dupterm() refactorings, etc. As
os.dupterm() is there, implement UART REPL support at the high level -
if MICROPY_STDIO_UART is set, make default boot.py contain os.dupterm()
call for a UART. This means that changing MICROPY_STDIO_UART value will
also require erasing flash on a module to force boot.py re-creation.
8 years ago
Paul Sokolovsky
cf96be60dc
py/misc.h: Typo fix in comment.
8 years ago
Paul Sokolovsky
05aebb9206
tests/heapalloc_inst_call: Test for no alloc for simple object calls.
8 years ago
Paul Sokolovsky
492c612f9d
tests/utimeq_stable: Test for partial stability of utimeq queuing.
8 years ago
Paul Sokolovsky
7327966da7
extmod/modutimeq: Make time_less_than be actually "less than", not less/eq.
This fixes an obvious case of non-fair scheduling of 2 tasks with the same
deadline.
8 years ago
Paul Sokolovsky
18f12caafc
extmod/modutimeq: Fix printf in dump().
8 years ago
Paul Sokolovsky
1e9093f8cb
examples/hwapi/hwconfig_console: Don't alloc memory in value().
8 years ago
Paul Sokolovsky
1328833663
stmhal, esp8266: Enable utimeq module.
8 years ago
sergiuszm
ea426dd9ef
stmhal: Add support for STM32 Nucleo64 L476RG.
8 years ago
Damien George
e202b6f586
stmhal/sdcard: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
There is a minor functional change with this patch, that the GPIO are now
configured in fast mode, whereas they were in high speed mode before. But
the SDIO should still work because SD CK frequency is at most 25MHz.
8 years ago
Damien George
ed559de063
stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
8 years ago
Damien George
ffa30898cc
stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
8 years ago
Damien George
425150040c
stmhal/mphalport.h: Explicitly use HAL's GPIO constants for pull modes.
They are the same as the existing raw constants (namely 0, 1, 2) but we
want to explicitly show that one can use the HAL's constants if necessary
(eg the mpconfigboard.h files do use the HAL's constants to define the
pull state of certain configurable pins).
8 years ago
Damien George
b14abab9cd
stmhal/led: Properly initialise timer handle to zero before using it.
Without this the timer will have random values for its State and Lock
entries. The object can then be in a locked state leading to some HAL
functions returning immediately with an error code (which is unchecked).
This patch fixes such a bug which did manifest itself as PWM not working
correctly for LEDs.
8 years ago
Paul Sokolovsky
ffe807f349
extmod/moduheapq: Revert change for adhoc relative-time queue support.
Now that specialized utimeq module has been implenented, revert previous
adhoc changes to uheapq.
This reverts commit 0cbc07227c
.
8 years ago
Damien George
efa206d955
unix/Makefile: Make "coverage_test" target mirror Travis test actions.
8 years ago
Damien George
97f3797b82
travis: Include persistent bytecode with floats in coverage tests.
8 years ago
Damien George
cdec7ba30e
tests: Add a coverage test for printing the parse-tree.
8 years ago
Damien George
ebb8413178
unix/main: Allow to print the parse tree in coverage build.
Passing -v -v -v on the command line of the coverage build will now print
the parse tree (as well as other things at this verbosity level).
8 years ago
Damien George
c305ae3243
py/lexer: Permanently disable the mp_lexer_show_token function.
The lexer is very mature and this debug function is no longer used. If
it's really needed one can uncomment it and recompile.
8 years ago
Damien George
f4aebafe7a
py/lexer: Remove unnecessary check for EOF in lexer's next_char func.
This check always fails (ie chr0 is never EOF) because the callers of this
function never call it past the end of the input stream. And even if they
did it would be harmless because 1) reader.readbyte must continue to
return an EOF char if the stream is exhausted; 2) next_char would just
count the subsequent EOF's as characters worth 1 column.
8 years ago
Damien George
b9c4783273
py/lexer: Remove unreachable code in string tokeniser.
8 years ago
Damien George
adccafb42a
tests/basics/lexer: Add a test for newline-escaping within a string.
8 years ago
Paul Sokolovsky
1b44987d0c
extmod/modutimeq: Fix warning about unused param.
8 years ago
Paul Sokolovsky
64b1d5f878
unix: Enable utimeq module.
8 years ago
Paul Sokolovsky
5d9025a76e
tests/extmod: Add test for utimeq module.
8 years ago
Paul Sokolovsky
d02f6a9956
extmod/modutimeq: Refactor into optimized class.
import utimeq, utime
# Max queue size, the queue allocated statically on creation
q = utimeq.utimeq(10)
q.push(utime.ticks_ms(), data1, data2)
res = [0, 0, 0]
# Items in res are filled up with results
q.pop(res)
8 years ago
Paul Sokolovsky
ef23399e32
extmod/modutimeq: Copy of current moduheapq with timeq support for refactoring.
8 years ago
Rami Ali
1731868ae7
tests: Add tests to improve coverage of objarray.c.
8 years ago
Rami Ali
531c206e8b
tests: Add tests to improve coverage of runtime.c.
8 years ago
Damien George
46a6592f9a
py/emitglue: Refactor to remove assert(0), to improve coverage.
8 years ago
Damien George
e4af712125
py/objint: Rename mp_obj_int_as_float to mp_obj_int_as_float_impl.
And also simplify it to remove the check for small int. This can be done
because this function is only ever called if the argument is not a small
int.
8 years ago
Damien George
67f3edc10a
tests/import: Add a test which uses ... in from-import statement.
8 years ago
Paul Sokolovsky
9af73bda33
esp8266: Force relinking OTA firmware image if built after normal one.
8 years ago
Paul Sokolovsky
c1e94b77a4
esp8266/modesp: flash_user_start(): Support configuration with yaota8266.
It's pretty rough way to detect yaota8266 being used, but otherwise allows
to have a filesystem in such config.
8 years ago
Rami Ali
5d06a74303
tests/basics: Improve test coverage for generators.
8 years ago
Damien George
1e7a801e2d
tests/run-tests: For REPL tests make sure the REPL is exited at the end.
8 years ago
Damien George
7bbce4e213
tests/basics/set_pop: Improve coverage of set functions.
8 years ago
Damien George
b470f59892
tests/basics: Add test for builtin locals().
8 years ago
Damien George
d291007fea
tests/basics/builtin_dir: Add test for dir() of a type.
8 years ago
Damien George
49bf7617d0
tests/float/builtin_float_round: Test round() with second arg.
8 years ago
Damien George
7318949c46
py/modbuiltins: Remove unreachable code.
8 years ago
Damien George
0d32f1aeb3
esp8266: When doing GC be sure to trace the memory holding native code.
Native code can hold pointers to objects on the heap, eg constant objects
like big integers.
8 years ago