Skip to content

Commit

Permalink
[GC] Fix rumble trigger on wrong bit and task stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
darthcloud committed Sep 8, 2020
1 parent f80eed6 commit 8c65217
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/bluetooth/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ int32_t bt_host_init(void) {
bt_host_load_keys_from_file(&bt_host_link_keys);

xTaskCreatePinnedToCore(&bt_host_task, "bt_host_task", 4096, NULL, 5, NULL, 0);
xTaskCreatePinnedToCore(&bt_fb_task, "bt_fb_task", 1024, NULL, 10, NULL, 0);
xTaskCreatePinnedToCore(&bt_fb_task, "bt_fb_task", 2048, NULL, 10, NULL, 0);
xTaskCreatePinnedToCore(&bt_tx_task, "bt_tx_task", 2048, NULL, 11, NULL, 0);

bt_hci_init();
Expand Down
10 changes: 6 additions & 4 deletions main/wired/nsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,12 @@ static void IRAM_ATTR gc_isr(void *arg) {
RMT.conf_ch[channel].conf1.tx_start = 1;

if (config.out_cfg[port].acc_mode == ACC_RUMBLE) {
if (last_rumble[port] != buf[1]) {
last_rumble[port] = buf[1];
buf[0] = port;
adapter_q_fb(buf, 2);
uint8_t rumble_data[2];
rumble_data[1] = buf[1] & 0x01;
if (last_rumble[port] != rumble_data[1]) {
last_rumble[port] = rumble_data[1];
rumble_data[0] = port;
adapter_q_fb(rumble_data, 2);
}
}

Expand Down

0 comments on commit 8c65217

Please sign in to comment.