main: put AFEs into a tuple
This commit is contained in:
parent
911fb66146
commit
7189830896
16
src/main.rs
16
src/main.rs
|
@ -185,8 +185,7 @@ macro_rules! route_request {
|
||||||
#[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
|
#[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
|
||||||
const APP: () = {
|
const APP: () = {
|
||||||
struct Resources {
|
struct Resources {
|
||||||
afe0: AFE0,
|
afes: (AFE0, AFE1),
|
||||||
afe1: AFE1,
|
|
||||||
|
|
||||||
adcs: (Adc0Input, Adc1Input),
|
adcs: (Adc0Input, Adc1Input),
|
||||||
dacs: (Dac0Output, Dac1Output),
|
dacs: (Dac0Output, Dac1Output),
|
||||||
|
@ -729,8 +728,7 @@ const APP: () = {
|
||||||
sampling_timer.start();
|
sampling_timer.start();
|
||||||
|
|
||||||
init::LateResources {
|
init::LateResources {
|
||||||
afe0: afe0,
|
afes: (afe0, afe1),
|
||||||
afe1: afe1,
|
|
||||||
|
|
||||||
adcs,
|
adcs,
|
||||||
dacs,
|
dacs,
|
||||||
|
@ -768,7 +766,7 @@ const APP: () = {
|
||||||
c.resources.dacs.1.commit_buffer();
|
c.resources.dacs.1.commit_buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[idle(resources=[net_interface, pounder, mac_addr, eth_mac, iir_state, iir_ch, afe0, afe1])]
|
#[idle(resources=[net_interface, pounder, mac_addr, eth_mac, iir_state, iir_ch, afes])]
|
||||||
fn idle(mut c: idle::Context) -> ! {
|
fn idle(mut c: idle::Context) -> ! {
|
||||||
let mut socket_set_entries: [_; 8] = Default::default();
|
let mut socket_set_entries: [_; 8] = Default::default();
|
||||||
let mut sockets =
|
let mut sockets =
|
||||||
|
@ -828,8 +826,8 @@ const APP: () = {
|
||||||
|
|
||||||
Ok::<server::Status, ()>(state)
|
Ok::<server::Status, ()>(state)
|
||||||
}),
|
}),
|
||||||
"stabilizer/afe0/gain": (|| c.resources.afe0.get_gain()),
|
"stabilizer/afe0/gain": (|| c.resources.afes.0.get_gain()),
|
||||||
"stabilizer/afe1/gain": (|| c.resources.afe1.get_gain()),
|
"stabilizer/afe1/gain": (|| c.resources.afes.1.get_gain()),
|
||||||
"pounder/in0": (|| {
|
"pounder/in0": (|| {
|
||||||
match c.resources.pounder {
|
match c.resources.pounder {
|
||||||
Some(pounder) =>
|
Some(pounder) =>
|
||||||
|
@ -924,10 +922,10 @@ const APP: () = {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
"stabilizer/afe0/gain": afe::Gain, (|gain| {
|
"stabilizer/afe0/gain": afe::Gain, (|gain| {
|
||||||
Ok::<(), ()>(c.resources.afe0.set_gain(gain))
|
Ok::<(), ()>(c.resources.afes.0.set_gain(gain))
|
||||||
}),
|
}),
|
||||||
"stabilizer/afe1/gain": afe::Gain, (|gain| {
|
"stabilizer/afe1/gain": afe::Gain, (|gain| {
|
||||||
Ok::<(), ()>(c.resources.afe1.set_gain(gain))
|
Ok::<(), ()>(c.resources.afes.1.set_gain(gain))
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue