mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-06-04 15:28:21 +00:00
Sound/white noise Clock fix (#625)
This commit is contained in:
parent
8957d692ea
commit
fe33c12111
@ -403,6 +403,7 @@ bool init() {
|
|||||||
// if( !hackrf::cpld::load_sram() ) {
|
// if( !hackrf::cpld::load_sram() ) {
|
||||||
// chSysHalt();
|
// chSysHalt();
|
||||||
// }
|
// }
|
||||||
|
chThdSleepMilliseconds(100);
|
||||||
|
|
||||||
configure_pins_portapack();
|
configure_pins_portapack();
|
||||||
|
|
||||||
@ -412,6 +413,8 @@ bool init() {
|
|||||||
|
|
||||||
i2c0.stop();
|
i2c0.stop();
|
||||||
|
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
|
|
||||||
set_clock_config(clock_config_irc);
|
set_clock_config(clock_config_irc);
|
||||||
cgu::pll1::disable();
|
cgu::pll1::disable();
|
||||||
|
|
||||||
@ -452,9 +455,11 @@ bool init() {
|
|||||||
cgu::pll1::direct();
|
cgu::pll1::direct();
|
||||||
|
|
||||||
i2c0.start(i2c_config_fast_clock);
|
i2c0.start(i2c_config_fast_clock);
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
|
|
||||||
touch::adc::init();
|
touch::adc::init();
|
||||||
controls_init();
|
controls_init();
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
|
|
||||||
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
||||||
clock_manager.enable_first_if_clock();
|
clock_manager.enable_first_if_clock();
|
||||||
@ -465,10 +470,10 @@ bool init() {
|
|||||||
sdcStart(&SDCD1, nullptr);
|
sdcStart(&SDCD1, nullptr);
|
||||||
sd_card::poll_inserted();
|
sd_card::poll_inserted();
|
||||||
|
|
||||||
chThdSleepMilliseconds(1);
|
chThdSleepMilliseconds(10);
|
||||||
|
|
||||||
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
|
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 using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once.
|
||||||
if (load_config() != 3){
|
if (load_config() != 3){
|
||||||
shutdown_base();
|
shutdown_base();
|
||||||
@ -480,11 +485,13 @@ bool init() {
|
|||||||
chSysHalt();
|
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;
|
LPC_CREG->DMAMUX = portapack::gpdma_mux;
|
||||||
gpdma::controller.enable();
|
gpdma::controller.enable();
|
||||||
|
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
|
|
||||||
audio::init(portapack_audio_codec());
|
audio::init(portapack_audio_codec());
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user