Wykres commitów

77 Commity (master)

Autor SHA1 Wiadomość Data
Damien George e60e8079a7 nrf/mpconfigport: Enable MICROPY_NLR_THUMB_USE_LONG_JUMP on nRF51xx.
Signed-off-by: Damien George <damien@micropython.org>
2024-04-26 11:15:59 +10:00
Damien George bfc3dde2c9 extmod/modmachine: Add MICROPY_PY_MACHINE_RESET configuration option.
Disabled by default, but enabled on all boards that previously had
`MICROPY_PY_MACHINE_BARE_METAL_FUNCS` enabled.

Signed-off-by: Damien George <damien@micropython.org>
2024-03-15 12:04:37 +11:00
Jim Mussared d4190815a3 py/mpconfig: Disable qstr hashing at minimum feature level.
This will apply to bare-arm and minimal, as well as the minimal unix
variant.

Change the default to MICROPY_QSTR_BYTES_IN_HASH=1 for the CORE,BASIC
levels, 2 for >=EXTRA.

Removes explicit setting of MICROPY_QSTR_BYTES_IN_HASH==1 in ports that
don't set the feature level (because 1 is implied by the default level,
CORE). Applies to cc3200, pic16bt, powerpc.

Removes explicit setting for nRF (which sets feature level). Also for samd,
which sets CORE for d21 and FULL for d51. This means that d21 is unchanged
with MICROPY_QSTR_BYTES_IN_HASH==1, but d51 now moves from 1 to 2 (roughly
adds 1kiB).

The only remaining port which explicitly set bytes-in-hash is rp2 because
it's high-flash (hence CORE level) but lowish-SRAM, so it's worthwhile
saving the RAM for runtime qstrs.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2024-01-25 16:38:17 +11:00
Damien George d422b68d10 nrf/mpconfigport: Enable MICROPY_PY_MACHINE_BOOTLOADER.
This should have been enabled in 48b5a7b060
but was missed.

Signed-off-by: Damien George <damien@micropython.org>
2023-12-04 22:17:18 +11:00
Damien George 22d9116c8c nrf: Convert os module to use extmod version.
The os.dupterm() function has changed on this port, it now matches the
semantics used by all other ports (except it's restricted to accept only
machine.UART objects).

Signed-off-by: Damien George <damien@micropython.org>
2023-11-30 16:33:56 +11:00
Damien George e3c4c32c64 nrf: Use dupterm_objs[0] instead of board_stdio_uart.
To make this a little more consistent with other ports.

Signed-off-by: Damien George <damien@micropython.org>
2023-11-30 16:33:56 +11:00
Damien George e1ec6af654 extmod/modmachine: Provide common bindings for 6 bare-metal functions.
Minor changes for consistency are:
- nrf gains: unique_id(), freq() [they do nothing]
- samd: deepsleep() now resets after calling lightsleep()
- esp32: lightsleep()/deepsleep() no longer take kw arg "sleep", instead
  it's positional to match others.  also, passing 0 here will now do a 0ms
  sleep instead of acting like nothing was passed.
  reset_cause() no longer takes any args (before it would just ignore them)
- mimxrt: freq() with an argument and lightsleep() both raise
  NotImplementedError

Signed-off-by: Damien George <damien@micropython.org>
2023-11-30 16:11:11 +11:00
Damien George 7d39db2503 extmod/modmachine: Factor ports' machine module dict to common code.
This is a code factoring to have the dict for the machine module in one
location, and all the ports use that same dict.  The machine.soft_reset()
function implementation is also factored because it's the same for all
ports that did already implement it.  Eventually more functions/bindings
can be factored.

All ports remain functionally the same, except:
- cc3200 port: gains soft_reset, mem8, mem16, mem32, Signal; loses POWER_ON
  (which was a legacy constant, replaced long ago by PWRON_RESET)
- nrf port: gains Signal
- qemu-arm port: gains soft_reset
- unix port: gains soft_reset
- zephyr port: gains soft_reset, mem8, mem16, mem32

Signed-off-by: Damien George <damien@micropython.org>
2023-11-30 16:11:11 +11:00
Damien George b4d288ae44 nrf: Use MICROPY_PY_MACHINE_SPI instead of MICROPY_PY_MACHINE_HW_SPI.
MICROPY_PY_MACHINE_SPI is defined in mpconfigport.h to be equal to
MICROPY_PY_MACHINE_HW_SPI, so they are equivalent options.  The former one
is preferred because it's used by all other ports.

The default in mpconfigport.h is to enable this option, and all boards that
enable SPI have this removed from their mpconfigboard.h file so they pick
up the default.

Signed-off-by: Damien George <damien@micropython.org>
2023-11-30 16:10:10 +11:00
Damien George 6989aba93b nrf/modules/machine: Use SPI Python bindings provided by extmod.
Signed-off-by: Damien George <damien@micropython.org>
2023-10-26 17:37:39 +11:00
Damien George 5b4a2baff6 extmod/machine_uart: Factor ports' UART Python bindings to common code.
This is a code factoring to have the Python bindings in one location, and
all the ports use those same bindings.  For all ports except the two listed
below there is no functional change.

The nrf port has UART.sendbreak() removed, but this method previously did
nothing.

The zephyr port has the following methods added:
- UART.init(): supports setting timeout and timeout_char.
- UART.deinit(): does nothing, just returns None.
- UART.flush(): raises OSError(EINVAL) because it's not implemented.
- UART.any() and UART.txdone(): raise NotImplementedError.

Signed-off-by: Damien George <damien@micropython.org>
2023-10-26 10:46:42 +11:00
Damien George 95d8b5fd55 extmod/machine_adc: Factor ports' ADC Python bindings to common code.
No functional change, just code factoring to have the Python bindings in
one location, and all the ports use those same bindings.

Signed-off-by: Damien George <damien@micropython.org>
2023-10-23 17:16:45 +11:00
Damien George 48e0986666 nrf/boards: Automatically configure MICROPY_PY_MACHINE_PWM.
This commit makes it so that MICROPY_PY_MACHINE_PWM is enabled if at least
one of MICROPY_PY_MACHINE_HW_PWM and/or MICROPY_PY_MACHINE_SOFT_PWM are
enabled.  This simplifies the configuration for boards, and fixes DVK_BL652
which enabled PWM without selecting software or hardware implementations.

With this change, DVK_BL652 and EVK_NINA_B1 now enable (hardware) PWM.

Signed-off-by: Damien George <damien@micropython.org>
2023-10-23 11:20:49 +11:00
Jim Mussared f5f9edf645 all: Rename UMODULE to MODULE in preprocessor/Makefile vars.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:11 +10:00
Jim Mussared 7f5d5c7271 all: Rename mod_umodule*, ^umodule* to remove the "u" prefix.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:07 +10:00
Jim Mussared dfe232d000 py/builtinimport: Remove weak links.
In order to keep "import umodule" working, the existing mechanism is
replaced with a simple fallback to drop the "u".

This makes importing of built-ins no longer touch the filesystem, which
makes a typical built-in import take ~0.15ms rather than 3-5ms.

(Weak links were added in c14a81662c)

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:04 +10:00
Damien George 38243cd8e0 extmod/machine_pwm: Remove PWM_INIT and PWM_DUTY_U16_NS config options.
All ports that enable MICROPY_PY_MACHINE_PWM now enable these two
sub-options, so remove these sub-options altogether to force consistency in
new ports that implement machine.PWM.

Signed-off-by: Damien George <damien@micropython.org>
2023-05-04 13:19:19 +10:00
Damien George a3c427898e nrf/modules/utime: Use extmod version of time module.
API additions;
- time.sleep() is added
- time.ticks_cpu() is added, but it just returns 0

No API or functional change to existing time functions.

Signed-off-by: Damien George <damien@micropython.org>
2023-04-27 15:11:51 +10:00
robert-hh be686e634e rp2: Allow disabling USB via MICROPY_HW_ENABLE_USBDEV config.
Previously, setting MICROPY_HW_ENABLE_USBDEV to 0 caused build errors.  The
change affects the nrf and samd ports as well, so MICROPY_HW_ENABLE_USBDEV
had to be explicitly enabled there.

The configuration options MICROPY_HW_ENABLE_USBDEV and
MICROPY_HW_ENABLE_UART_REPL are independent, and can be enabled or disabled
by a board.

Signed-off-by: Damien George <damien@micropython.org>
2023-03-20 22:33:45 +11:00
robert-hh e3b877826c nrf/modules/machine/soft_pwm: Add PWM for nrf51x boards using soft PWM.
Using extmod/machine_pwm.c for the Python bindings and the existing
softpwm.c driver, by just adding the interface.

Properties:
- Frequency range 1-3906 Hz.
- All PWM outputs run at the same frequency but can have different duty
  cycles.
- Limited to the P0.x pins.

Since it uses the existing softpwm.c mechanism, it will be affected by
playing music with the music class.
2023-03-10 10:44:02 +11:00
robert-hh a1f838cdf1 nrf/modules/machine/pwm: Use extmod/machine_pwm.c for PWM module.
This is a breaking change, making the hardware PWM on the nrf port
compatible with the other ports providing machine.PWM.

Frequency range 4Hz - ~5.4 MHz.  The base clock range is 125kHz to 16 MHz,
and the divider range is 3 - 32767.

The hardware supports up to four outputs per PWM device with different duty
cycles, but only one output is (and was) supported.
2023-03-10 10:43:55 +11:00
robert-hh 0baf6c80d9 nrf/mpconfigport: Enable seeding of the PRNG by the hardware RNG.
A suitable function already existed, so just the declaration was needed.
2023-01-28 15:23:26 +11:00
Damien George e8f5cfe0e1 nrf: Rename MICROPY_PY_MACHINE_TIMER to MICROPY_PY_MACHINE_TIMER_NRF.
So that it doesn't clash with the extmod version.

Also make the default for this enabled, so that most boards do not need to
configure it.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-27 14:30:58 +11:00
Damien George 8f4c108025 all: Remove MICROPY_PY_IO_FILEIO config option.
Since commit e65d1e69e8 there is no longer an
io.FileIO class, so this option is no longer needed.

This option also controlled whether or not files supported being opened in
binary mode (eg 'rb'), and could, if disabled, lead to confusion as to why
opening a file in binary mode silently did the wrong thing (it would just
open in text mode if MICROPY_PY_IO_FILEIO was disabled).

The various VFS implementations (POSIX, FAT, LFS) were the only places
where enabling this option made a difference, and in almost all cases where
one of these filesystems were enabled, MICROPY_PY_IO_FILEIO was also
enabled.  So it makes sense to just unconditionally enable this feature
(ability to open a file in binary mode) in all cases, and so just remove
this config option altogether.  That makes configuration simpler and means
binary file support always exists (and opening a file in binary mode is
arguably more fundamental than opening in text mode, so if anything should
be configurable then it should be the ability to open in text mode).

Signed-off-by: Damien George <damien@micropython.org>
2022-08-18 11:54:17 +10:00
Jim Mussared 092784da19 ports: Remove unused mp_type_{fileio/textio} macros in mpconfigport.h.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-26 18:07:22 +10:00
robert-hh 80339f1a33 ports: Adapt mimxrt, nrf and rp2 ports to work with latest TinyUSB.
rp2: change tud_task() to tud_task_ext().

mimxrt: use lib/tinyusb/src/portable/chipidea/ci_hs/dcd_ci_hs.c instead of
lib/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c.

nrf: add a definition for the changed tud_task().  tud_task() is changed
to tud_task_ext(), and the #define for backward compatibility is in
src/device/usbd.h.

The items I know which are fixed with this version:
- Fix for the SAMD USB lock-up.
- Support the MIMXRT11XX series of MCUs.
- Fix a wrong pin definition for MIMXRT1050_EVKB.

Tested with the MIMXRT boards, rp2 Pico, SAMD boards, nrf board.
2022-07-19 11:27:21 +10:00
David Lechner 8a69c54211 nrf: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root
pointers for the nrf port.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:50:34 +10:00
David Lechner 81dbea1ce3 shared/readline: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register the readline_history root
pointer array used by shared/readline.c and removes the registration from
all mpconfigport.h files.

This also required adding a new MICROPY_READLINE_HISTORY_SIZE config option
since not all ports used the same sized array.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:48:49 +10:00
robert-hh be6f0f3b3b nrf/mpconfigport: Call tud_task() in MICROPY_EVENT_POLL_HOOK.
So that the interrupt character can interrupt a long-running loop, like a
sleep.
2022-07-17 00:12:34 +10:00
iabdalkader 262f4a4855 nrf/mpconfigport: Remove obsolete module declarations.
External module declarations are no longer used/needed after the
introduction of MP_REGISTER_MODULE.
2022-07-15 22:54:25 +10:00
iabdalkader 425d8fc0d6 nrf: Enable optional support for Arduino 1200bps touch.
Individual boards must enable it via MICROPY_HW_USB_CDC_1200BPS_TOUCH.
2022-06-23 14:33:40 +10:00
iabdalkader d8f5669532 nrf/modmachine: Add machine.bootloader() and make it customisable. 2022-06-17 13:37:44 +10:00
iabdalkader 921dd94676 nrf/main: Add startup and early-init board hook macros.
Following stm32 for naming and location of the hooks.  Also allow a board
to provide custom .c files to implement code for these hooks.
2022-06-17 13:23:45 +10:00
Andrew Leech 494e8ba722 nrf/mpconfigport: Fix MICROPY_VFS IO build support. 2022-06-03 12:39:43 +10:00
Andrew Leech c5878dd1f9 nrf/mpconfigport: Enable extra features as defined by ROM levels.
This commit enables extra features from the ROM levels and further
simplifies mpconfigport.h.  The changes are:

- NRF51822 & BLUETOOTH_SD -> MICROPY_CONFIG_ROM_LEVEL_MINIMUM
    - no changes

- NRF51822 -> MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES
    - MICROPY_PY_IO = 1

- NRF52832 -> MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES
    - MICROPY_PY_IO = 1

- NRF52840, NRF9160 -> MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES
    - MICROPY_COMP_MODULE_CONST = 1
    - MICROPY_COMP_TRIPLE_TUPLE_ASSIGN = 1
    - MICROPY_OPT_MPZ_BITWISE = 1
    - MICROPY_PY_ALL_SPECIAL_METHODS = 1
    - MICROPY_PY_BUILTINS_EXECFILE = 1
    - MICROPY_PY_BUILTINS_SLICE_ATTRS = 1
    - MICROPY_PY_BUILTINS_STR_CENTER = 1
    - MICROPY_PY_BUILTINS_STR_PARTITION = 1
    - MICROPY_PY_BUILTINS_STR_SPLITLINES = 1
    - MICROPY_PY_CMATH = 1
    - MICROPY_PY_COLLECTIONS_ORDEREDDICT = 1
    - MICROPY_PY_FRAMEBUF = 1
    - MICROPY_PY_IO = 1
    - MICROPY_PY_MATH_SPECIAL_FUNCTIONS = 1
    - MICROPY_PY_SYS_STDIO_BUFFER = 1
    - MICROPY_PY_UCTYPES = 1
    - MICROPY_PY_UHEAPQ = 1
    - MICROPY_PY_UJSON = 1
    - MICROPY_PY_URE = 1
    - MICROPY_PY_UZLIB = 1
    - MICROPY_REPL_EMACS_KEYS = 1
2022-06-03 12:37:12 +10:00
Andrew Leech 13f5d38f2e nrf/mpconfigport: Set MICROPY_CONFIG_ROM_LEVEL defines for each MCU.
This commit is a no-op change to simplify existing config.
2022-06-03 12:36:40 +10:00
Damien George 6e71cde6aa ports: Use default VFS config for import_stat and builtin_open.
For ports with MICROPY_VFS and MICROPY_PY_IO enabled their configuration
can now be simplified to use the defaults for mp_import_stat and
mp_builtin_open.

This commit makes no functional change, except for the following minor
points:
- the built-in "open" is removed from the minimal port (it previously did
  nothing)
- the duplicate built-in "input" is removed from the esp32 port
- qemu-arm now delegates to VFS import/open

Signed-off-by: Damien George <damien@micropython.org>
2022-05-25 13:04:45 +10:00
Jim Mussared f67ac90fa9 nrf: Make port-specific modules use MP_REGISTER_MODULE.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-05-18 20:57:09 +10:00
Damien George fbd47fc46c ports: Consolidate inclusion of umachine module in built-ins.
The inclusion of `umachine` in the list of built-in modules is now done
centrally in py/objmodule.c.  Enabling MICROPY_PY_MACHINE will include this
module.

As part of this, all ports now have `umachine` as the core module name
(previously some had only `machine` as the name).

Signed-off-by: Damien George <damien@micropython.org>
2022-02-03 10:08:54 +11:00
Jim Mussared b326edf68c all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.
This commit removes all parts of code associated with the existing
MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE optimisation option, including the
-mcache-lookup-bc option to mpy-cross.

This feature originally provided a significant performance boost for Unix,
but wasn't able to be enabled for MCU targets (due to frozen bytecode), and
added significant extra complexity to generating and distributing .mpy
files.

The equivalent performance gain is now provided by the combination of
MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE (which has
been enabled on the unix port in the previous commit).

It's hard to provide precise performance numbers, but tests have been run
on a wide variety of architectures (x86-64, ARM Cortex, Aarch64, RISC-V,
xtensa) and they all generally agree on the qualitative improvements seen
by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and
MICROPY_OPT_MAP_LOOKUP_CACHE.

For example, on a "quiet" Linux x64 environment (i3-5010U @ 2.10GHz) the
change from CACHE_MAP_LOOKUP_IN_BYTECODE, to LOAD_ATTR_FAST_PATH combined
with MAP_LOOKUP_CACHE is:

diff of scores (higher is better)
N=2000 M=2000       bccache -> attrmapcache      diff      diff% (error%)
bm_chaos.py        13742.56 ->   13905.67 :   +163.11 =  +1.187% (+/-3.75%)
bm_fannkuch.py        60.13 ->      61.34 :     +1.21 =  +2.012% (+/-2.11%)
bm_fft.py         113083.20 ->  114793.68 :  +1710.48 =  +1.513% (+/-1.57%)
bm_float.py       256552.80 ->  243908.29 : -12644.51 =  -4.929% (+/-1.90%)
bm_hexiom.py         521.93 ->     625.41 :   +103.48 = +19.826% (+/-0.40%)
bm_nqueens.py     197544.25 ->  217713.12 : +20168.87 = +10.210% (+/-3.01%)
bm_pidigits.py      8072.98 ->    8198.75 :   +125.77 =  +1.558% (+/-3.22%)
misc_aes.py        17283.45 ->   16480.52 :   -802.93 =  -4.646% (+/-0.82%)
misc_mandel.py     99083.99 ->  128939.84 : +29855.85 = +30.132% (+/-5.88%)
misc_pystone.py    83860.10 ->   82592.56 :  -1267.54 =  -1.511% (+/-2.27%)
misc_raytrace.py   21490.40 ->   22227.23 :   +736.83 =  +3.429% (+/-1.88%)

This shows that the new optimisations are at least as good as the existing
inline-bytecode-caching, and are sometimes much better (because the new
ones apply caching to a wider variety of map lookups).

The new optimisations can also benefit code generated by the native
emitter, because they apply to the runtime rather than the generated code.
The improvement for the native emitter when LOAD_ATTR_FAST_PATH and
MAP_LOOKUP_CACHE are enabled is (same Linux environment as above):

diff of scores (higher is better)
N=2000 M=2000        native -> nat-attrmapcache  diff      diff% (error%)
bm_chaos.py        14130.62 ->   15464.68 :  +1334.06 =  +9.441% (+/-7.11%)
bm_fannkuch.py        74.96 ->      76.16 :     +1.20 =  +1.601% (+/-1.80%)
bm_fft.py         166682.99 ->  168221.86 :  +1538.87 =  +0.923% (+/-4.20%)
bm_float.py       233415.23 ->  265524.90 : +32109.67 = +13.756% (+/-2.57%)
bm_hexiom.py         628.59 ->     734.17 :   +105.58 = +16.796% (+/-1.39%)
bm_nqueens.py     225418.44 ->  232926.45 :  +7508.01 =  +3.331% (+/-3.10%)
bm_pidigits.py      6322.00 ->    6379.52 :    +57.52 =  +0.910% (+/-5.62%)
misc_aes.py        20670.10 ->   27223.18 :  +6553.08 = +31.703% (+/-1.56%)
misc_mandel.py    138221.11 ->  152014.01 : +13792.90 =  +9.979% (+/-2.46%)
misc_pystone.py    85032.14 ->  105681.44 : +20649.30 = +24.284% (+/-2.25%)
misc_raytrace.py   19800.01 ->   23350.73 :  +3550.72 = +17.933% (+/-2.79%)

In summary, compared to MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE, the new
MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE options:
- are simpler;
- take less code size;
- are faster (generally);
- work with code generated by the native emitter;
- can be used on embedded targets with a small and constant RAM overhead;
- allow the same .mpy bytecode to run on all targets.

See #7680 for further discussion.  And see also #7653 for a discussion
about simplifying mpy-cross options.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 16:04:03 +10:00
Damien George 122d901ef1 extmod/machine_i2c: Make SoftI2C configurable via macro option.
The zephyr port doesn't support SoftI2C so it's not enabled, and the legacy
I2C constructor check can be removed.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 13:11:23 +10:00
Daniel Mizyrycki 8f45f5ee4f nrf: Set .mpy features consistent with documentation and other ports.
This allows nrf devices to load .mpy files.  And nrf52840 and nrf9160 based
boards also support compiling and loading native code.
2021-08-13 23:22:54 +10:00
Daniel Mizyrycki 8645b7c23b nrf: Enable source line on tracebacks. 2021-08-09 15:09:33 +10:00
Glenn Ruben Bakke f99aa82e85 nrf/mpconfigport.h: Enable MICROPY_PY_IO_FILEIO when an FS is enabled.
Enable MICROPY_PY_IO_FILEIO if MICROPY_VFS_FAT, MICROPY_VFS_LFS1
or MICROPY_VFS2 has been enabled.
2021-08-08 23:09:26 +10:00
Glenn Ruben Bakke c9b72ba694 nrf/mpconfigport.h: Tune FAT FS configuration.
Disable MICROPY_FATFS_MULTI_PARTITION configuration because there is no
partition table in the flash for FATFS to read.

Also, set MICROPY_FATFS_MAX_SS to the size of a flash page.  For nrf51 the
value 1024 is set.  For nrf52/nrf91 the value 4096 is set.
2021-08-08 23:09:26 +10:00
Glenn Ruben Bakke 85cad50266 nrf/mpconfigport.h: Expose nrf module when MICROPY_PY_NRF is set. 2021-08-08 23:09:26 +10:00
Zoltán Vörös 8c02b94946 nrf: Add more math sources to Makefile, and enable log2 implementation.
This commit adds a few math functions to the source list in the Makefile,
and implements the log2f function, so that ulab can be compiled on the nrf
boards.  It also addresses part of #5162.
2021-06-08 16:39:47 +10:00
Bruno Martins 94fb5e7f5a nrf: Add machine.memXX, and allow boards to customise some features. 2021-05-18 12:01:51 +10:00
Damien George ad4656b861 all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD.
The "word" referred to by BYTES_PER_WORD is actually the size of mp_obj_t
which is not always the same as the size of a pointer on the target
architecture.  So rename this config value to better reflect what it
measures, and also prefix it with MP_.

For uses of BYTES_PER_WORD in setting the stack limit this has been
changed to sizeof(void *), because the stack usually grows with
machine-word sized values (eg an nlr_buf_t has many machine words in it).

Signed-off-by: Damien George <damien@micropython.org>
2021-02-04 22:46:42 +11:00
Damien George 7c44354592 ports: Remove def of MP_PLAT_PRINT_STRN if it's the same as the default.
To simplify config, there's no need to specify MP_PLAT_PRINT_STRN if it's
the same as the default definition in py/mpconfig.h.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-04 22:39:17 +11:00