tec: setup iset_width

master
Astro 3 years ago
parent ecdebe76bc
commit 02d2403547
  1. 4
      firmware/src/main.rs
  2. 3
      firmware/src/tec.rs

@ -128,8 +128,8 @@ fn main() -> ! {
writeln!(stdout, "tecpak boot").unwrap();
board::init();
writeln!(stdout, "board initialized").unwrap();
let mut tec0 = Tec::tec0().setup(PWM_PID_WIDTH);
let mut tec1 = Tec::tec1().setup(PWM_PID_WIDTH);
let mut tec0 = Tec::tec0().setup(PWM_PID_WIDTH / 2, PWM_PID_WIDTH);
let mut tec1 = Tec::tec1().setup(PWM_PID_WIDTH / 2, PWM_PID_WIDTH);
println!(r#"
_ _

@ -76,10 +76,11 @@ impl Tec<pwm::T4CCP0, pwm::T4CCP1, pwm::T5CCP0, pwm::T5CCP1, GpioOutput<PP5>> {
impl<MaxIPos: PwmChannel, MaxINeg: PwmChannel, ISet: PwmChannel, MaxV: PwmChannel, SHDN: OutputPin> Tec<MaxIPos, MaxINeg, ISet, MaxV, SHDN> {
pub fn setup(mut self, max: u16) -> Self {
pub fn setup(mut self, iset_width: u16, max: u16) -> Self {
self.max_i_pos.set(max, max);
self.max_i_neg.set(max, max);
self.max_v.set(max, max);
self.i_set.set(iset_width, max);
self
}

Loading…
Cancel
Save