- 05 Oct, 2014 6 commits
-
-
Damien George authored
Found these by compiling stmhal with mp_uint_t of type uint32_t instead of unsigned int. This actually makes a difference to the code, but just a curiosity.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
Timers now have the following new features: - can init freq using floating point; eg tim.init(freq=0.1) - tim.source_freq() added to get freq of timer clock source - tim.freq() added to get/set freq - print(tim) now prints freq
-
- 04 Oct, 2014 2 commits
-
-
Damien George authored
Eg pyb.freq(120000000) sets the CPU to 120MHz. The frequency can be set at any point in the code, and can be changed as many times as you like. Note that any active timers will need to be reconfigured after a freq change. Valid range is 24MHz to 168MHz (but not all freqs are supported). The code maintains a 48MHz clock for the USB at all times and it's possible to change the frequency at a USB REPL and keep the REPL alive (well, most of the time it stays, sometimes it resets the USB for some reason). Note that USB does not work with pyb.freq of 24MHz.
-
Damien George authored
-
- 02 Oct, 2014 3 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
Remove reference to pyb.gc; add reference to pyb.millis. There are lots of functions not listed when you run help(), but it would be too much to list them all, so we list only some basic, useful ones. Addresses issue #846.
-
- 01 Oct, 2014 1 commit
-
-
Dave Hylands authored
-
- 30 Sep, 2014 7 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
3rd party drivers should not export generic names like "close".
-
Damien George authored
As per issue #876, the network module is used to configure NICs (hardware modules) and configure routing. The usocket module is supposed to implement the normal Python socket module and selects the underlying NIC using routing logic. Right now the routing logic is brain dead: first-initialised, first-used. And the routing table is just a list of registered NICs. cc3k and wiznet5k work, but not at the same time due to C name clashes (to be fixed). Note that the usocket module has alias socket, so that one can import socket and it works as normal. But you can also override socket with your own module, using usocket at the backend.
-
Damien George authored
Most of the time you don't use the NSS pin of the SPI bus, and so it shouldn't be enabled by default (this gave some bugs in the past).
-
Damien George authored
In CPython IOError (and EnvironmentError) is deprecated and aliased to OSError. All modules that used to raise IOError now raise OSError (or a derived exception). In Micro Python we never used IOError (except 1 place, incorrectly) and so don't need to keep it. See http://legacy.python.org/dev/peps/pep-3151/ for background.
-
- 29 Sep, 2014 3 commits
-
-
Damien George authored
We save some code bytes by using builtin string functions.
-
Damien George authored
-
Damien George authored
Also improve precision of calculating PWM percent in integer mode. Also update teensy with edge case fix.
-
- 28 Sep, 2014 2 commits
-
-
Dave Hylands authored
tested using: stmhal: https://github.com/dhylands/upy-examples/blob/master/elapsed.py teensy: https://github.com/dhylands/upy-examples/blob/master/teensy/elapsed.py
-
Dave Hylands authored
Teensy doesn't need to worry about overflows since all of its timers are only 16-bit. For PWM, the pulse width needs to be able to vary from 0..period+1 (pulse-width == period+1 corresponds to 100% PWM) I couldn't test the 0xffffffff cases since we can't currently get a period that big in python. With a prescaler of 0, that corresponds to a freq of 0.039 (i.e. cycle every 25.56 seconds), and we can't set that using freq or period. I also tested both stmhal and teensy with floats disabled, which required a few other code changes to compile.
-
- 26 Sep, 2014 1 commit
-
-
Damien George authored
-
- 25 Sep, 2014 4 commits
-
-
Damien George authored
Pulled in and modified work done by mux/iabdalkader on cc3k driver, from iabdalkader-cc3k-update branch. That branch was terribly messy and had too many conflicts to merge neatly.
-
Damien George authored
-
Damien George authored
-
Damien George authored
Also do the same for teensy timer code.
-
- 24 Sep, 2014 1 commit
-
-
Dave Hylands authored
Fix stmhal and teensy print routines to report actual prescaler an period. Fix teensy build to use soft-float Add USE_ARDUINO_TOOLCHAIN option to teensy build
-
- 23 Sep, 2014 2 commits
-
-
Damien George authored
mp_parse_node_free now frees the memory associated with non-interned strings. And the parser calls mp_parse_node_free when discarding a non-used node (such as a doc string). Also, the compiler now frees the parse tree explicitly just before it exits (as opposed to relying on the caller to do this). Addresses issue #708 as best we can.
-
Damien George authored
Stack is full descending and must be 8-byte aligned. It must start off pointing to just above the last byte of RAM. Previously, stack started pointed to last byte of RAM (eg 0x2001ffff) and so was not 8-byte aligned. This caused a bug in combination with alloca. This patch also updates some debug printing code. Addresses issue #872 (among many other undiscovered issues).
-
- 21 Sep, 2014 1 commit
-
-
Damien George authored
This allows to set the pulse width (for PWM mode) as a ratio relative to the period of the timer. Eg, 0.5 is a 50% duty cycle. You can set the ratio in the channel init, or using channel.pulse_width_ratio; the latter can also read the pulse width as a ratio.
-
- 19 Sep, 2014 1 commit
-
-
Dave Hylands authored
-
- 17 Sep, 2014 2 commits
-
-
Damien George authored
-
Damien George authored
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
-
- 15 Sep, 2014 4 commits
-
-
Damien George authored
By measuring SD card addresses in blocks and not bytes, one can get away with using 32-bit numbers. This patch also uses proper atomic lock/unlock around SD card read/write, adds SD.info() function, and gives error code for failed read/writes.
-
Felix Domke authored
-
Felix Domke authored
-
Damien George authored
sys.exit always raises SystemExit so doesn't need a special implementation for each port. If C exit() is really needed, use the standard os._exit function. Also initialise mp_sys_path and mp_sys_argv in teensy port.
-