我用的是TI 测试FPU的例程 fpu_simple_floating_point_operation,有时候可以正常进中断,有时候就会跳到FaultISR()这个中断里,请问是怎么回事?
/* DriverLib Includes */
#include "driverlib.h"
/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
/* Statics */
static volatile bool flipFlop;
int main(void)
{
volatile float fCalculate;
uint32_t ii;
flipFlop = false;
MAP_WDT_A_holdTimer();
/* Configuring P1.1 as an input and enabling interrupts */
MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);
MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);
MAP_Interrupt_enableInterrupt(INT_PORT1);
MAP_Interrupt_enableMaster();
while(1)
{
for(ii=0;ii<20;ii++)
{
fCalculate = (sin(50.5) * (12.2f / 50.1f) * 10.22f / 3) * ii;
}
}
}
/* GPIO ISR */
void gpio_isr(void)
{
uint32_t status;
status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);
/* Toggling the output on the LED */
if(status & GPIO_PIN1)
{
if(flipFlop)
{
MAP_FPU_disableModule();
flipFlop = false;
}
else
{
MAP_FPU_enableModule();
flipFlop = true;
}
}
}
//*****************************************************************************
//
// This is the code that gets called when the processor receives a fault
// interrupt. This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//
//*****************************************************************************
static void FaultISR(void)
{
//
// Enter an infinite loop.
//
while(1)
{
}
}