I am trying to write a code for this emulated pacemaker device, but i couldn't i need some help. the requirement in the attached pic
if (SW1==0x10){
if(GPIO_PORTF_DATA_R &= ~0x08){
Delay1ms(250); //
GPIO_PORTF_DATA_R |= 0x02; // LED is on
Delay1ms(250); //
GPIO_PORTF_DATA_R &= ~0x02; // LED is off
GPIO_PORTF_DATA_R |= 0x08; // LED green is on
}
}else{
GPIO_PORTF_DATA_R &= ~0x08; // LED green is on
Delay1ms(10); //
}
if (SW1==0x10){
if(GPIO_PORTF_DATA_R &= ~0x08){
Delay1ms(250); //
GPIO_PORTF_DATA_R |= 0x02; // LED is on
Delay1ms(250); //
GPIO_PORTF_DATA_R &= ~0x02; // LED is off
GPIO_PORTF_DATA_R |= 0x08; // LED green is on
}
}else{
GPIO_PORTF_DATA_R &= ~0x08; // LED green is on
Delay1ms(10); //
}
Attachments
-
88.4 KB Views: 3
