Skip to content

Commit

Permalink
add programmers guide. WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Apr 30, 2024
1 parent 0d08a50 commit 346b146
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/programmers_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Programmers Guide

WIP

## Raw API

Valid for Pico-SDK / ESP-IDF

From [BTstack documentation][btstack_multithreading]

> BTstack is not thread-safe, but you're using a multi-threading OS.
> Any function that is called from BTstack, e.g., packet handlers, can directly call into BTstack without issues.
> For other situations, you need to provide some general 'do BTstack tasks' function and trigger BTstack to execute
> it on its own thread. To call a function from the BTstack thread, you can use `btstack_run_loop_execute_on_main_thread()`
> allows to directly schedule a function callback, i.e. 'do BTstack tasks' function, from the BTstack thread.
> The called function should check if there are any pending BTstack tasks and execute them.
[btstack_multithreading]: https://github.com/bluekitchen/btstack/blob/master/port/esp32/README.md#multi-threading

## Arduino

## CircuitPython
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ nav:
- 'Unijoysticle board': plat_unijoysticle.md
- 'MightyMiggy board': plat_mightymiggy.md
- Developer:
- 'Programmers Guide': programmers_guide.md
- 'Flashing firmware': firmware_setup.md
- adding_new_platform.md
- 'Architecture': architecture.md
Expand Down
3 changes: 3 additions & 0 deletions src/components/bluepad32/bt/uni_bt_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ static void att_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t* p
memset(ctx, 0, sizeof(*ctx));
ctx->connection_handle = HCI_CON_HANDLE_INVALID;
break;
case HCI_EVENT_DISCONNECTION_COMPLETE:
// Do something?
break;
case HCI_EVENT_LE_META:
switch (hci_event_le_meta_get_subevent_code(packet)) {
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
Expand Down

0 comments on commit 346b146

Please sign in to comment.