Compare commits

...

6 Commits

Author SHA1 Message Date
jLynx c04e3d100f
Merge c52c48090a into 0ea8453e8a 2024-04-30 21:10:07 +08:00
sommermorgentraum 0ea8453e8a
tune output order (#2132) 2024-04-30 08:07:39 -05:00
sommermorgentraum 1ffedace7b
replace_my_ide_s_default_comment (#2131) 2024-04-30 08:08:21 +02:00
Mark Thompson e43f7a7980
Change flashing message to match LED behavior (#2130) 2024-04-29 22:29:46 +02:00
jLynx c52c48090a Updated labels 2024-04-26 20:15:57 +12:00
jLynx fd0124ac48 WIP getting name from board 2024-04-26 20:14:07 +12:00
5 changed files with 97 additions and 16 deletions

View File

@ -163,8 +163,8 @@ bool FlashUtilityView::flash_firmware(std::filesystem::path::string_type path) {
ui::Color::black());
painter.draw_string({12, 24}, this->nav_.style(), "This will take 15 seconds.");
painter.draw_string({12, 64}, this->nav_.style(), "Please wait while LEDs RX");
painter.draw_string({12, 84}, this->nav_.style(), "and TX are flashing.");
painter.draw_string({12, 64}, this->nav_.style(), "Please wait while LED RX");
painter.draw_string({12, 84}, this->nav_.style(), "is on and TX is flashing.");
painter.draw_string({12, 124}, this->nav_.style(), "Device will then restart.");
std::memcpy(&shared_memory.bb_data.data[0], path.c_str(), (path.length() + 1) * 2);

View File

@ -32,6 +32,8 @@
#include "chprintf.h"
#include "portapack.hpp"
#include "platform_detect.h"
/**
* @brief Shell termination event source.
*/
@ -65,6 +67,39 @@ static void list_commands(BaseSequentialStream* chp, const ShellCommand* scp) {
}
}
static const char* get_board_revision_string(board_rev_t rev) {
switch (rev) {
case BOARD_REV_HACKRF1_OLD:
return "HackRF R1-R5";
case BOARD_REV_HACKRF1_R6:
return "HackRF R6";
case BOARD_REV_HACKRF1_R7:
return "HackRF R7";
case BOARD_REV_HACKRF1_R8:
return "HackRF R8";
case BOARD_REV_HACKRF1_R9:
return "HackRF R9";
case BOARD_REV_HACKRF1_R10:
return "HackRF R10";
case BOARD_REV_GSG_HACKRF1_R6:
return "GSG HackRF R6";
case BOARD_REV_GSG_HACKRF1_R7:
return "GSG HackRF R7";
case BOARD_REV_GSG_HACKRF1_R8:
return "GSG HackRF R8";
case BOARD_REV_GSG_HACKRF1_R9:
return "GSG HackRF R9";
case BOARD_REV_GSG_HACKRF1_R10:
return "GSG HackRF R10";
case BOARD_REV_UNRECOGNIZED:
return "Unrecognized";
case BOARD_REV_UNDETECTED:
return "Undetected";
default:
return "Unknown";
}
}
static void cmd_info(BaseSequentialStream* chp, int argc, char* argv[]) {
(void)argv;
if (argc > 0) {
@ -92,7 +127,11 @@ static void cmd_info(BaseSequentialStream* chp, int argc, char* argv[]) {
#ifdef VERSION_STRING
chprintf(chp, "Mayhem Version: %s\r\n", VERSION_STRING);
#endif
chprintf(chp, "HackRF Board Rev: %s\r\n", hackrf_r9 ? "R9" : "R1-R8");
// Usage
board_rev_t revision = detected_revision();
const char* revision_string = get_board_revision_string(revision);
chprintf(chp, "HackRF Board Rev: %s\r\n", revision_string);
chprintf(chp, "Reference Source: %s\r\n", portapack::clock_manager.get_source().c_str());
chprintf(chp, "Reference Freq: %s\r\n", portapack::clock_manager.get_freq().c_str());
#ifdef __DATE__

View File

@ -1,5 +1,25 @@
#!/usr/bin/env python3
#
# created by zxkmm on ArchHaseeHome - 2024/01/xx
# Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
# Copyleft (ɔ) 2024 zxkmm with the GPL license
#
# This file is part of PortaPack.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
from PIL import Image

View File

@ -1,5 +1,25 @@
#!/usr/bin/env python3
#
# Created by zxkmm on ArchHaseeHome - 2024/04/22
# Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
# Copyleft (ɔ) 2024 zxkmm with the GPL license
#
# This file is part of PortaPack.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
import subprocess

View File

@ -76,7 +76,8 @@ def get_gcc_version_from_elf_files_in_giving_path_or_filename_s_path(path):
elf_files = [os.path.join(os.path.dirname(path), f) for f in os.listdir(os.path.dirname(path)) if
f.endswith(".elf")]
else:
print("gave path or filename is not valid") # didn't use except nor exit here cuz don't need to break compile if this is bad result anyway
print(
"gave path or filename is not valid") # didn't use except nor exit here cuz don't need to break compile if this is bad result anyway
gcc_versions = []
for elf_file in elf_files:
@ -95,6 +96,17 @@ application_image = read_image(sys.argv[1])
baseband_image = read_image(sys.argv[2])
output_path = sys.argv[3]
print("\ncheck gcc versions from all elf target\n")
application_gcc_versions = get_gcc_version_from_elf_files_in_giving_path_or_filename_s_path(sys.argv[1])
baseband_gcc_versions = get_gcc_version_from_elf_files_in_giving_path_or_filename_s_path(sys.argv[2])
for itap in application_gcc_versions:
print(itap)
for itbb in baseband_gcc_versions:
print(itbb)
print("\n")
spi_size = 1048576
images = (
@ -149,13 +161,3 @@ write_image(spi_image, output_path)
percent_remaining = round(1000 * pad_size / spi_size) / 10;
print("Space remaining in flash ROM:", pad_size, "bytes (", percent_remaining, "%)")
print("check gcc versions from all elf target")
application_gcc_versions = get_gcc_version_from_elf_files_in_giving_path_or_filename_s_path(sys.argv[1])
baseband_gcc_versions = get_gcc_version_from_elf_files_in_giving_path_or_filename_s_path(sys.argv[2])
for itap in application_gcc_versions:
print(itap)
for itbb in baseband_gcc_versions:
print(itbb)