Skip to content

Commit

Permalink
Transmit on state properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Jan 14, 2025
1 parent 4c44296 commit c3984a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/include/zmk/split/bluetooth/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct zmk_split_input_event_payload {
struct zmk_split_update_led_data {
uint8_t layer;
uint8_t indicators;
bool on;
} __packed;
#endif

Expand Down
4 changes: 2 additions & 2 deletions app/src/split/bluetooth/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,8 @@ static int split_bt_update_led_payload(struct zmk_split_update_led_data payload)
};

int zmk_split_bt_update_led(struct zmk_periph_led *periph) {
struct zmk_split_update_led_data payload = {.layer = periph->layer,
.indicators = periph->indicators};
struct zmk_split_update_led_data payload = {
.layer = periph->layer, .indicators = periph->indicators, .on = periph->on};

return split_bt_update_led_payload(payload);
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/split/bluetooth/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ static ssize_t split_svc_update_led(struct bt_conn *conn, const struct bt_gatt_a
// 1: We've gotten all the position/state/param data.
// 2: We have a null terminated string for the behavior device label.
if ((end_addr == sizeof(struct zmk_split_update_led_data))) {
struct zmk_periph_led periph = {.layer = payload->layer, .indicators = payload->indicators};
struct zmk_periph_led periph = {
.layer = payload->layer, .indicators = payload->indicators, .on = payload->on};
zmk_rgb_underglow_set_periph(periph);
LOG_DBG("Update leds with params %d and %d", periph.layer, periph.indicators);
}
Expand Down

0 comments on commit c3984a3

Please sign in to comment.