cleanup on boot1

main thing in this commit is remembering to activate PWM
mode on DCDC2 for a quieter power supply. the chip draws
so little power that the power-saving regulator hiccups
and has too much ripple.
This commit is contained in:
bunnie 2025-10-01 23:33:35 +08:00
parent faa13e71f3
commit 73192dc2d8
3 changed files with 3 additions and 11 deletions

View file

@ -54,13 +54,3 @@ pub extern "C" fn abort() -> ! {
);
}
}
#[link_section = ".text.init"]
#[no_mangle]
pub unsafe extern "C" fn jump_to(target: usize) -> ! {
core::arch::asm!(
"jr {0}",
in(reg) target,
options(noreturn)
);
}

View file

@ -119,6 +119,9 @@ pub fn early_init(mut board_type: bao1x_api::BoardTypeCoding) -> (bao1x_api::Boa
// serves as a "debounce" of accidental butt-dials of the
// power button.
pmic.set_ldo(&mut i2c, Some(3.3), bao1x_hal::axp2101::WhichLdo::Bldo1).unwrap();
// set PWM mode on DCDC2. greatly reduces noise on the regulator line
pmic.set_pwm_mode(&mut i2c, bao1x_hal::axp2101::WhichDcDc::Dcdc2, true).unwrap();
// make sure the DCDC2 is set to 0.9V, which will allow us to enter high-speed run
// mode. It defaults to 0.85V on boot.
pmic.set_dcdc(&mut i2c, Some((0.9, true)), bao1x_hal::axp2101::WhichDcDc::Dcdc2)

View file

@ -1,5 +1,4 @@
#![allow(dead_code)]
use bao1x_hal::sh1107::Mono;
use ux_api::minigfx::*;
// The discipline for all the APIs in this module are that they act on a FrameBuffer which is