Commit Graph

7725 Commits

Author SHA1 Message Date
Damien George
43384ad7e7 tests/basics: Add tests for parsing of ints with base 36. 2016-12-28 12:08:46 +11:00
Damien George
2d9440e2d1 py/mpz: Fix assertion in mpz_set_from_str which checks value of base. 2016-12-28 12:04:19 +11:00
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).
2016-12-28 12:02:49 +11:00
Glenn Ruben Bakke
d2969048ff nrf5/modules: Adding a function to get access to the SD card flash drive on the seeedstudio tft shield. 2016-12-27 16:05:49 +01:00
Glenn Ruben Bakke
cceea0a504 nrf5/modules: Adding new python script to initialize and clear the display on Seeedstudio 2.8 TFT Touch Shield v2. 2016-12-27 15:47:55 +01:00
Glenn Ruben Bakke
db994e2ec0 nrf5/modules: Updating documentation on sdcard.py copy to use new params in the example description 2016-12-27 15:44:39 +01:00
Glenn Ruben Bakke
9197739cf4 nrf5/modules: Updating mountsd, SD card test script with new params. 2016-12-27 15:42:35 +01:00
Glenn Ruben Bakke
d6300a2e82 nrf5/pin: Merging input and output pin configuration to one comon function. Adding implementation in Pin class to be able to configure mode and pull. Updating drivers which uses gpio pin configuration to use new function parameters. 2016-12-27 15:40:20 +01:00
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.
2016-12-27 01:05:37 +03:00
Paul Sokolovsky
cf96be60dc py/misc.h: Typo fix in comment. 2016-12-27 01:05:30 +03:00
Glenn Ruben Bakke
4fee95c468 nrf5: Adding rtc.c which implements the machine rtc module to be included in build. 2016-12-26 16:53:24 +01:00
Glenn Ruben Bakke
46ddf2ed70 nrf5/boards: Enable MICROPY_PY_MACHINE_RTC in pca10028 (nrf51) and pca10040 (nrf52) targets. 2016-12-26 16:50:59 +01:00
Glenn Ruben Bakke
c2d2958205 nrf5/hal: Adding empty init function in hal_rtc.c 2016-12-26 16:49:27 +01:00
Glenn Ruben Bakke
22c62fb53f nrf5/hal: Adding structures and init function prototype to hal_rtc.h. 2016-12-26 16:48:56 +01:00
Glenn Ruben Bakke
d78d717733 nrf5: Setting MICROPY_PY_MACHINE_RTC to disabled by default (during development) in mpconfigport.h. This can be overriden by board config. 2016-12-26 16:47:56 +01:00
Glenn Ruben Bakke
bab030d793 nrf5/rtc: Adding skeleton for machine rtc module for nrf51/52. 2016-12-26 16:46:23 +01:00
Glenn Ruben Bakke
d79588ddf4 nrf5: Adding timer.c which implements the machine timer module to be included in build. 2016-12-26 16:20:36 +01:00
Glenn Ruben Bakke
a3cc6abba6 nrf5: Setting MICROPY_PY_MACHINE_TIMER to disabled by default (during development) in mpconfigport.h. This can be overriden by board config. 2016-12-26 16:19:48 +01:00
Glenn Ruben Bakke
8e7f9d7c38 nrf5/boards: Enable MICROPY_PY_MACHINE_TIMER in pca10028 (nrf51) and pca10040 (nrf52) targets. 2016-12-26 16:18:16 +01:00
Glenn Ruben Bakke
e4365fcac4 nrf5: Adding initialization of timer module if enabled by MICROPY_PY_MACHINE_TIMER. 2016-12-26 16:15:26 +01:00
Glenn Ruben Bakke
9c828c7630 nrf5/timer: Adding initializaton of id field for Timer_HandleTypeDef's. Adding simple print function. Adding make_new function. Enabling the functions in machine_timer_type. 2016-12-26 16:13:09 +01:00
Glenn Ruben Bakke
53fdcf91d7 nrf5/hal: Adding empty init function in hal_timer.c 2016-12-26 16:08:59 +01:00
Glenn Ruben Bakke
9b084fc376 nrf5/hal: Adding structures and init function prototype to hal_timer.h. 2016-12-26 16:08:22 +01:00
Glenn Ruben Bakke
8cce985765 nrf5/timer: Adding skeleton for machine timer module for nrf51/52. 2016-12-26 14:03:50 +01:00
Glenn Ruben Bakke
5c327f2f2f nrf/boards: Adding RTC and TIMER hal to be linked in when implemented. Enable one board for nrf51 and one for nrf52 for ease of debugging when implementing the hal. 2016-12-25 18:15:32 +01:00
Glenn Ruben Bakke
1e79ccf305 nrf5: Adding rtc and timer hal to Makefile. 2016-12-25 18:12:51 +01:00
Glenn Ruben Bakke
1264122e76 nrf5/hal: Adding skeleton files for rtc and timer driver. 2016-12-25 18:10:31 +01:00
Paul Sokolovsky
05aebb9206 tests/heapalloc_inst_call: Test for no alloc for simple object calls. 2016-12-25 00:50:27 +03:00
Glenn Ruben Bakke
c1c78404b6 nrf5/modules: Updating pulse example to work with Pin object instead of hard coded pin number. 2016-12-24 01:16:23 +01:00
Glenn Ruben Bakke
d759123886 nrf5/pwm: Switching from hardcoded pin number to Pin object type as input to the new() function. Also changing the parameter from kw to arg. 2016-12-24 01:15:37 +01:00
Glenn Ruben Bakke
3191a31ce8 nrf5/modules: updating test python file with correct PWM frequency type. 2016-12-24 00:30:35 +01:00
Paul Sokolovsky
492c612f9d tests/utimeq_stable: Test for partial stability of utimeq queuing. 2016-12-24 00:25:15 +03:00
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.
2016-12-24 00:06:29 +03:00
Paul Sokolovsky
18f12caafc extmod/modutimeq: Fix printf in dump(). 2016-12-23 21:11:19 +03:00
Paul Sokolovsky
1e9093f8cb examples/hwapi/hwconfig_console: Don't alloc memory in value(). 2016-12-23 17:24:24 +03:00
Paul Sokolovsky
1328833663 stmhal, esp8266: Enable utimeq module. 2016-12-23 14:49:13 +03:00
sergiuszm
ea426dd9ef stmhal: Add support for STM32 Nucleo64 L476RG. 2016-12-22 17:45:50 +11:00
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.
2016-12-22 14:55:26 +11:00
Damien George
ed559de063 stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init. 2016-12-22 14:55:26 +11:00
Damien George
ffa30898cc stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init. 2016-12-22 14:55:26 +11:00
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).
2016-12-22 14:55:26 +11:00
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.
2016-12-22 14:55:26 +11:00
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.
2016-12-22 06:37:49 +03:00
Damien George
efa206d955 unix/Makefile: Make "coverage_test" target mirror Travis test actions. 2016-12-22 11:28:29 +11:00
Damien George
97f3797b82 travis: Include persistent bytecode with floats in coverage tests. 2016-12-22 11:27:35 +11:00
Damien George
cdec7ba30e tests: Add a coverage test for printing the parse-tree. 2016-12-22 11:26:06 +11:00
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).
2016-12-22 10:56:11 +11:00
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.
2016-12-22 10:49:54 +11:00
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.
2016-12-22 10:39:06 +11:00
Damien George
b9c4783273 py/lexer: Remove unreachable code in string tokeniser. 2016-12-22 10:37:13 +11:00