Embedded programming interrupts a problem

Source: Internet
Author: User

Interrupts is 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 routine (ISR), point out

The errors in the code.

double Compute_area (double  radius) {    double area = PI * radius * radius;    printf ("\narea =%f", area);     return 0 ;}

Analysis

1) ISR cannot return a value
2) ISR cannot pass parameters
3) In many processors or compilers, floating point is generally non-reentrant, in addition, the ISR should be short and efficient, it is unwise to do floating point in the ISR
4) printf () often has re-entry and performance problems, so it is generally not used with printf ()

Embedded programming interrupts a problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.