Interrupts are an important part of embedded
systems. Consequently, many compiler vendors
offer an extension to standard C to support interrupts.
Typically, the keyword is __interrupt. The following
code uses __interrupt to define an interrupt service
routine (ISR). Point out problems in the code. __interrupt double compute_area (double radius)
{
double area = PI * radius * radius;
printf("\nArea = %f", area);
return area;
}
systems. Consequently, many compiler vendors
offer an extension to standard C to support interrupts.
Typically, the keyword is __interrupt. The following
code uses __interrupt to define an interrupt service
routine (ISR). Point out problems in the code. __interrupt double compute_area (double radius)
{
double area = PI * radius * radius;
printf("\nArea = %f", area);
return area;
}
是个什么类型,没见过,管他呢。去掉就对了。要不看看MSDN需要包括什么头文件。
如果不需要包括头文件。那就是错误。然后这PI定义了没有。别的没有问题了
在声明中加上__fortran, __pascal, 或者 __fastcall 关键字。
中断中不能调用printf,因为printf也会引起中断。