diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-12-31 13:55:56 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-12-31 14:06:20 +0100 |
commit | 8419b87c6bd7be468239d0f68155631dfb5db103 (patch) | |
tree | e7159ec683e8b0a391f06b59a4b9a1770234b97f /startup | |
parent | deab534c051210678014966f60acf904ba36f81d (diff) |
Fixed FPU support.
Selecting proper FPU flags in build_rules and enabling FPU during startup.
Diffstat (limited to 'startup')
-rw-r--r-- | startup/entry.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/startup/entry.cpp b/startup/entry.cpp index d7385f8..64aac37 100644 --- a/startup/entry.cpp +++ b/startup/entry.cpp @@ -1,5 +1,6 @@ #include <stdint.h> #include <rcc/rcc.h> +#include <cortex_m/fpu.h> int main(); @@ -35,6 +36,11 @@ void __attribute__((naked)) entry() { *wp++ = 0; } + // Enable FPU before calling any functions that can invoke FPU instructions. + #ifdef HAS_FPU + COPROC.CPAC |= (3 << 22) | (3 << 20); + #endif + // Call constructors. funcp_t* fp = &_init_array_start; |