Commit Graph

24 Commits

Author SHA1 Message Date
Dan Halbert 367e13c69f change CIRCUITPY change markers to CIRCUITPY-CHANGE 2023-10-19 16:42:36 -04:00
Dan Halbert f2ebe6839c Initial MicroPython v1.21.0 merge; not compiled yet 2023-10-18 17:49:14 -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
glenn20 9d735d1be7 py/ringbuf: Implement put_bytes/get_bytes functions. 2023-05-01 16:47:03 +10:00
Dan Halbert ea15a9118a ringbuf cleanup 2022-09-21 10:03:05 -04:00
Dan Halbert b29b7bfe32 Free ringbuf buffer by relying on gc, not gc_free() 2022-04-04 20:34:49 -04:00
Scott Shawcroft 5a6f456dbb
Add BLE scanning for S3 and C3.
Everything else should raise NotImplementedError.

First step in #5926
2022-01-25 16:28:46 -08:00
EmergReanimator da58c029a0 Introduced ringbuf_init to perform static buffer initialisation 2022-01-05 20:48:44 +01:00
Scott Shawcroft b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Jim Mussared e6881f0829 extmod/modbluetooth: Make modbluetooth event not a bitfield.
There doesn't appear to be any use for only triggering on specific events,
so it's just easier to number them sequentially.  This makes them smaller
values so they take up only 1 byte in the ringbuf, only 1 byte for the
opcode in the bytecode, and makes room for more events.

Also add a couple of new event types that need to be implemented (to avoid
re-numbering later).

And rename _COMPLETE and _STATUS to _DONE for consistency.

In the future the "trigger" keyword argument can be reinstated by requiring
the user to compute the bitmask, eg:

    ble.irq(handler, 1 << _IRQ_SCAN_RESULT | 1 << _IRQ_SCAN_DONE)
2020-06-05 14:04:20 +10:00
stijn 97ccde0c43 py/ringbuf: Fix compilation with msvc.
Older versions do not have "inline" so fetch the definition from
mpconfigport.h.
2020-05-28 09:56:18 +10:00
Dan Halbert fbc8719fad ringbuf tested 2020-04-21 22:40:12 -04:00
Dan Halbert 38ec3bc574 further ringbuf cleanup 2020-04-21 17:38:20 -04:00
Damien George 69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00
Jim Mussared 4f96689281 py/ringbuf: Add peek16 method. 2019-11-21 12:04:53 +11:00
Scott Shawcroft ae30a1e5aa
Refine _bleio
This PR refines the _bleio API. It was originally motivated by
the addition of a new CircuitPython service that enables reading
and modifying files on the device. Moving the BLE lifecycle outside
of the VM motivated a number of changes to remove heap allocations
in some APIs.

It also motivated unifying connection initiation to the Adapter class
rather than the Central and Peripheral classes which have been removed.
Adapter now handles the GAP portion of BLE including advertising, which
has moved but is largely unchanged, and scanning, which has been enhanced
to return an iterator of filtered results.

Once a connection is created (either by us (aka Central) or a remote
device (aka Peripheral)) it is represented by a new Connection class.
This class knows the current connection state and can discover and
instantiate remote Services along with their Characteristics and
Descriptors.

Relates to #586
2019-10-21 18:57:03 -07:00
Jim Mussared 42e9bdf19b py/ringbuf: Add helpers for put16/get16. 2019-10-01 09:51:02 +10:00
Dan Halbert 28cfd8a513 CharacteristicBuffer: make it be a stream class; add locking 2019-01-19 19:45:35 -05:00
Dan Halbert ef61b5ecb5 Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
2017-08-25 22:17:07 -04:00
Scott Shawcroft 6ace744667 esp8266: Introduce `multiterminal` module for managing a secondary
serial connection such as WebREPL.

Fixes #181.
2017-08-07 14:30:11 -07:00
Alexander Steffen 299bc62586 all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.

This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.

The rules are as follows.

Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _

In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.

py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
2017-07-18 11:57:39 +10:00
Ville Skyttä ca16c38210 various: Spelling fixes 2017-05-29 11:36:05 +03:00
Paul Sokolovsky b1dfdaf6cb py/ringbuf.h: Add reusable ring buffer class.
Features inline get/put operations for the highest performance. Locking
is not part of implementation, operation should be wrapped with locking
externally as needed.
2016-03-30 14:48:31 +03:00