From 3f3fe3bb6780c055f943a85b317f0623657dbcaf Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 17 Jul 2016 15:56:24 -0700 Subject: [PATCH] JTAG: Report if HackRF CPLD bitstream matches released version. TODO: Could be better reporting (CRC?), and could not pause while checking CPLD EEPROM, and could offer a means to program the bitstream if it doesn't match... --- firmware/application/ui_setup.cpp | 9 +++++++++ firmware/application/ui_setup.hpp | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/firmware/application/ui_setup.cpp b/firmware/application/ui_setup.cpp index da6624043..5a10b20e4 100644 --- a/firmware/application/ui_setup.cpp +++ b/firmware/application/ui_setup.cpp @@ -28,6 +28,8 @@ using namespace lpc43xx; #include "portapack.hpp" using portapack::receiver_model; +#include "cpld_update.hpp" + namespace ui { SetDateTimeView::SetDateTimeView( @@ -172,10 +174,17 @@ AboutView::AboutView(NavigationView& nav) { &text_title, &text_firmware, &text_cpld_hackrf, + &text_cpld_hackrf_status, &button_ok, } }); button_ok.on_select = [&nav](Button&){ nav.pop(); }; + + if( cpld_hackrf_verify_eeprom() ) { + text_cpld_hackrf_status.set(" OK"); + } else { + text_cpld_hackrf_status.set("BAD"); + } } void AboutView::focus() { diff --git a/firmware/application/ui_setup.hpp b/firmware/application/ui_setup.hpp index 016d11ab1..d65592c4e 100644 --- a/firmware/application/ui_setup.hpp +++ b/firmware/application/ui_setup.hpp @@ -235,8 +235,13 @@ private: }; Text text_cpld_hackrf { - { 0, 144, 240, 16 }, - "HackRF CPLD CRC 0x????????", + { 0, 144, 11*8, 16 }, + "HackRF CPLD", + }; + + Text text_cpld_hackrf_status { + { 240 - 3*8, 144, 3*8, 16 }, + "???" }; Button button_ok {