Commit Graph

179 Commits

Author SHA1 Message Date
Dan Halbert 3a34acb93c merge 8.2.x to main 2023-11-09 19:58:34 -05:00
Jeff Epler 774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
Scott Shawcroft e62db5adcd
Fix native property setting from subclass 2023-10-24 16:20:51 -07:00
Dan Halbert 021926c96a Fix DotClockFrameBuffer type definition
also remove unnecessary `const` with `MP_DEFINE_CONST_TYPE_OBJ` in I2C
2023-10-13 12:11:14 -04:00
Scott Shawcroft 9633c4e78f
Merge remote-tracking branch 'adafruit/main' into v1.20-merge 2023-10-11 11:21:57 -07:00
Dan Halbert 76ff01452b Trinket M0 comes up; still very much wip 2023-09-28 16:22:10 -04:00
Dan Halbert 4d175ab41a convert to MP_DEFINED_CONST_OBJ_TYPE() 2023-09-19 21:09:29 -04:00
Dan Halbert 2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
Jeff Epler c029d6a165
Merge remote-tracking branch 'origin/8.2.x' into merge-82x 2023-08-22 08:49:16 -05:00
Dan Halbert d582407b06 pre-commit fixes 2023-08-14 00:59:22 -04:00
Dan Halbert 2ff8667e75 wip; remove long-lived functionality; remove PR#2614
Trinket M0 compile has no compilation errors, but has link errors to fix.
2023-08-08 20:41:17 -04:00
Dan Halbert 0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
Jeff Epler f15eceb24c
Document more classes that can be separately enabled 2023-07-20 11:16:49 -05:00
hathach fecc1bdedb
fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
Dan Halbert 6d51356324 Fix pad assignments on atmel-samd UART 2023-02-19 20:42:44 -05:00
MicroDev d9d94eacca
run updated pre-commit 2023-02-01 13:38:41 +05:30
Scott Shawcroft 8b0db804ba
Fix SPI readinto with negative start or end 2023-01-12 16:25:11 -08:00
Scott Shawcroft aa2ba4d88b
Have start and end kwargs respect element size
The comment says it is `buffer[start:end]` but it assumed elements
were a single byte long. Now it correctly does multibyte elements
from array.array.

Fixes #4988
2023-01-11 15:36:41 -08:00
Dan Halbert a974402542 Improve type validation errors messages, especially for pins 2023-01-10 15:02:55 -05:00
Jeff Epler 530e5a1df2
Use standard validation function 2022-11-30 14:39:51 -06:00
Jeff Epler 7c9cd567a0
If uart is disabled, no pins will work; show NotImplementedError instead 2022-11-30 12:06:18 -06:00
Jeff Epler 284ac21f51
merge a message 2022-11-30 12:06:16 -06:00
Jeff Epler 9cdfba2e47
Simplify argument checking to reduce translated strings
Build size on proxlight trinkey m0 en_US:
Before:  2412 (en_US)  820 (ru)
After:   2544 (en_US)  984 (ru)
Savings: +132 (en_US) +164 (ru) bytes available flash
2022-11-07 12:37:11 -06:00
Dan Halbert 01c15a1d1b catalog implementation limitations in documentation 2022-10-21 13:58:34 -04:00
Jeff Epler 068b7c4af8
Use micropython #defines for stream polling operations
We adopted the file "py/ioctl.h" and the ioctl names beginning
with MP_IOCTL_POLL while micropython went with "py/stream.h" and
MP_STREAM_POLL.

Align with upstream.

Closes #6711
2022-10-14 12:15:30 -05:00
Jeff Epler 907c5d387f
Tweak black_bindings
Originally, black_bindings found each contiguous "//|" block and sent
it to black independently. This was slower than it needed to be.

Instead, swap the comment prefix: when running black, take off
"//|" prefixes and put "##|" prefixes on all un-prefixed lines.
Then, after black is run, do the opposite operation

This more than doubles the overall speed of "pre-commit run --all",
from 3m20s to 55s CPU time on my local machine (32.5s to under 10s
"elapsed" time)

It also causes a small amount of churn in the bindings, because
black now sees enough context to know whether one 'def' follows another
or ends the 'def's in a 'class'. In the latter case, it adds an extra
newline, which becomes a "//|" line.

I'm less sure why a trailing comma was omitted before down in
rp2pio/StateMachine.c but let's roll with it.
2022-09-30 11:18:13 -05:00
Jeff Epler b2cc8d2aad
run black_bindings across all bindings 2022-09-27 15:21:42 -05:00
Jeff Epler c415c13517
mend broken doc block
Since black_bindings.py will pass each contiguous
"//|"-block to black independently, they must each be a fully
formed Python item.
2022-09-27 15:19:31 -05:00
Dan Halbert 3abfd212ec nrf: return None when UART.read() reads nothing 2022-09-15 19:40:02 -04:00
Alec Delaney 0d8dab7381
Update write() function definition 2022-08-30 11:18:06 -04:00
Alec Delaney bf9f329a61
Fix UART.readline docstring 2022-08-30 11:12:47 -04:00
Scott Shawcroft 9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00
Dan Halbert 74c92ffe9e Remove busio.OneWire and bitbangio.OneWire 2022-05-24 12:26:33 -04:00
Dan Halbert a01dec1df9 message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
Dan Halbert c1cc9b8bbf
Merge pull request #6353 from tekktrik/doc/add-communication-links
Add links to guides for "essential" modules, others
2022-05-06 22:45:40 -04:00
Dan Halbert 5edc59f070
Merge pull request #6337 from jepler/property-storage
Optimize flash storage of properties
2022-05-06 09:55:18 -04:00
Alec Delaney 802931987a Fix board module additions 2022-05-04 13:49:47 -04:00
Dan Halbert 75bfcb3630 add caveat about software RS485 implementations 2022-05-04 13:05:41 -04:00
Alec Delaney 49918299f2
Update docs with links to tutorials for I2C, SPI, and UART 2022-05-03 13:42:42 -04:00
Jeff Epler 78cf0a90af
Make MP_PROPERTY_GETTER / _GETSET fully declare the property
This will enable setting data attributes, namely, the section of the
symbol.
2022-05-03 08:48:53 -05:00
Jeff Epler 31da335cac
Introduce, use MP_PROPERTY_GETTER, _GETSET
Later, these can be changed in cunning ways to save flash storage.
2022-05-03 08:48:52 -05:00
Alec Delaney e73c5c768b Update documentation for end param in SPI.readinto() 2022-04-19 11:23:39 -04:00
Dan Halbert c4e54ce671 add half_duplex to busio.SPI signature 2022-02-09 14:20:46 -05:00
Scott Gauche 3b418dbddc change half_duplex to be on spi construct 2022-02-08 21:37:38 -05:00
Dan Halbert d0453f460d shrink sensebox; fix doc error 2022-02-01 10:12:26 -05:00
Dan Halbert cc410ad6a3 common-hal I2C combined write_read 2022-01-31 22:03:30 -05:00
Dan Halbert 83e6e6690a wip; works on espressif 2022-01-29 22:44:27 -05:00
Jeff Epler 166793f843 circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing
Installing stubs for a module named `_typing` seems like a dubious
decision.
2021-12-22 11:14:21 -06:00
Jeff Epler f94d3e86cf
UART: Don't allocate the object so early
This object has a finalizer, so once it's no longer referenced, GC can
call that finalizer and then deallocate the storage.

In the case of a failure during construction (e.g., when checking
`validate_obj_is_free_pin_or_none`) this will happen on an incompletely
initialized structure.  On samd, in particular, a newly allocated object
(with construct never called) appears to be valid, so GC collecting it
causes deinit() to do things, leading to a hard fault.

The double creation of the UART object was necessary specifically so that
the second allocation would fail.  Probably there were other (single
call) ways to make it fail, but this was the easiest / the one discovered
in real life.

Closes: #5493
2021-12-01 20:54:39 -06:00
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00