Nimi2440 bare metal LED program problems-general Linux technology-Linux technology and application information, the following is a detailed description. I am a beginner. This is the code I wrote. There is no syntax error, but it is a logic error and cannot implement the desired result. Please advise !!
# Define GPBCON (* (volatile unsigned long *) 0x56000010)
# Define GPBDAT (* (volatile unsigned long *) 0x56000014)
Void delay (unsigned long MS)
{
For (; ms> 0; ms --);
}
Int main (void)
{
/* Set the led gpcon as the output */
GPBCON & = ~ (LED1_BCL | LED2_BCL | LED3_BCL | LED4_BCL );
GPBCON | = (led0000out | LED2_OUT | LED3_OUT | LED4_OUT );
/* Light LED1, delay for a period of time, and then extinguish LED1 */
GPBDAT = ledbench on & BEEP_OFF; // By the way, the sound of the buzzer is disabled, indicating that BEEP 1 is on and 0 is off.
Delay (1000 );
GPBDAT | = led0000off;
/*
GPBDAT = LED2_ON & BEEP_OFF;
Delay (10 );
GPBDAT | = LED2_OFF;
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.