From b508129c37f9eb1d40974c0571b89a418314e001 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 24 Sep 2019 01:45:51 +0200 Subject: [PATCH] tec: make more brief --- firmware/src/tec.rs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/firmware/src/tec.rs b/firmware/src/tec.rs index 12b4b36..95219e7 100644 --- a/firmware/src/tec.rs +++ b/firmware/src/tec.rs @@ -44,27 +44,17 @@ pub struct Tec { pub fn tec0() -> Self { - let (t2ccp0, t2ccp1) = tm4c129x::TIMER2::split(); - let (t3ccp0, t3ccp1) = tm4c129x::TIMER3::split(); - Tec { - max_i_pos: t2ccp0, - max_i_neg: t2ccp1, - i_set: t3ccp0, - max_v: t3ccp1, - } + let (max_i_pos, max_i_neg) = tm4c129x::TIMER2::split(); + let (i_set, max_v) = tm4c129x::TIMER3::split(); + Tec { max_i_pos, max_i_neg, i_set, max_v } } } impl Tec { pub fn tec1() -> Self { - let (t4ccp0, t4ccp1) = tm4c129x::TIMER4::split(); - let (t5ccp0, t5ccp1) = tm4c129x::TIMER5::split(); - Tec { - max_i_pos: t4ccp0, - max_i_neg: t4ccp1, - i_set: t5ccp0, - max_v: t5ccp1, - } + let (max_i_pos, max_i_neg) = tm4c129x::TIMER4::split(); + let (i_set, max_v) = tm4c129x::TIMER5::split(); + Tec { max_i_pos, max_i_neg, i_set, max_v } } }