mirror of https://github.com/ARMmbed/mbed-os.git
Support LPC1114 platform
Added TARGET_LPC1114 pins for InterruptIn test case and changed to PullUp mode.pull/40/head
parent
10e30b5cfb
commit
463bf47a40
|
|
@ -13,6 +13,21 @@ InterruptIn button8(p10);
|
||||||
InterruptIn button9(p9);
|
InterruptIn button9(p9);
|
||||||
DigitalOut led(LED1);
|
DigitalOut led(LED1);
|
||||||
DigitalOut flash(LED4);
|
DigitalOut flash(LED4);
|
||||||
|
|
||||||
|
#elif defined(TARGET_LPC1114)
|
||||||
|
InterruptIn button(p30); // SW2 (User switch)
|
||||||
|
InterruptIn button1(p5);
|
||||||
|
InterruptIn button2(p6);
|
||||||
|
InterruptIn button3(p7);
|
||||||
|
InterruptIn button4(p9);
|
||||||
|
InterruptIn button5(p10);
|
||||||
|
InterruptIn button6(p12);
|
||||||
|
InterruptIn button7(p13);
|
||||||
|
InterruptIn button8(p14);
|
||||||
|
InterruptIn button9(p15);
|
||||||
|
DigitalOut led(LED1);
|
||||||
|
DigitalOut flash(LED2);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
InterruptIn button(p30);
|
InterruptIn button(p30);
|
||||||
InterruptIn button1(p29);
|
InterruptIn button1(p29);
|
||||||
|
|
@ -33,6 +48,11 @@ void flip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
flash = 0;
|
||||||
|
led = 0;
|
||||||
|
#if defined(TARGET_LPC1114)
|
||||||
|
button.mode(PullUp);
|
||||||
|
#endif
|
||||||
button.rise(&flip); // attach the address of the flip function to the rising edge
|
button.rise(&flip); // attach the address of the flip function to the rising edge
|
||||||
button1.rise(&flip);
|
button1.rise(&flip);
|
||||||
button2.rise(&flip);
|
button2.rise(&flip);
|
||||||
|
|
@ -43,6 +63,7 @@ int main() {
|
||||||
button7.rise(&flip);
|
button7.rise(&flip);
|
||||||
button8.rise(&flip);
|
button8.rise(&flip);
|
||||||
button9.rise(&flip);
|
button9.rise(&flip);
|
||||||
|
|
||||||
while(1) { // wait around, interrupts will interrupt this!
|
while(1) { // wait around, interrupts will interrupt this!
|
||||||
flash = !flash;
|
flash = !flash;
|
||||||
wait(0.25);
|
wait(0.25);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue