Add HackRF Pro (PRALINE) Board Detection and Info Display (#3006)

This commit is contained in:
jLynx
2026-02-19 07:56:22 +00:00
committed by GitHub
parent 819b4d0fed
commit 77f747aab2
5 changed files with 70 additions and 12 deletions
+20 -4
View File
@@ -1386,18 +1386,34 @@ static void cmd_getres(BaseSequentialStream* chp, int argc, char* argv[]) {
static void cmd_getflash(BaseSequentialStream* chp, int argc, char* argv[]) {
(void)argc;
(void)argv;
uint8_t allowrun = FLASH_SIZE_MB;
// FLASH_SIZE_LIMIT_MB may be a float (e.g. 3.5 for HPro), always cast explicitly.
uint8_t allowrun;
#ifdef PRALINE
allowrun = 4; // HackRF Pro
#else
if (portapack::device_type == portapack::DeviceType::DEV_PORTAPACK) {
allowrun = 1;
allowrun = 1; // PortaPack classic
} else {
allowrun = FLASH_SIZE_MB; // PortaRF
}
std::string res = "ALLOWEDFW:" + to_string_dec_uint(FLASH_SIZE_MB) + "\r\nALLOWEDRUNTIME:" + to_string_dec_uint(allowrun) + "\r\nCURRENT:" + to_string_dec_uint(FLASH_SIZE_LIMIT_MB) + "\r\nok\r\n";
#endif
std::string res = "ALLOWEDFW:" + to_string_dec_uint((uint32_t)FLASH_SIZE_MB) + "\r\nALLOWEDRUNTIME:" + to_string_dec_uint((uint32_t)allowrun) + "\r\nCURRENT:" + to_string_dec_uint((uint32_t)FLASH_SIZE_LIMIT_MB) + "\r\nok\r\n";
chprintf(chp, res.c_str());
}
static void cmd_getdevtype(BaseSequentialStream* chp, int argc, char* argv[]) {
(void)argc;
(void)argv;
std::string res = portapack::device_type == portapack::DeviceType::DEV_PORTARF ? "PORTARF" : "PORTAPACK";
std::string res;
#ifdef PRALINE
res = "HPRO";
#else
if (portapack::device_type == portapack::DeviceType::DEV_PORTARF) {
res = "PORTARF";
} else {
res = "PORTAPACK";
}
#endif
res += "\r\nok\r\n";
chprintf(chp, res.c_str());
}