fix: ENABLE_SERIAL conditional compilation
This commit is contained in:
+2
-2
@@ -298,7 +298,7 @@ static void hci_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
|
|||||||
}
|
}
|
||||||
|
|
||||||
case HCI_EVENT_DISCONNECTION_COMPLETE: {
|
case HCI_EVENT_DISCONNECTION_COMPLETE: {
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
tud_disconnect();
|
tud_disconnect();
|
||||||
#endif
|
#endif
|
||||||
gap_connectable_control(1);
|
gap_connectable_control(1);
|
||||||
@@ -347,7 +347,7 @@ static void l2cap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
|||||||
}else if (size > 1){
|
}else if (size > 1){
|
||||||
is_dse = true;
|
is_dse = true;
|
||||||
}
|
}
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
tud_connect();
|
tud_connect();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -178,7 +178,7 @@ int main() {
|
|||||||
.speed = TUSB_SPEED_FULL
|
.speed = TUSB_SPEED_FULL
|
||||||
};
|
};
|
||||||
tusb_init(BOARD_TUD_RHPORT, &dev_init);
|
tusb_init(BOARD_TUD_RHPORT, &dev_init);
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
tud_disconnect();
|
tud_disconnect();
|
||||||
#endif
|
#endif
|
||||||
board_init_after_tusb();
|
board_init_after_tusb();
|
||||||
@@ -192,7 +192,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, false);
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, false);
|
||||||
|
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
if (watchdog_caused_reboot()) {
|
if (watchdog_caused_reboot()) {
|
||||||
printf("Rebooted by Watchdog!\n");
|
printf("Rebooted by Watchdog!\n");
|
||||||
// 当崩溃重启以后,闪三下灯
|
// 当崩溃重启以后,闪三下灯
|
||||||
@@ -219,12 +219,12 @@ int main() {
|
|||||||
|
|
||||||
audio_init();
|
audio_init();
|
||||||
|
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
watchdog_enable(1000, true);
|
watchdog_enable(1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifndef ENABLE_SERIAL
|
#if !ENABLE_SERIAL
|
||||||
watchdog_update();
|
watchdog_update();
|
||||||
#endif
|
#endif
|
||||||
cyw43_arch_poll();
|
cyw43_arch_poll();
|
||||||
|
|||||||
Reference in New Issue
Block a user