Commit graph

157 commits

Author SHA1 Message Date
Dan Halbert
7d48b0161a document different kinds of _bleio 2024-10-24 16:02:24 -04:00
Dan Halbert
ac0904e4bb improve _bleio.Connection.bind() doc, validation, and error messages 2024-10-18 19:29:54 -04:00
Dan Halbert
d0dc144d4d fix ble_serial_connected() 2024-10-03 16:55:00 -04:00
Dan Halbert
d777cd7d78 Merge remote-tracking branch 'adafruit/main' into merge-micropython-v1.23.0 2024-09-13 15:54:55 -04:00
Scott Shawcroft
799044c868
Merge remote-tracking branch 'adafruit/9.1.x' into merge_in_9.1.x 2024-09-12 15:14:53 -07:00
Scott Shawcroft
03b077dd91
Add deinit() to _bleio.Characteristic
Espressif's Characteristics allocate memory that may be on the
supervisor heap. We need to free it when stopping BLE workflow.
Otherwise, we leak the memory and eventually safe mode.

Fixes #9599
2024-09-12 13:35:25 -07:00
Dan Halbert
1f68fffa13 merge from main 2024-09-10 16:36:32 -04:00
Dan Halbert
bc6f065447 working on compilation errors 2024-09-06 23:10:41 -04:00
Pablo Martínez
0f94cc5f92
Update shared-bindings/_bleio/CharacteristicBuffer.c
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2024-08-27 22:59:41 +02:00
elpekenin
1cfedcb79c fix CharacteristicBuffer.readinto 2024-08-22 23:22:15 +02:00
elpekenin
71ef507c18 fix ScanEntry.matches 2024-08-22 16:43:45 +02:00
elpekenin
0ebbb39460 fix CharacteristicBuffer.timeout 2024-08-20 22:40:42 +02:00
elpekenin
95d776211a fix Characteristic.add_to_service 2024-08-20 20:24:40 +02:00
Scott Shawcroft
4c85b5f02e
Fix other BLE builds 2024-06-12 11:22:00 -07:00
Scott Shawcroft
63aeb11d7e
Improve ESP BLE and turn on BLE workflow
The BLE workflow will broadcast publicly when the web workflow
isn't activated.
2024-06-11 16:21:40 -07:00
Dan Halbert
3f4d9310ff CircuitPython files: replace STATIC with static 2024-05-20 11:02:17 -04:00
Dan Halbert
950b5d09d2 guard2once -s ... 2024-05-19 20:40:44 -04:00
Dan Halbert
6c4bfd6738
Merge pull request #9222 from tannewt/esp_ble_server
Add ESP BLE GATT server support
2024-05-17 17:24:45 -04:00
Dan Halbert
747b7619ea update headers of most CircuitPython-only files 2024-05-17 14:56:28 -04:00
Scott Shawcroft
689c6fac20
Add ESP BLE GATT server support
Enable BLE where we can. Switch 4MB, non-USB board default partitioning
over to a single 2MB firmware bank. Old boards override this setting to
keep the same behavior.

This also adds alpha support for the ESP32-C2 (aka ESP8684).

Fixes #5926 and fixes #7170
2024-05-17 11:08:07 -07:00
Andrew Guest
1865db24f8 Fix typo in start_advertising() param docs 2024-05-14 19:30:03 -05:00
Scott Shawcroft
d1e710fb4b
Merge remote-tracking branch 'adafruit/8.2.x' into merge_in_8.2.x 2024-02-13 11:18:56 -08:00
RetiredWizard
2490303a23 Add pre-commit changes (black 24.11) formattings changes 2024-02-12 16:56:21 -05:00
5aa203f13e
Restore CIRCUITPY-CHANGEs for stream protocols
We mark all protocols with their type using MP_PROTO_IMPLEMENT,
and checking in mp_get_stream{,_raise}.

This was not turning up as a problem in tests until a (new, not yet
commited) change to jpegio caused a segfault because a type implementing
a different protocol was passed in to mp_get_stream.

By using 0 (instead of MP_QSTR_protocol_stream) as the marker for
objects implementing the standard micropython stream protocol, the
number of CIRCUITPY-CHANGEs is minimized.
2023-12-24 10:41:54 -06:00
Dan Halbert
af1b8799a4 fix heap warning in espressif Adapter.c;fix error codes 2023-11-20 20:05:43 -05:00
774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
de541cf155
Fix pointer-ness, const-ness of compressed messages
micropython puts the pointer-ness into the typedef; we can put the
const-ness there too.

this reduces the delta to micropython; for instance, emitinlinextensa
and emitinlinethumb now match upstream.
2023-10-25 21:40:11 +02:00
55874b6470
Rename compressed_string_t to mp_rom_error_text_t to match upstream 2023-10-25 08:14:13 +02:00
Scott Shawcroft
e62db5adcd
Fix native property setting from subclass 2023-10-24 16:20:51 -07:00
Dan Halbert
c0a4abc03c Fix merge bugs; remove shared/tinyusb/* 2023-10-19 16:02:42 -04:00
Dan Halbert
7e0e6fcdca Metro M4 now compiles 2023-10-03 15:03:59 -04:00
51f49698c2
indentation 2023-09-20 11:27:01 -05: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
Dan Halbert
d582407b06 pre-commit fixes 2023-08-14 00:59:22 -04:00
Dan Halbert
fe0e2f13bc wip; fix qstr processing 2023-08-10 20:06:32 -04:00
Dan Halbert
0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
Scott Shawcroft
931c7c1c51
Add Bangle.js 2, JDI memory displays and ACeP epd
This 2-in-1 PR started with the goal of support the Bangle.js 2
smartwatch with *no USB*.
* Adds "secure" DFU build support with a committed private key.
* Adds 3-bit color support with one dummy bit for the JDI memory display
* Allows nrf boards to have a board_background_task() run in RUN_BACKGROUND_TASK.
  This is needed because the Bangle.js 2 uses the watchdog to reset.
* Renamed port_background_task() to port_background_tick() to indicate it
  runs on tick, not RUN_BACKGROUND_TASK.
* Marks serial connected when the display terminal is inited. This means
  that safe mode messages show up on the display.

ACep, 7-color epaper displays also pack 3 bits in 4. So, I added that
support as well.
* Adds 3-bit ACeP color support for 7-color e-paper displays. (Not
  watch related but similar due to color depth.)
* Allows a refresh sequence instead of a single int command. The 7" ACeP
  display requires a data byte for refresh.
* Adds optional delay after resetting the display. The ACeP displays
  need this. (Probably to load LUTs from flash.)
* Adds a cleaning phase for ACeP displays before the real refresh.

For both:
* Add dither support to Palette.
* Palette no longer converts colors when set. Instead, it caches
  converted colors at each index.
* ColorConverter now caches the last converted color. It should make
  conversions faster for repeated colors (not dithering.)
2023-02-15 15:03:40 -08:00
MicroDev
d9d94eacca
run updated pre-commit 2023-02-01 13:38:41 +05:30
Scott Shawcroft
dca66eb98c
Watch for ctrl-c over BLE workflow serial
Before this, it was impossible to interrupt a running program over
BLE.
2023-01-18 16:28:35 -08:00
Dan Halbert
a974402542 Improve type validation errors messages, especially for pins 2023-01-10 15:02:55 -05:00
Dan Halbert
c52b5b64e5 add Characteristic.descriptors to locals dict 2022-10-26 12:34:33 -04:00
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
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
b2cc8d2aad
run black_bindings across all bindings 2022-09-27 15:21:42 -05:00
Scott Shawcroft
7a07247974
Remove all kwarg from ScanEntry.matches
Fixes #3007
2022-08-09 14:37:52 -07:00
Scott Shawcroft
83cbbc9946
Add BLE status to title bar 2022-08-04 16:33:10 -07:00
Dan Halbert
a01dec1df9 message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
Scott Shawcroft
269d51d023
Add two stage reset for BLE
This lets the BLE stack run through the wait period after a VM run
when it may be waiting for more writes due to an auto-reload.

User BLE functionality will have their events stopped. Scanning and
advertising is also stopped.
2022-05-12 13:20:44 -07:00
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