From 77291b4e3118fbda59464d95a865f074b5e0cc03 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 18 Jul 2016 11:32:14 -0700 Subject: [PATCH] On PortaPack shutdown, init HackRF CPLD to EEPROM bitstream. --- firmware/application/cpld_update.cpp | 7 +++++++ firmware/application/cpld_update.hpp | 1 + firmware/application/portapack.cpp | 3 +++ 3 files changed, 11 insertions(+) diff --git a/firmware/application/cpld_update.cpp b/firmware/application/cpld_update.cpp index 64134e83..cafa81cb 100644 --- a/firmware/application/cpld_update.cpp +++ b/firmware/application/cpld_update.cpp @@ -113,3 +113,10 @@ bool cpld_hackrf_verify_eeprom() { return ok; } + +void cpld_hackrf_init_from_eeprom() { + auto jtag_target_hackrf_cpld = jtag_target_hackrf(); + cpld::xilinx::XC2C64A hackrf_cpld { jtag_target_hackrf_cpld }; + + hackrf_cpld.init_from_eeprom(); +} diff --git a/firmware/application/cpld_update.hpp b/firmware/application/cpld_update.hpp index bd317e10..17c42bd5 100644 --- a/firmware/application/cpld_update.hpp +++ b/firmware/application/cpld_update.hpp @@ -26,5 +26,6 @@ bool cpld_update_if_necessary(); bool cpld_hackrf_load_sram(); bool cpld_hackrf_verify_eeprom(); +void cpld_hackrf_init_from_eeprom(); #endif/*__CPLD_UPDATE_H__*/ diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 344f0aa8..16986c17 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -166,6 +166,9 @@ void shutdown() { radio::disable(); audio::shutdown(); + + cpld_hackrf_init_from_eeprom(); + clock_manager.shutdown(); power.shutdown();