Unbreak ADC interrupt.

This commit is contained in:
whitequark 2017-05-06 16:00:01 +00:00
parent 15c9bafb51
commit d6bfba821e
2 changed files with 4 additions and 1 deletions

2
firmware/Cargo.lock generated
View File

@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "tm4c129x" name = "tm4c129x"
version = "0.4.0" version = "0.4.0"
source = "git+https://github.com/m-labs/dslite2svd#7539765c94fa1643fab8a316e1eeef03d243b8fa" source = "git+https://github.com/m-labs/dslite2svd#f1b9a75e478c2186bf963ae1f868109fd14def29"
dependencies = [ dependencies = [
"cortex-m 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "cortex-m 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"vcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "vcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -121,6 +121,7 @@ fn error_reset() {
fn main() { fn main() {
cortex_m::interrupt::enable();
cortex_m::interrupt::free(|cs| { cortex_m::interrupt::free(|cs| {
let sysctl = tm4c129x::SYSCTL.borrow(cs); let sysctl = tm4c129x::SYSCTL.borrow(cs);
let nvic = tm4c129x::NVIC.borrow(cs); let nvic = tm4c129x::NVIC.borrow(cs);
@ -254,6 +255,7 @@ fn main() {
timer0.cfg.write(|w| w.cfg()._32_bit_timer()); timer0.cfg.write(|w| w.cfg()._32_bit_timer());
timer0.tamr.write(|w| w.tamr().period()); timer0.tamr.write(|w| w.tamr().period());
timer0.tailr.write(|w| unsafe { w.bits(ADC_TIMER_LOAD) }); timer0.tailr.write(|w| unsafe { w.bits(ADC_TIMER_LOAD) });
timer0.ctl.write(|w| w.taote().bit(true));
timer0.adcev.write(|w| w.tatoadcen().bit(true)); timer0.adcev.write(|w| w.tatoadcen().bit(true));
timer0.cc.write(|w| w.altclk().bit(true)); timer0.cc.write(|w| w.altclk().bit(true));
timer0.ctl.write(|w| w.taen().bit(true)); timer0.ctl.write(|w| w.taen().bit(true));
@ -311,6 +313,7 @@ extern fn adc0_ss0(_ctxt: ADC0SS0) {
if adc0.ostat.read().ov0().bit() { if adc0.ostat.read().ov0().bit() {
panic!("ADC FIFO overflowed") panic!("ADC FIFO overflowed")
} }
adc0.isc.write(|w| w.in0().bit(true));
let _ic_sample = adc0.ssfifo0.read().data().bits(); let _ic_sample = adc0.ssfifo0.read().data().bits();
let _fbi_sample = adc0.ssfifo0.read().data().bits(); let _fbi_sample = adc0.ssfifo0.read().data().bits();