mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-21 06:05:18 -04:00
Config mode (#1433)
* Allow code to run without a token * Reverted submodule change by mistake * WIP force tcxo * Added check to hide if not an R9 * Fixed comments * Updated name * Fixed crashing on TCXO switching * Fixed the reboot issue * Updated boot order * Cleaned up comments * added new recovery mode * added IO * implemented cpld mode change * whitespace change * renamed config mode * inverted logic * removed r9 dependency * added disable external tcxo option to config mode * fixed CLKIN detection for r9 * integrated tcxo setting into clock selection Co-authored-by @jLynx
This commit is contained in:
parent
4819a2f4e2
commit
62310ad9a9
10 changed files with 236 additions and 8 deletions
|
@ -325,12 +325,18 @@ uint32_t ClockManager::measure_gp_clkin_frequency() {
|
|||
}
|
||||
|
||||
bool ClockManager::loss_of_signal() {
|
||||
return hackrf_r9
|
||||
? clock_generator.plla_loss_of_signal()
|
||||
: clock_generator.clkin_loss_of_signal();
|
||||
if (hackrf_r9) {
|
||||
const auto frequency = measure_gp_clkin_frequency();
|
||||
return (frequency < 9850000) || (frequency > 10150000);
|
||||
} else {
|
||||
return clock_generator.clkin_loss_of_signal();
|
||||
}
|
||||
}
|
||||
|
||||
ClockManager::ReferenceSource ClockManager::detect_reference_source() {
|
||||
if (portapack::persistent_memory::config_disable_external_tcxo())
|
||||
return ReferenceSource::Xtal;
|
||||
|
||||
if (loss_of_signal()) {
|
||||
// No external reference. Turn on PortaPack reference (if present).
|
||||
portapack_tcxo_enable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue