Mini2440 interrupt lab

Source: Internet
Author: User

The most serious mistake is how to judge whether a certain person is 1: use instead of use &&. I have been calling it for a long time. Ah ..

For more information, seeCode: Int.tar.gz


// Interrupt. c
# Include "S3C2440. H"

Void eint_handle ()
{// Interrupt handler.
Unsigned long offset = effecffset;
Unsigned long eintpnd;

If (5 = offset) {// eint8 ~ 23
// It must use eintpnd to invoke y which interrupt it is. Because GPG mode is int not input
Gpbdat | = (0x3 <6); // led2 3 off

eintpnd = eintpend;
If (eintpnd & (1 <8 )) {// key1 Press (when an external interrupt occurs, that is, the eintpnd is not 0. If & is used, this condition is always true)
gpbdat & = ~ (1 <6);
}< br> If (eintpnd & (1 <11 )) {// key2 press
gpbdat & = ~ (1 <7);
}< BR >}

// clear the interrupt.
If (5 = offset)
eintpend = (1 <8) | (1 <11);
srcpnd = 1 intpnd = 1 }< br>

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.