update main to do a repeated sweep
This commit is contained in:
parent
0496b6e103
commit
77188a3eaa
1 changed files with 10 additions and 9 deletions
|
|
@ -125,7 +125,7 @@ fn main() -> ! {
|
|||
// let b1 = Input::new(p.PA2, Pull::Up);
|
||||
|
||||
// p.EXTI4
|
||||
let ei = hal::exti::ExtiInput::new(p.PD4, p.EXTI4, Pull::Up);
|
||||
// let ei = hal::exti::ExtiInput::new(p.PD4, p.EXTI4, Pull::Up);
|
||||
|
||||
// let led_pin = PwmPin::new_ch4::<0>(p.PD0);
|
||||
// let ch = hal::timer::Channel::Ch4;
|
||||
|
|
@ -195,17 +195,18 @@ fn main() -> ! {
|
|||
let mut tick: usize = 0;
|
||||
loop{
|
||||
// handle IRQ flags
|
||||
unsafe {
|
||||
if(IRQ1_FLAG) {
|
||||
led1_need_service = true;
|
||||
// led_active = true;
|
||||
IRQ1_FLAG = false;
|
||||
}
|
||||
}
|
||||
// unsafe {
|
||||
// if(IRQ1_FLAG) {
|
||||
// led1_need_service = true;
|
||||
// // led_active = true;
|
||||
// IRQ1_FLAG = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
let dac_need_service = ((tick % dac_tick_per_service) == 0);
|
||||
if(dac_need_service && dac_active) {
|
||||
dac_active = dac.output_next();
|
||||
// dac_active = dac.output_next();
|
||||
dac.output_next();
|
||||
}
|
||||
|
||||
let led_need_service = ((tick % led_tick_per_service) == 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue