Wykres commitów

7 Commity (master)

Autor SHA1 Wiadomość Data
Angus Gratton decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
The STATIC macro was introduced a very long time ago in commit
d5df6cd44a.  The original reason for this was
to have the option to define it to nothing so that all static functions
become global functions and therefore visible to certain debug tools, so
one could do function size comparison and other things.

This STATIC feature is rarely (if ever) used.  And with the use of LTO and
heavy inline optimisation, analysing the size of individual functions when
they are not static is not a good representation of the size of code when
fully optimised.

So the macro does not have much use and it's simpler to just remove it.
Then you know exactly what it's doing.  For example, newcomers don't have
to learn what the STATIC macro is and why it exists.  Reading the code is
also less "loud" with a lowercase static.

One other minor point in favour of removing it, is that it stops bugs with
`STATIC inline`, which should always be `static inline`.

Methodology for this commit was:

1) git ls-files | egrep '\.[ch]$' | \
   xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/"

2) Do some manual cleanup in the diff by searching for the word STATIC in
   comments and changing those back.

3) "git-grep STATIC docs/", manually fixed those cases.

4) "rg -t python STATIC", manually fixed codegen lines that used STATIC.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-07 14:20:42 +11:00
Jim Mussared bc9ec1cf71 extmod/modbluetooth: Merge gatts_notify/indicate implementation.
Makes gatts_notify and gatts_indicate work in the same way: by default they
send the DB value, but you can manually override the payload.

In other words, makes gatts_indicate work the same as gatts_notify.

Note: This removes support for queuing notifications and indications on
btstack when the ACL buffer is full. This functionality will be
reimplemented in a future commit.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-04-26 11:37:20 +10:00
David Lechner ccda7686a4 zephyr: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register port-specific root
pointers for the zephyr port.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:50:35 +10:00
Damien George a49b51b7db zephyr/modbluetooth_zephyr: Provide dummy connect_cancel function.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-13 13:45:55 +11:00
Jim Mussared 43467b9c71 extmod/modbluetooth: Add connection interval to gap_connect.
This forwards through directly to the NimBLE and BTStack connect functions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-26 00:16:53 +11:00
Jim Mussared 1d9e489af3 extmod/modbluetooth: Add send_update arg to gatts_write.
This allows the write to trigger a notification or indication, but only to
subscribed clients. This is different to gatts_notify/gatts_indicate,
which will unconditionally notify/indicate.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-14 22:21:55 +10:00
Damien George 80e79a777d zephyr: Add initial ubluetooth module integration.
Currently only advertising and scanning are supported, using the ring
buffer for events (ie not synchronous events at this stage).

The ble_gap_advertise.py multi-test passes (tested on a nucleo_wb55rg
board).

Signed-off-by: Damien George <damien@micropython.org>
2021-06-06 21:57:06 +10:00