mirror of https://github.com/commaai/panda.git
fpu enable
This commit is contained in:
parent
ffbf0c789a
commit
938d474723
10
board/main.c
10
board/main.c
|
@ -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();
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue