Commit Graph

3038 Commits

Author SHA1 Message Date
Damien George 8865b22b51 Merge pull request #501 from dhylands/fix-gen-fail
Remove generated .h file if the generation process fails.
2014-04-17 00:25:29 +01:00
Damien George b08f9212e2 Merge pull request #500 from dhylands/fix-sdcard-removed
Fix to allow usbd_msc_storage.c to compile when MICROPY_HW_HAS_SDCARD is...
2014-04-17 00:23:43 +01:00
Damien George 7447e80f3d tests: Remove print('flush') from 2 tests, since stmhal now works.
Fixing the USB problem on stmhal now gets these 2 tests working.
2014-04-17 00:14:05 +01:00
Damien George 89831d0289 stmhal: Add more math functions.
Taken straight from musl and newlib.  License seems compatible with MIT.
2014-04-17 00:13:13 +01:00
Damien George efc22e376f stmhal: Fix 64-byte USB packet bug properly.
A 64-byte packet is now followed by a 0-byte packet if there is nothing
more to send.  This flushes the USB endpoint.
2014-04-17 00:12:07 +01:00
Damien George 28817725fc stmhal: Replace magic number 3 with CDC_IN_EP define. 2014-04-16 23:17:29 +01:00
Damien George 3f2f28981b Merge branch 'master' of github.com:micropython/micropython 2014-04-16 23:13:11 +01:00
Damien George 6d983539bc stmhal: Improve flash storage cache management.
Internal flash used for the filesystem is now written (from the cache)
only after a 5s delay, or when a file is closed, or when the drive is
unmounted from the host.  This delay means that multiple writes can
accumulate in the cache, and leads to less writes to the flash, making
it last longer.

It's implemented by a high-priority interrupt that takes care of flash
erase and write, and flushing the cache.

This is still only an interim solution for the flash filesystem.  It
eventually needs to be replaced with something that uses less RAM for
the cache, something that can use more of the flash, and something that
does proper wear levelling.
2014-04-16 23:08:36 +01:00
Paul Sokolovsky 3a83b805fc nlr: Add implementation using setjmp/longjmp.
Having an optimized asm implementation is good, but if we want portability,
that's it.
2014-04-17 00:19:18 +03:00
Andrew Scheller 70a7d7a943 build directory can now be renamed
The autogenerated header files have been moved about, and an extra
include dir has been added, which means you can give a custom
BUILD=newbuilddir option to make, and everything "just works"

Also tidied up the way the different Makefiles build their include-
directory flags
2014-04-16 22:16:28 +01:00
Andrew Scheller 6ca17bcfb6 Stupid typo 2014-04-16 21:17:28 +01:00
Andrew Scheller d5ce916f26 Add 'test' target to unix/Makefile
In conjunction with #504 this allows you to do things like:
```shell
make -C unix clean && make -C unix test CC=gcc-4.7
```
all from the top-level micropython directory :-)

Something similar could probably be done for windows/Makefile too, but I don't have a cygwin setup to test with.
2014-04-16 20:38:16 +01:00
Paul Sokolovsky a1c67206c8 Merge pull request #503 from lurch/patch-1
fix tests/bytecode/README to match contents of tests/bytecode/run-tests
2014-04-16 22:37:06 +03:00
Andrew Scheller c297ca3327 Allow the uPy used by run-tests to be overridden
with MICROPY_MP_PY envvar, in an analogous way to MICROPY_CPYTHON3 envvar.

(the reason for this will be made clearer by a later PR)
2014-04-16 20:24:16 +01:00
Andrew Scheller 83852d3215 fix README to match contents of run-tests 2014-04-16 20:14:38 +01:00
Dave Hylands 1a797edd3b Have make remove targets if a recipie fails. 2014-04-16 11:36:44 -07:00
Dave Hylands e553ff2f75 Fix to allow usbd_msc_storage.c to compile when MICROPY_HW_HAS_SDCARD isn't defined. 2014-04-16 10:01:17 -07:00
Damien George f6be480bda stmhal: Add pyb.have_cdc function to check if USB CDC device is enabled. 2014-04-16 15:52:50 +01:00
Damien George 9388a90842 stmhal: Fix USB CDC buffer overrun error.
Need to wait for the low-level USB driver to send the data over the USB
in-endpoint before the buffer can be used again.  This patch adds a
check for this.
2014-04-16 15:51:27 +01:00
Damien George 4f7f2e04a3 Merge pull request #497 from lurch/build-32bit
New config option MICROPY_FORCE_32BIT (defaulted to 0)
2014-04-16 11:51:32 +01:00
Damien George ecdf6cdc5b tools: Fix up pybcdc.inf generation: new lines and hex digits.
Using Python's file open in 'r' mode opens it for text reading, which
converts all new lines to \n.  Could use 'rb' binary mode, but then
don't have access to the string Template replacement functions.  Thus,
force the output to have '\\r\\n' ending.

Also fix regex to match hex digits.
2014-04-16 11:45:52 +01:00
Damien George bda2f70964 Merge pull request #498 from lurch/create-headers-from-files
Auto-generate the stmhal/pybcdc_inf header file from static files
2014-04-16 10:54:16 +01:00
Damien George 8a919fb051 Merge pull request #499 from lurch/skip-travis-tests
run-tests can now skip certain tests when run under Travis CI
2014-04-16 10:48:24 +01:00
Damien George 1381146382 stmhal: Fix C bindings of I2C.read/write. 2014-04-16 10:43:03 +01:00
Andrew Scheller 1b997d5244 run-tests can now skip certain tests when run under Travis CI
See the `skip_travis_tests` variable. Fixes #495
(also tidied up usage of os.path.basename() function)
2014-04-16 03:28:40 +01:00
Andrew Scheller 1452221aca Auto-generate the stmhal/pybcdc_inf header file from static files
The USB VID&PID are automatically extracted from usbd_desc_cdc_msc.c
and inserted into pybcdc_inf.template, ensuring that the same USB
IDs get used everywhere
2014-04-16 02:41:26 +01:00
Andrew Scheller 571d5a3363 New config option MICROPY_FORCE_32BIT (defaulted to 0)
Makes it easier for 64-bit unix hosts to build 32-bit unix
binaries (for testing)
2014-04-16 01:46:01 +01:00
Damien George 2822d4e6ce stmhal: Add I2C functions for pure master read/write. 2014-04-16 00:27:14 +01:00
Damien George ee01411036 py: Add len(bytes). 2014-04-15 23:10:00 +01:00
Damien George 897fe0c0d0 py: Add builtin functions bin and oct, and some tests for them. 2014-04-15 22:03:55 +01:00
Damien George d5323f07ff Merge pull request #496 from dhylands/fix-debug-usart
Fix call to enable pyb_usart_global_debug.
2014-04-15 21:25:27 +01:00
Dave Hylands 00adf67179 Fix call to enable pyb_usart_global_debug. 2014-04-15 12:20:31 -07:00
Damien George c58c1191b2 Merge branch 'master' of github.com:micropython/micropython 2014-04-15 19:59:13 +01:00
Damien George 9699ea6a2f stmhal: Fix USB MSC so that it unmounts correctly on Mac OS X.
Mac OS X sends a SCSI command to remove the medium when it unmounts a
drive.  If this command is not honoured, then OS X will automatically
remount the drive, making it impossible to eject.  This patch disables
the USB MSC when the right SCSI command is sent.
2014-04-15 19:56:32 +01:00
Damien George 4d7f4eb6a9 stmhal: Add ADC function to read data at a given frequency.
Reads ADC values into a bytearray (or similar) at a fixed rate.  Needs a
better name and improved API.  Also fix up DAC dma function (which also
needs a better name and API).
2014-04-15 19:52:56 +01:00
Damien George e95da5b784 stmhal: Add I2C.scan method, to scan all devices on the bus.
Simple way to find the address of an attached I2C device.
2014-04-15 19:24:13 +01:00
Damien George f6d25ecf7b stmhal: Add simple README.txt to freshly-created filesystem. 2014-04-15 19:20:25 +01:00
Damien George 3b108e7699 Merge pull request #493 from aitjcize/patch
Move entry_table to separated header file.
2014-04-15 14:33:11 +01:00
AZ Huang 9413ca02fb Rename header file. 2014-04-15 21:29:08 +08:00
Damien George 203bc98804 travis: Move diffing back to after_failure command.
Need to click on icon at right to see the output.
2014-04-15 12:52:59 +01:00
Damien George b013aea809 py: Fix builtin hex to print prefix.
I was too hasty.  Still a one-liner though.
2014-04-15 12:50:21 +01:00
Damien George 5805111732 py: Add hex builtin function.
A one-liner, added especially for @pfalcon :)
2014-04-15 12:42:52 +01:00
Damien George 256b319d56 tests: Disable memoryerror.py test, since it fails on travis.
Would be good to test this, but need to find a way to optionally not
running it when on travis.
2014-04-15 12:30:30 +01:00
Damien George 48aaa27c6a travis: Diff output, hopefully this works. 2014-04-15 12:20:22 +01:00
Damien George fd1c7b9d48 travis: Continue to debug tests output.
Seems that any commands in after_failure do not have stdout...
2014-04-15 12:05:26 +01:00
Damien George e8ecca21ff travis: More tests output debugging. 2014-04-15 11:56:57 +01:00
Damien George c13d0b3304 stmhal: Wrap skin-named-usarts in PYBV10 #if. 2014-04-15 11:52:47 +01:00
Damien George 35443610b1 travis: More tests debugging. 2014-04-15 11:38:30 +01:00
Damien George 45b4cc77dd travis: Debugging failing tests. 2014-04-15 11:25:36 +01:00
Damien George 9e2890bb00 travis: On fail, cd to tests directory before diffing. 2014-04-15 11:14:42 +01:00