the code is one of the example from TI,named fpu_simple_floating_point_operation. When I press the button to trigger the interrupt for P1.1 ,the program sometimes jumped into the FaultISR(),but sometimes is normal.who can tell me why??
PS: do you think my English is very bad?
/* 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;
}
}
}