Autodetect external cc1101 GPIO for external antenna support

This commit is contained in:
RocketGod committed 2025-12-10 20:07:24 -08:00
1 parent d2eb2402d5
commit 284f452ff0
2 files changed
+14 -3

No files matched your search

BIN
View File
Binary file not shown.
+14 -3
View File
@@ -126,9 +126,20 @@ ProtoPirateApp *protopirate_app_alloc()
// Initialize SubGhz devices
subghz_devices_init();
// Use internal radio
app->txrx->radio_device =
radio_device_loader_set(app->txrx->radio_device, SubGhzRadioDeviceTypeInternal);
// Try external CC1101 first, fallback to internal
app->txrx->radio_device =
radio_device_loader_set(NULL, SubGhzRadioDeviceTypeExternalCC1101);
if(!app->txrx->radio_device) {
FURI_LOG_W(TAG, "External CC1101 not found, using internal CC1101.");
app->txrx->radio_device =
radio_device_loader_set(NULL, SubGhzRadioDeviceTypeInternal);
if(!app->txrx->radio_device) {
FURI_LOG_E(TAG, "Failed to initialize internal CC1101.");
}
} else {
FURI_LOG_I(TAG, "External CC1101 detected and initialized.");
}
if (!app->txrx->radio_device)
{