Enable FPU.

This commit is contained in:
whitequark 2017-05-07 17:32:53 +00:00
parent 3b7eb8bd9a
commit ba37d13dae
3 changed files with 8 additions and 4 deletions

6
firmware/Cargo.lock generated
View File

@ -10,7 +10,7 @@ dependencies = [
[[package]] [[package]]
name = "cortex-m" name = "cortex-m"
version = "0.2.4" version = "0.2.4"
source = "git+https://github.com/whitequark/cortex-m?rev=impl-syst#a9967c544da4ddc7575135ed522dffd21ec28c19" source = "git+https://github.com/whitequark/cortex-m?rev=fpu-cpacr#0e3dd2df58e52f9af80e47327a62a83511e010f9"
dependencies = [ dependencies = [
"cortex-m-semihosting 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cortex-m-semihosting 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -20,7 +20,7 @@ dependencies = [
name = "cortex-m" name = "cortex-m"
version = "0.2.4" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
replace = "cortex-m 0.2.4 (git+https://github.com/whitequark/cortex-m?rev=impl-syst)" replace = "cortex-m 0.2.4 (git+https://github.com/whitequark/cortex-m?rev=fpu-cpacr)"
[[package]] [[package]]
name = "cortex-m-rt" name = "cortex-m-rt"
@ -63,7 +63,7 @@ dependencies = [
] ]
[metadata] [metadata]
"checksum cortex-m 0.2.4 (git+https://github.com/whitequark/cortex-m?rev=impl-syst)" = "<none>" "checksum cortex-m 0.2.4 (git+https://github.com/whitequark/cortex-m?rev=fpu-cpacr)" = "<none>"
"checksum cortex-m 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "964f183322128497a636a5d4524dfe91fa1394a15b7b2c4329ee5bb66bef1548" "checksum cortex-m 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "964f183322128497a636a5d4524dfe91fa1394a15b7b2c4329ee5bb66bef1548"
"checksum cortex-m-rt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2ed494cbd15190fae60f608e6b4690e753df47b5f5e25e95d3c298f801f5c1d0" "checksum cortex-m-rt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2ed494cbd15190fae60f608e6b4690e753df47b5f5e25e95d3c298f801f5c1d0"
"checksum cortex-m-semihosting 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54a88e8fd577808637f819107f34eece1b6b45be8db1c56d1c563095b80b655e" "checksum cortex-m-semihosting 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54a88e8fd577808637f819107f34eece1b6b45be8db1c56d1c563095b80b655e"

View File

@ -13,4 +13,4 @@ lto = true
debug = true debug = true
[replace] [replace]
"cortex-m:0.2.4" = { git = "https://github.com/whitequark/cortex-m", rev = "impl-syst" } "cortex-m:0.2.4" = { git = "https://github.com/whitequark/cortex-m", rev = "fpu-cpacr" }

View File

@ -126,6 +126,10 @@ fn main() {
let sysctl = tm4c129x::SYSCTL.borrow(cs); let sysctl = tm4c129x::SYSCTL.borrow(cs);
let nvic = tm4c129x::NVIC.borrow(cs); let nvic = tm4c129x::NVIC.borrow(cs);
// Enable FPU
let scb = tm4c129x::SCB.borrow(cs);
scb.enable_fpu();
// Set up main oscillator // Set up main oscillator
sysctl.moscctl.write(|w| w.noxtal().bit(false)); sysctl.moscctl.write(|w| w.noxtal().bit(false));
sysctl.moscctl.modify(|_, w| w.pwrdn().bit(false).oscrng().bit(true)); sysctl.moscctl.modify(|_, w| w.pwrdn().bit(false).oscrng().bit(true));