Commit Graph

926 Commits

Author SHA1 Message Date
Damien George
88153dc56a stmhal/sdcard: Fix initialisation of DMA TX so that writes work.
Addresses issue #2034.
2016-05-06 10:53:25 +01:00
Dave Hylands
cbbeb786d7 stmhal/dma: Fix builds for boards with an F4 or F7 but no DAC. 2016-05-06 09:57:33 +01:00
Damien George
08d3d5d9ab stmhal: For LIMIFROG board, add early-init function to get to DFU mode. 2016-05-05 17:00:30 +01:00
Tobias Badertscher
770f169e63 stmhal: Add board files for LIMIFROG board. 2016-05-05 17:00:16 +01:00
Damien George
05d1664981 stmhal/dma: Make DAC DMA descriptors conditional on having a DAC. 2016-05-05 15:34:01 +01:00
Tobias Badertscher
0f846e563c stmhal: L4: Add support for machine.sleep on STM32L4 MCUs.
Also raise an exception for machine.freq and machine.deepsleep on this
MCU, since they are not yet implemented.
2016-05-05 15:28:55 +01:00
Tobias Badertscher
7441ba7749 stmhal: L4: Make CCM/DTCM RAM start-up conditional on MCU type. 2016-05-05 15:19:33 +01:00
Tobias Badertscher
adaaf439b0 stmhal: L4: Adapt startup code, clock configuration and interrupts. 2016-05-05 15:14:42 +01:00
Tobias Badertscher
e64032d6fd stmhal: L4: Adapt DMA to be able to support STM32L4 MCU series.
The main thing is to change the DMA code in a way that the structure
DMA_Stream_TypeDef (which is similar to DMA_Channel_TypeDef on stm32l4)
is no longer used outside of dma.c, as this structure only exists for the
F4 series.  Therefore I introduced a new structure (dma_descr_t) which
handles all DMA specific stuff for configuration.  Further the periphery
(spi, i2c, sdcard, dac) does not need to know the internals of the dma.
2016-05-05 14:51:20 +01:00
Damien George
70ff7350e7 stmhal, cc3200: Change i2c.scan() method to scan addresses 0x08-0x77.
A standard I2C address is 7 bits but addresses 0b0000xxx and 0b1111xxx
are reserved.  The scan() method is changed to reflect this, along with
the docs.
2016-05-02 11:15:36 +01:00
Damien George
12c61ddddd stmhal/accel: Raise an exception if the accel couldn't be initialised.
On PYBLITEv1.0 there is no accelerometer and in this case the Accel()
constructor should not silently succeed.
2016-04-29 15:43:15 +01:00
Damien George
a63542387d extmod, stmhal: Fix typo of macro that detects if float is enabled. 2016-04-26 12:47:24 +01:00
Colin Hogben
104aa26271 cc3200, stmhal, teensy: Use pyhelp_print_obj function.
Update the help() implementations in the cc3200, stmhal and teensy
ports to use the pyhelp_print_obj function.
2016-04-25 18:54:59 +03:00
Damien George
624738ca64 extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr. 2016-04-22 09:56:02 +01:00
Tobias Badertscher
495da15611 stmhal: L4: Add support for external interrupts/events.
The L4 MCU supports 40 Events/IRQs lines of the type configurable and
direct.  But this L4 port only supports configurable line types which are
already supported by uPy.  For details see page 330 of RM0351, Rev 1.

The USB_FS_WAKUP event is a direct type and there is no support for it.
2016-04-21 13:11:37 +01:00
Tobias Badertscher
067fb2da14 stmhal: L4: Modify flash.c and storage.c to support L4 MCU.
The way to lookup the flash sector now uses a much simpler table for
all MCUs.
2016-04-21 13:03:38 +01:00
Tobias Badertscher
dda1a41205 stmhal: L4: Modify mphalport to support L4 MCU.
__GPIOI_CLK_ENABLE is defined in hal/l4/inc/Legacy/stm32_hal_legacy.h
as __HAL_RCC_GPIOI_CLK_ENABLE, and that latter macro is not defined
anywhere else (because the L4 does not have port GPIOI).  So the test
for GPIOI is needed, along with the test for the CLK_ENABLE macro.
2016-04-21 12:23:28 +01:00
Paul Sokolovsky
098f3e2862 stmhal: Update Makefile dependencies. 2016-04-19 11:54:07 +03:00
Damien George
5e247a5192 stmhal: Fix machine.unique_id() function to work for all MCUs. 2016-04-17 12:18:50 +01:00
Tobias Badertscher
31f5dc065a stmhal: L4: Modify timer.c to support L4 MCU. 2016-04-17 12:16:13 +01:00
Tobias Badertscher
432465b167 stmhal: L4: Modify rtc.c to support L4 MCU. 2016-04-17 12:08:07 +01:00
Damien George
aed1da913b stmhal: L4: Modify usbd_conf.c to support L4 MCU.
Original patch was authored by Tobias Badertscher / @tobbad, but it was
reworked to split UART edits from USB edits.
2016-04-17 12:02:26 +01:00
Damien George
53521152a8 stmhal: L4: Modify uart.c to support L4 MCU.
L4 does not have UART6, and has similar registers to the F7.

Original patch was authored by Tobias Badertscher / @tobbad, but it was
reworked to split UART edits from USB edits.
2016-04-17 12:01:05 +01:00
Tobias Badertscher
d49a547064 stmhal: L4: Modify adc.c to add support for STM32L4 series. 2016-04-16 23:02:36 +01:00
Tobias Badertscher
69f26c68c9 stmhal: L4: Add line to Makefile for building L4 series. 2016-04-16 22:14:12 +01:00
Tobias Badertscher
0b6e28c999 stmhal: L4: Add board definition files for STM32L476DISC. 2016-04-16 22:11:02 +01:00
Damien George
e943a407f2 stmhal: Update HALCOMMITS due to change to hal. 2016-04-16 22:00:49 +01:00
Tobias Badertscher
d4c3349957 stmhal: L4: Adapt UART HAL to avoid 64-bit integer division.
64-bit integer division brings a dependency on library functions. It is
avoided here by dividing fck and baud by a common divisior.  The error
is the better (1/(2*0x300)) as with 64 bit division (1/(0x300)).
2016-04-16 21:54:19 +01:00
Tobias Badertscher
f4942db044 stmhal: L4: Add basic STM32L4xx HAL files.
These files come from STM32Cube_FW_L4_V1.3.0, with Windows line endings
converted to unix.  Only basic HAL files are added.  In addition the QSPI
support is included to support later external QSPI flash as mass storage.
2016-04-16 21:51:40 +01:00
Tobias Badertscher
2ba6677775 stmhal: L4: Add CMSIS files to support STM32L476. 2016-04-16 21:41:52 +01:00
Damien George
040373e4c4 stmhal: For frozen bytecode generation, add dependency of qstr file. 2016-04-16 13:20:02 +01:00
Jan Čapek
d76c65f599 py: Add rules for automated extraction of qstrs from sources.
- add template rule that converts a specified source file into a qstring file

- add special rule for generating a central header that contains all
  extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED
  variable. Each platform appends a list of sources that may contain
  qstrings into a new build variable: SRC_QSTR. Any autogenerated
  prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable.

- remove most qstrings from py/qstrdefs, keep only qstrings that
  contain special characters - these cannot be easily detected in the
  sources without additional annotations

- remove most manual qstrdefs, use qstrdef autogen for: py, cc3200,
  stmhal, teensy, unix, windows, pic16bit:

   - remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.)
   - remove all port specific qstrdefs except for special strings
   - append sources for qstr generation in platform makefiles (SRC_QSTR)
2016-04-16 13:18:09 +01:00
Paul Sokolovsky
9b0714b24c py: Declare help, input, open builtins in core.
These are *defined* per-port, but why redeclare them again and again.
2016-04-15 00:07:56 +03:00
Damien George
733db525e2 stmhal: Add Makefile option FROZEN_MPY_DIR to support frozen bytecode. 2016-04-13 16:07:47 +01:00
Damien George
0a2e9650f5 py: Add ability to have frozen persistent bytecode from .mpy files.
The config variable MICROPY_MODULE_FROZEN is now made of two separate
parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY.  This
allows to have none, either or both of frozen strings and frozen mpy
files (aka frozen bytecode).
2016-04-13 16:07:47 +01:00
Peter Hinch
22cbcd55f0 stmhal: Properly handle RTS/CTS flow control for buf/unbuf transfers.
Fixes issues #1912 and #1913.  UART documentation is also updated.
2016-04-13 08:42:32 +01:00
Damien George
67a327cb9b stmhal: Enable framebuf module. 2016-04-12 14:06:54 +01:00
Damien George
e4f963a351 stmhal: Use new generic I2C object in machine module. 2016-04-12 14:06:54 +01:00
Damien George
69a1aaf654 stmhal: Implement basic C-level pin HAL. 2016-04-12 14:06:54 +01:00
Damien George
53ad681ed1 extmod: Add initial framebuf module. 2016-04-12 14:06:53 +01:00
Martin Fischer
8a8e775035 stmhal: Consistently enable USB SOF Irqs for all USB modes (FS and HS).
SOF irqs are now standard for rx/tx USB transfers, so enable them for both
FS and HS modes.  Fixes #1944.
2016-04-07 09:23:33 +01:00
Dave Hylands
99fc0d120a stmhal: NUCELO_F401RE cleanup
Added definitions for SPI1, SPI2, and SPI3
Removed USB stuff (that could be removed)
Updated BOARD name defintion
2016-03-13 12:36:39 +00:00
Dave Hylands
00f921ce02 stmhal: Rename STM32F401NUCLEO to NUCLEO_F401RE
This makes the board match the name printed on the board (and
agree with the documentation)
2016-03-13 12:36:39 +00:00
Dave Hylands
031fadd10e stmhal: Add board definition files for NUCLEO_F411RE 2016-03-12 16:16:15 -08:00
Christopher Arndt
9b5e05a7c7 stmhal: Add makefile target and configuration to deploy via OpenOCD. 2016-03-09 23:00:17 +00:00
Ryan Shaw
ad725a6661 stmhal: Add support for generic STM32F439 board (non DISCO). 2016-03-09 22:46:41 +00:00
Christopher Arndt
07554486ee stmhal: Add makefile target to deploy stmhal build via ST-LINK. 2016-03-09 13:26:23 +00:00
Damien George
bb293e6bcf stmhal: Add stmhal-specific README.md with extra details for this port. 2016-03-08 12:00:38 +00:00
Damien George
2c72ae5c29 stmhal: Switch from dfu-util to tools/pydfu.py for deflt deploy method.
tools/pydfu.py is now the recommended way of deploying a DFU file.  Old
behaviour of dfu-util can be obtained by passing USE_PYDFU=0 when invoking
make.

The main README.md file has been updated to reflect this change.
2016-03-08 11:58:39 +00:00
Dave Hylands
484a471f9b stmhal: Fix some typos in stm32f411 files, regarding FS layout and CSV. 2016-03-07 12:42:30 +00:00
Dave Hylands
367c084c4b stmhal: Fix typo in stm32f401.ld file, regarding flash size. 2016-03-07 12:38:57 +00:00
Dave Hylands
0edfb7a115 stmhal: Make spi use mp_hal_gpio_set_af 2016-03-07 12:24:53 +00:00
Pavol Rusnak
ce3beb1672 stmhal: Unify comments in stm32f4xx_hal_conf.h across all boards.
To make it easier to spot differences.
2016-03-07 11:28:36 +00:00
Paul Sokolovsky
453a2a3d7c extmod/vfs_fat: Add lexer, move from stmhal port for reuse. 2016-03-03 13:25:44 +02:00
Paul Sokolovsky
6ef65e70af extmod/vfs_fat: Add fat_vfs_import_stat(), reusable import stat routine.
Moved from stmhal.
2016-02-29 00:44:32 +02:00
Paul Sokolovsky
cd6d189f48 extmod/vfs_fat: Move listdir() method from stmhal for reuse. 2016-02-28 17:17:24 +02:00
Damien George
476c15290d stmhal: Enabled importing of persistent bytecode (.mpy files). 2016-02-25 10:12:30 +00:00
Dave Hylands
ec37239e53 stmhal: Improvements to the STM32F4DISC UART config settings. 2016-02-15 10:11:29 +00:00
Dave Hylands
4b2938a4b0 stmhal: Some NETDUINO_PLUS_2 cleanup
- Put the I2C bus on the corect pins
- Add the appropriate board_init to power the shield
2016-02-15 10:07:27 +00:00
Paul Sokolovsky
46a0ac02c5 extmod/vfs_fat_ffconf: Reusable FatFs module, move from stmhal/ffconf.
TODO: Probably merge into vfs_fat_diskio.
2016-02-15 00:19:27 +02:00
Paul Sokolovsky
6b0c88256b extmod/vfs_fat_file: Reusable FatFs module, move from stmhal/file. 2016-02-15 00:16:46 +02:00
Paul Sokolovsky
8cb78e0e53 extmod/vfs_fat_diskio: Reusable FatFs module, move from stmhal/diskio. 2016-02-15 00:08:37 +02:00
Paul Sokolovsky
72085a669b py/mpstate.h: fs_user_mount is now standard, reusable uPy functionality. 2016-02-15 00:02:03 +02:00
Paul Sokolovsky
9e0478a902 stmhal/diskio: Add provision for default returns for ioctl INIT/SEC_SIZE.
If None was returned for such requests (which likely means that user simply
didn't handle them), it means successful init and default sector size of 512
bytes respectively. This makes only BP_IOCTL_SEC_COUNT a mandatory request,
and thus re-establishes parity with old interface, where only .count() is
mandatory().
2016-02-14 20:34:30 +02:00
Paul Sokolovsky
e3c66a5a67 stmhal/file: Paranoid compiler warnings cleanness. 2016-02-14 19:15:22 +02:00
Paul Sokolovsky
baf47c84c4 stmhal/diskio,file: Nanbox cleanness. 2016-02-14 19:15:22 +02:00
Dave Hylands
32b7e93535 stmhal: NUCLEO 401 - Add definitions for I2C2 and I2C3 2016-02-10 21:26:14 -08:00
Dave Hylands
f791e14750 stmhal: CERB40 - Add pins defines for I2C3 2016-02-10 21:25:30 -08:00
Dave Hylands
38ac23c942 stmhal: NUCLEO 401 - Add a bunch of missing pins and reorder the pins
This groups the pins for a port together and puts them in numerical
order. It also adds ARDUINO pin names.
2016-02-10 21:23:45 -08:00
Dave Hylands
7bb501ef9f stmhal: Add a function for setting the pin alternate function
mp_hal_gpio_set_af will search for a given function and unit
and set the alternate function to the alternate function index
found.
2016-02-10 21:20:14 -08:00
Damien George
e372e83b30 extmod/fsusermount: Move BP_IOCTL_xxx constants to fsusermount.h. 2016-02-10 23:40:35 +00:00
Damien George
b33a770596 extmod/fsusermount: Support mounting of multiple block devices.
This patch adds support to fsusermount for multiple block devices
(instead of just one).  The maximum allowed is fixed at compile time by
the size of the fs_user_mount array accessed via MP_STATE_PORT, which
in turn is set by MICROPY_FATFS_VOLUMES.

With this patch, stmhal (which is still tightly coupled to fsusermount)
is also modified to support mounting multiple devices   And the flash and
SD card are now just two block devices that are mounted at start up if
they exist (and they have special native code to make them more
efficient).
2016-02-10 23:40:10 +00:00
Damien George
34023eb673 stmhal: Add mount/umount/mkfs to os module. 2016-02-10 23:40:10 +00:00
Damien George
3770cd2e70 stmhal: Expose flash and SD card as proper objects with block protocol.
You can now create (singleton) objects representing the flash and SD
card, using:

    flash = pyb.Flash()
    sdcard = pyb.SDCard()

These objects provide the block protocol.
2016-02-10 23:40:10 +00:00
Dave Hylands
a888d5ab91 stmhal: Improve NUCLEO-F401RE build, with UART2 as REPL.
This enables MICROPY_HW_HAS_FLASH which got missed.

The HW has UART2 on the 401 connected to the STLINK procesor
which exposes it as USB serial. This connects that up so that
you can get a REPL using the USB serial.
2016-02-10 16:50:05 +00:00
Damien George
13a4c120ce lib/fatfs: Add support for sector sizes larger than 512 bytes.
If MICROPY_FATFS_MAX_SS is defined to power of 2 value between 1024 and
4096, support for dynamic sector size in FatFs will be enabled.  Note
that FatFs reserves static buffer of MICROPY_FATFS_MAX_SS size for each
filesystem in use, so that value should be set sparingly.

Initial patch provided by @pfalcon.
2016-02-10 08:59:58 +00:00
Damien George
c33ad60a67 extmod/fsusermount: Change block protocol to support ioctl method.
The new block protocol is:
- readblocks(self, n, buf)
- writeblocks(self, n, buf)
- ioctl(self, cmd, arg)

The new ioctl method handles the old sync and count methods, as well as
a new "get sector size" method.

The old protocol is still supported, and used if the device doesn't have
the ioctl method.
2016-02-10 08:59:31 +00:00
Paul Sokolovsky
5b85a86ce3 extmod/fsusermount: Introduce separate mkfs() function.
Per the previously discussed plan. mount() still stays backward-compatible,
and new mkfs() is rought and takes more args than needed. But is a step
in a forward direction.
2016-02-10 00:50:07 +02:00
Paul Sokolovsky
ab0e36b3da stmhal/file: For self-contained usecase, don't define global types.
If MICROPY_VFS_FAT is defined, mp_type_fileio & mp_type_textio won't be
defined, as these may be alredy defined elsewhere. The idea is to have
compartmentalized VFS FatFs class, which can work in parallel with some
other "main" filesystem. E.g., for unix port, mp_type_fileio, etc. will
be defined for the main POSIX filesystem, while stmhal/file.c will be
a self-contained VFS file class.
2016-02-07 01:25:28 +02:00
Paul Sokolovsky
350ab0f570 stmhal/file: Recast as "FatFs file" class, to support other VFS types.
Move definition of mp_builtin_open_obj to a separate module, then file.c
becomes more or less compartmentalized FatFs file class, which can be used
together with file class implementations for other (V)FSes.
2016-02-07 01:25:28 +02:00
Paul Sokolovsky
71206f02c3 stmhal: Move stmhal-specific FatFs routines/structs to fatfs_port.c. 2016-02-06 15:31:00 +02:00
Paul Sokolovsky
97a0846af9 stmhal/diskio: Introduce MICROPY_HW_HAS_FLASH setting.
To allow to reuse stmhal/diskio for ports which don't have flash but have
other storage devices.
2016-02-06 15:07:01 +02:00
Doug Currie
2e2e15cec2 py/mpz: Complete implementation of mpz_{and,or,xor} for negative args.
For these 3 bitwise operations there are now fast functions for
positive-only arguments, and general functions for arbitrary sign
arguments (the fast functions are the existing implementation).

By default the fast functions are not used (to save space) and instead
the general functions are used for all operations.

Enable MICROPY_OPT_MPZ_BITWISE to use the fast functions for positive
arguments.
2016-02-03 22:13:39 +00:00
Damien George
db573082b5 stmhal: Update HALCOMMITS due to change to hal. 2016-01-30 00:05:46 +00:00
Damien George
ea040a4f9a stmhal: In HAL I2C driver, move DMA setup to after sending I2C address.
Previous to this patch the DMA was setup and then the I2C address sent.
If the I2C address sending failed (eg no I2C device on the bus) then the
DMA was left in an inconsistent state.

This patch moves the DMA setup to after a successful sending of the I2C
address(es).

See issue #1765.
2016-01-30 00:02:21 +00:00
Damien George
a8a4b01af6 stmhal: Add PWM capability for LED(3) and LED(4) on pyboards.
USB CDC no longer needs TIM3 (which was originally used for LED(4) PWM)
and so TIM3 has been freed for general purpose use by the user.  Hence
LED(4) lost its PWM capabilities.

This patch reinstates the PWM capabilities using a semi-generic piece
of code which allows to configure a timer and PWM channel to use for any
LED.  But the PWM capability is only configured if the LED is set to an
intensity between 1 and 254 (ie only when needed).  In that case the
relevant timer is configured for PWM.  It's up to the user to make sure
the timers are not used if PWM is active.

This patch also makes sure that PWM LEDs are turned off using standard
GPIO when calling led.off() or led.intensity(0), instead of just setting
the PWM counter to zero.
2016-01-29 22:44:43 +00:00
Damien George
ea89b80ff4 stmhal: Make TIM3 available for use by the user.
TIM3 is no longer used by USB CDC for triggering outgoing data, so we
can now make it available to the user.

PWM fading on LED(4) is now gone, but will be reinstated in a new way.
2016-01-29 22:31:56 +00:00
Damien George
d363133917 stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data.
Previous to this patch the USB CDC driver used TIM3 to trigger the
sending of outgoing data over USB serial.  This patch changes the
behaviour so that the USB SOF interrupt is used to trigger the processing
of the sending.  This reduces latency and increases bandwidth of outgoing
data.

Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype.

See PR #1713.
2016-01-29 15:21:43 +00:00
Paul Sokolovsky
d3b1f0b627 py/runtime: mp_stack_ctrl_init() should be called immediately on startup.
Calling it from mp_init() is too late for some ports (like Unix), and leads
to incomplete stack frame being captured, with following GC issues. So, now
each port should call mp_stack_ctrl_init() on its own, ASAP after startup,
and taking special precautions so it really was called before stack variables
get allocated (because if such variable with a pointer is missed, it may lead
to over-collecting (typical symptom is segfaulting)).
2016-01-29 02:13:42 +02:00
Carmine Noviello
3d42aa07dd stmhal: Add support for the STM32F401NUCLEO board.
Includes full version of pins.csv file with correct mapping of the Nucleo
STM32F401RE chip (LQFP64 package).
2016-01-27 12:30:36 +00:00
Damien George
a53af6c875 extmod/modurandom: Add some extra random functions.
Functions added are:
- randint
- randrange
- choice
- random
- uniform

They are enabled with configuration variable
MICROPY_PY_URANDOM_EXTRA_FUNCS, which is disabled by default.  It is
enabled for unix coverage build and stmhal.
2016-01-26 15:27:00 +00:00
Dave Hylands
42a6364a31 stmhal: Add support for building frozen files.
This allows FROZEN_DIR=some-directory to be specified on the make
command line, which will then add all of the files contained within
the indicated frozen directory as frozen files in the image.

There is no change in flash/ram usage if not using the feature.

This is especially useful on smaller MCUs (like the 401) which only
has 64K flash file system.
2016-01-23 21:53:04 +00:00
Dave Hylands
f22844b4e5 stmhal: Add os.statvfs
Implement enough of statvfs to determine the amount of free
space on a volume.
2016-01-19 12:29:47 +00:00
Paul Sokolovsky
a58a91eb04 extmod/modurandom: Add "urandom" module.
Seedable and reproducible pseudo-random number generator. Implemented
functions are getrandbits(n) (n <= 32) and seed().

The algorithm used is Yasmarang by Ilya Levin:
http://www.literatecode.com/yasmarang
2016-01-17 12:13:01 +02:00
Damien George
5b3f0b7f39 py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.
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.
2016-01-11 00:49:27 +00:00
Damien George
daa1a455c6 stmhal: Remove custom mod_machine_mem_get_{read,write}_addr functions.
They are no longer needed because stm constants can now be 32 bits wide.
2016-01-07 16:34:11 +00:00
Damien George
2621f8a340 stmhal: Make stm constants big ints when they don't fit in a small int.
Adds 924 bytes of code, but means that no more hacks and work-arounds are
needed due to large constants becoming negative.
2016-01-07 16:34:11 +00:00
Dave Hylands
8c936edeb2 stmhal: Fix USB on the STM32F429DISC board
The USB REPL has been broken since commit 1be0fde45c
This patch allows the STM32F429DISC board (which uses the USB_HS PHY)
2015-12-30 23:36:41 -08:00
Paul Sokolovsky
b4c65c253f extmod/fsusermount: Move module qstrs to global pool from stmhal port. 2015-12-25 19:22:16 +02:00
Damien George
401af50dc0 stmhal: Add pyb.irq_stats() to get statistics about IRQ calls.
Adds a lot of code, makes IRQs a bit less efficient, but is very useful
for debugging.  Usage: pyb.irq_stats() returns a memory view that can be
read and written, eg:

    list(pyb.irq_stats())
    pyb.irq_stats()[0]
    pyb.irq_stats()[0] = 0

The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be
modified to provide further IRQ statistics if desired.
2015-12-22 21:00:20 +00:00