Skip to content

Commit

Permalink
[Keyboard] annepro2: fix bluetooth multi-pairing issue (qmk#17483)
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeeyy authored and crembz committed Dec 18, 2022
1 parent cef8fc8 commit 356c996
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions keyboards/annepro2/annepro2_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ static host_driver_t ap2_ble_driver = {

static uint8_t ble_mcu_wakeup[11] = {0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x01, 0x7d, 0x02, 0x01, 0x02};

static uint8_t ble_mcu_start_broadcast[11] = {
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x01, 0x00 // Broadcast ID[0-3]
static uint8_t ble_mcu_start_broadcast[10] = {
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x01, // Broadcast ID[0-3]
};

static uint8_t ble_mcu_connect[11] = {
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x04, 0x00 // Connect ID [0-3]
static uint8_t ble_mcu_connect[10] = {
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x04, // Connect ID [0-3]
};

static uint8_t ble_mcu_send_report[10] = {
Expand Down Expand Up @@ -76,6 +76,7 @@ void annepro2_ble_broadcast(uint8_t port) {
// sdPut(&SD1, 0x00);
sdWrite(&SD1, ble_mcu_start_broadcast, sizeof(ble_mcu_start_broadcast));
sdPut(&SD1, port);
sdPut(&SD1, 0x00);
static int lastBroadcast = -1;
if (lastBroadcast == port) {
annepro2_ble_connect(port);
Expand All @@ -89,6 +90,7 @@ void annepro2_ble_connect(uint8_t port) {
}
sdWrite(&SD1, ble_mcu_connect, sizeof(ble_mcu_connect));
sdPut(&SD1, port);
sdPut(&SD1, 0x00);
ap2_ble_swtich_ble_driver();
}

Expand Down

0 comments on commit 356c996

Please sign in to comment.