summaryrefslogtreecommitdiffstatshomepage
path: root/teensy
Commit message (Collapse)AuthorAge
* teensy: Add readinto and readlines qstrs.Damien George2015-05-13
|
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* teensy: Fix function prototype.Paul Sokolovsky2015-04-05
|
* string0.c: Move from stmhal/ to lib/.Paul Sokolovsky2015-04-05
|
* stmhal: Make pybstdio usable by other ports, and use it.Damien George2015-02-13
| | | | | Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
* fix type errorLi lin2015-02-04
|
* py: Change vstr_null_terminate -> vstr_null_terminated_str, returns str.Damien George2015-01-29
|
* py: Change vstr so that it doesn't null terminate buffer by default.Damien George2015-01-28
| | | | | | | | | This cleans up vstr so that it's a pure "variable buffer", and the user can decide whether they need to add a terminating null byte. In most places where vstr is used, the vstr did not need to be null terminated and so this patch saves code size, a tiny bit of RAM, and makes vstr usage more efficient. When null termination is needed it must be done explicitly using vstr_null_terminate.
* teensy: Update for readline module moved to lib/.Paul Sokolovsky2015-01-12
|
* py: Disable stack checking by default; enable on most ports.Damien George2015-01-09
|
* stmhal: Collect all root pointers together in 1 place.Damien George2015-01-07
| | | | | A GC in stmhal port now only scans true root pointers, not entire BSS. This reduces base GC time from 1700ms to 900ms.
* py: Put all global state together in state structures.Damien George2015-01-07
| | | | | | This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
* teensy: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* Makefiles: Support py/*.h includes per #1022.Paul Sokolovsky2014-12-27
|
* modsys: Add sys.print_exception(exc, file=sys.stdout) function.Paul Sokolovsky2014-12-08
| | | | | | | | | | | | The function is modeled after traceback.print_exception(), but unbloated, and put into existing module to save overhead on adding another module. Compliant traceback.print_exception() is intended to be implemented in micropython-lib in terms of sys.print_exception(). This change required refactoring mp_obj_print_exception() to take pfenv_t interface arguments. Addresses #751.
* Use MP_DEFINE_CONST_DICT macro to define module dicts.Damien George2014-11-29
| | | | | This is just a clean-up of the code. Generated code is exactly the same.
* stmhal: Reduce coupling between USB driver and readline.Damien George2014-11-27
| | | | | This makes it easier to re-use readline.c and pyexec.c from stmhal in other ports.
* ports: Define mp_off_t.Paul Sokolovsky2014-11-17
|
* Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*stijn2014-10-29
|
* stmhal: Overhaul UART class to use read/write, and improve it.v1.3.4Damien George2014-10-21
| | | | | | | | | | | | UART object now uses a stream-like interface: read, readall, readline, readinto, readchar, write, writechar. Timeouts are configured when the UART object is initialised, using timeout and timeout_char keyword args. The object includes optional read buffering, using interrupts. You can set the buffer size dynamically using read_buf_len keyword arg. A size of 0 disables buffering.
* stmhal: Fix edge case for timer PWM of 100%.Damien George2014-09-29
| | | | | Also improve precision of calculating PWM percent in integer mode. Also update teensy with edge case fix.
* Merge pull request #881 from dhylands/elapsedDamien George2014-09-29
|\ | | | | Added pyb.elapsed_millis and pyb.elapsed_micros
| * Added pyb.elapsed_millis and pyb.elapsed_microsDave Hylands2014-09-28
| | | | | | | | | | | | 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
* | Merge pull request #880 from dhylands/irq-alignDamien George2014-09-29
|\ \ | | | | | | teensy: Enable 8-byte stack alignment for IRQ Handlers.
| * | teensy: Enable 8-byte stack alignment for IRQ Handlers.Dave Hylands2014-09-28
| |/
* / Fix timer overflow code.Dave Hylands2014-09-27
|/ | | | | | | | | | | | | | | | 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.
* stmhal, timer: Factor code to compute PWM percent; improve 32bit case.Damien George2014-09-25
| | | | Also do the same for teensy timer code.
* Add pulse_width_percent to teensy.Dave Hylands2014-09-23
| | | | | | 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
* Add Timer support (PWM, OC, IC) for stmhal and teensyDave Hylands2014-09-19
|
* py: Move definition of mp_sys_exit to core.Damien George2014-09-15
| | | | | | | | 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.
* Update teensy README.md fileDave Hylands2014-08-30
| | | | | Thanks to Artur Wroblewski for some suggested changes. I also added the TIPs section at the end while I was updating.
* teensy: Fix multiple definition of irq functions.Damien George2014-08-25
|
* stmhal: Use MP_OBJ_NEW_SMALL_INT directly in pyb.micros/millis.Damien George2014-08-25
| | | | Also some whitespace cleanup.
* Add save/restore_irqDave Hylands2014-08-25
| | | | Factored irq functions into a separate file.
* stmhal: Make enable_irq and disable_irq inline functions.Damien George2014-08-25
| | | | | | | | | | | | These functions are generally 1 machine instruction, and are used in critical code, so makes sense to have them inline. Also leave these functions uninverted (ie 0 means enable, 1 means disable) and provide macro constants if you really need to distinguish the states. This makes for smaller code as well (combined with inlining). Applied to teensy port as well.
* Add save/restore_irqDave Hylands2014-08-25
| | | | Factored irq functions into a separate file.
* py: Fix bug where GC collected native/viper/asm function data.Damien George2014-08-24
| | | | | | | | Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
* teensy/README.md (corrected typo)Dan Peirce2014-08-16
|
* modified: teensy/README.mdDan Peirce2014-08-16
| | | | | Updated teensy/README.md to reflect change in build process (teensyduino is no longer required for build).
* stmhal/teensy: Use _ instead of - in source file names.Damien George2014-08-08
| | | | | Trying to move towards consistency, let's use _ exclusively in names of source files (eg .c, .h, .csv).
* Add support for selecting pin alternate functions from python.Dave Hylands2014-08-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converts generted pins to use qstrs instead of string pointers. This patch also adds the following functions: pyb.Pin.names() pyb.Pin.af_list() pyb.Pin.gpio() dir(pyb.Pin.board) and dir(pyb.Pin.cpu) also produce useful results. pyb.Pin now takes kw args. pyb.Pin.__str__ now prints more useful information about the pin configuration. I found the following functions in my boot.py to be useful: ```python def pins(): for pin_name in dir(pyb.Pin.board): pin = pyb.Pin(pin_name) print('{:10s} {:s}'.format(pin_name, str(pin))) def af(): for pin_name in dir(pyb.Pin.board): pin = pyb.Pin(pin_name) print('{:10s} {:s}'.format(pin_name, str(pin.af_list()))) ```
* Follow rename of readline_init to readline_init0 on teensyDave Hylands2014-08-04
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-08-04
|\
| * Updated teensys usb.c and switched to using usb.h from stmhal.Dave Hylands2014-08-03
| | | | | | | | | | | | Removed the local usb.h from teensey directory and now uses the usb.h from the stmhal directory. Fixed the deploy target to use abspath.
* | Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George2014-08-04
|/ | | | | | | qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
* Fix teensy to work with the latest tree.Dave Hylands2014-08-02
|
* Add core files and use same toolchain as stmhalDave Hylands2014-07-14
|
* Fix teensy to build on latest tree.Dave Hylands2014-07-14
| | | | | Put #include of mpconfig.h before misc.h Replace uses of ARRAY_SIZE with MP_ARRAY_SIZE
* lexer: Convert type (u)int to mp_(u)int_t.Damien George2014-07-03
|
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.