Skip to content

Commit

Permalink
fix pre init bug(add return)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 19, 2021
1 parent 44ba86c commit 2841425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion keyboards/yandrstudio/biu_nrf52_ble_lib/biu_nrf52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ void bluetooth_send_battery_level() {
bool bluetooth_init_pre(void) {
// start the uart data trans
uart_init(BIUNRF52UartBaud);
return true;
}


Expand All @@ -549,7 +550,7 @@ bool bluetooth_init(void) {
state.configured = false;
state.is_connected = false;


// bluetooth_init_pre();
// Perform a hardware reset
setPinOutput(BIUNRF52ResetPin);
writePinHigh(BIUNRF52ResetPin);
Expand Down
8 changes: 5 additions & 3 deletions keyboards/yandrstudio/biu_nrf52_ble_lib/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void midi_ep_task(void);

#ifdef BIU_BLE5_ENABLE
void bluetooth_task(void);
bool bluetooth_init_pre(void);
#endif

/* TESTING
Expand Down Expand Up @@ -219,9 +220,7 @@ int main(void) {
wait_ms(50);
}

// #ifdef BIU_BLE5_ENABLE
// bluetooth_init_pre();
// #endif

/* Do need to wait here!
* Otherwise the next print might start a transfer on console EP
* before the USB is completely ready, which sometimes causes
Expand All @@ -233,6 +232,9 @@ int main(void) {
keyboard_init();
host_set_driver(driver);

#ifdef BIU_BLE5_ENABLE
bluetooth_init_pre();
#endif

#ifdef SLEEP_LED_ENABLE
sleep_led_init();
Expand Down

0 comments on commit 2841425

Please sign in to comment.