From fe33c12111221a1ad111c1eaaadce4fd7eda6b89 Mon Sep 17 00:00:00 2001 From: jLynx Date: Thu, 5 May 2022 08:31:54 +1200 Subject: [PATCH] Sound/white noise Clock fix (#625) --- firmware/application/portapack.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index 0157cd4f..5d51f175 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -403,6 +403,7 @@ bool init() { // if( !hackrf::cpld::load_sram() ) { // chSysHalt(); // } + chThdSleepMilliseconds(100); configure_pins_portapack(); @@ -412,6 +413,8 @@ bool init() { i2c0.stop(); + chThdSleepMilliseconds(10); + set_clock_config(clock_config_irc); cgu::pll1::disable(); @@ -452,9 +455,11 @@ bool init() { cgu::pll1::direct(); i2c0.start(i2c_config_fast_clock); + chThdSleepMilliseconds(10); touch::adc::init(); controls_init(); + chThdSleepMilliseconds(10); clock_manager.set_reference_ppb(persistent_memory::correction_ppb()); clock_manager.enable_first_if_clock(); @@ -465,10 +470,10 @@ bool init() { sdcStart(&SDCD1, nullptr); sd_card::poll_inserted(); - chThdSleepMilliseconds(1); + chThdSleepMilliseconds(10); if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) { - chThdSleepMilliseconds(1); + chThdSleepMilliseconds(10); // If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once. if (load_config() != 3){ shutdown_base(); @@ -480,11 +485,13 @@ bool init() { chSysHalt(); } - chThdSleepMilliseconds(1); // This delay seems to solve white noise audio issues + chThdSleepMilliseconds(10); // This delay seems to solve white noise audio issues LPC_CREG->DMAMUX = portapack::gpdma_mux; gpdma::controller.enable(); + chThdSleepMilliseconds(10); + audio::init(portapack_audio_codec());