Skip to content

Commit

Permalink
fpu enable
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Apr 12, 2018
1 parent ffbf0c7 commit 938d474
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ void __initialize_hardware_early() {
early();
}

void __attribute__ ((noinline)) enable_fpu() {
// enable the FPU
SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));
}

int main() {
// shouldn't have interrupts here, but just in case
__disable_irq();
Expand All @@ -508,6 +513,11 @@ int main() {
puts(is_entering_bootmode ? " ESP wants bootmode\n" : " no bootmode\n");
gpio_init();

#ifdef PANDA
// panda has an FPU, let's use it!
enable_fpu();
#endif

// enable main uart if it's connected
if (has_external_debug_serial) {
// WEIRDNESS: without this gate around the UART, it would "crash", but only if the ESP is enabled
Expand Down

0 comments on commit 938d474

Please sign in to comment.