summaryrefslogtreecommitdiffstatshomepage
path: root/teensy/timer.c
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky2017-01-04
| | | | | Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
* py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George2016-01-11
| | | | | | | | The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
* all: Add py/mphal.h and use it in all ports.Damien George2015-10-31
| | | | | | py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
* 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: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* 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.
* 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.
* 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