diff options
| author | nucho <javatea@it.willcomlive.jp> | 2012-05-13 16:48:20 +0900 |
|---|---|---|
| committer | nucho <javatea@it.willcomlive.jp> | 2012-05-13 18:07:13 +0900 |
| commit | 9ffce8d3c2674156dd1fcbce928c2b7cae30ff39 (patch) | |
| tree | 1a02e7662954beb8bf5b3035123ad7abb886f7c5 /src | |
| parent | 950ebb87e4ddc93d90ff01cb4b7edae3b395bef4 (diff) | |
some bugs are fixed
Diffstat (limited to 'src')
| -rwxr-xr-x | src/core/gpio.cpp | 22 | ||||
| -rwxr-xr-x | src/core/gpio_int.cpp | 12 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/core/gpio.cpp b/src/core/gpio.cpp index 3b25da9..d696537 100755 --- a/src/core/gpio.cpp +++ b/src/core/gpio.cpp @@ -190,7 +190,7 @@ int digitalRead(int pin) ** *****************************************************************************/ void GPIOSetInterrupt(int pin, int sense, int single, int event) { - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~21) { if (sense == 0) { LPC_GPIO[arduino_pinAssign[pin * 2]]->IS &= ~((1 << arduino_pinAssign[pin * 2 + 1])); @@ -209,8 +209,8 @@ void GPIOSetInterrupt(int pin, int sense, int single, int event) { &= ~((1 << arduino_pinAssign[pin * 2 + 1])); else LPC_GPIO[arduino_pinAssign[pin * 2]]->IEV |= ((1 << arduino_pinAssign[pin * 2 + 1])); - } else if (pin >= 20 && pin < 100) { - //(20~99:reserved) + } else if (pin >= 22 && pin < 100) { + //(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; @@ -234,11 +234,11 @@ void GPIOSetInterrupt(int pin, int sense, int single, int event) { } void GPIOIntEnable(int pin) { - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~21) { LPC_GPIO[arduino_pinAssign[pin * 2]]->IE |= (1 << arduino_pinAssign[pin * 2 + 1]); - } else if (pin >= 20 && pin < 100) { //(20~99:reserved) + } else if (pin >= 22 && pin < 100) { //(20~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; @@ -249,11 +249,11 @@ void GPIOIntEnable(int pin) { } void GPIOIntDisable(int pin) { - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~21) { LPC_GPIO[arduino_pinAssign[pin * 2]]->IE &= ~((1 << arduino_pinAssign[pin * 2 + 1])); - } else if (pin >= 20 && pin < 100) {//(20~99:reserved) + } else if (pin >= 22 && pin < 100) {//(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; @@ -266,13 +266,13 @@ void GPIOIntDisable(int pin) { int GPIOIntStatus(int pin) { int regVal = 0; - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~21) { if (LPC_GPIO[arduino_pinAssign[pin * 2]]->MIS & (1 << arduino_pinAssign[pin * 2 + 1])) { regVal = 1; } - } else if (pin >= 20 && pin < 100) { //(20~99:reserved) + } else if (pin >= 22 && pin < 100) { //(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; @@ -287,11 +287,11 @@ int GPIOIntStatus(int pin) { } void GPIOIntClear(int pin) { - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~21) { LPC_GPIO[arduino_pinAssign[pin * 2]]->IC |= (1 << arduino_pinAssign[pin * 2 + 1]); - } else if (pin >= 20 && pin < 100) { //(20~99:reserved) + } else if (pin >= 22 && pin < 100) { //(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { diff --git a/src/core/gpio_int.cpp b/src/core/gpio_int.cpp index 8cb4541..27e16c6 100755 --- a/src/core/gpio_int.cpp +++ b/src/core/gpio_int.cpp @@ -1,6 +1,6 @@ #include "gpio.h" -#define EXTERNAL_NUM_INTERRUPTS 20 +#define EXTERNAL_NUM_INTERRUPTS 22 volatile static USER_GPIO_FUNC intFunc[EXTERNAL_NUM_INTERRUPTS]; void attachInterrupt(int pin, USER_GPIO_FUNC func, digitalWriteState mode) { @@ -27,7 +27,7 @@ void attachInterrupt(int pin, USER_GPIO_FUNC func, digitalWriteState mode) { } - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~22) { intFunc[pin] = func; @@ -45,8 +45,8 @@ void attachInterrupt(int pin, USER_GPIO_FUNC func, digitalWriteState mode) { NVIC_EnableIRQ(EINT3_IRQn); break; } - } else if (pin >= 20 && pin < 100) { - //(20~99:reserved) + } else if (pin >= 22 && pin < 100) { + //(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; @@ -76,7 +76,7 @@ void attachInterrupt(int pin, USER_GPIO_FUNC func, digitalWriteState mode) { void detachInterrupt(int pin) { GPIOIntDisable(pin); - if (pin >= 0 && pin < 20) //arduinoPinAssign(0~19) + if (pin >= 0 && pin < 22) //arduinoPinAssign(0~22) { intFunc[pin] = 0; if (LPC_GPIO[arduino_pinAssign[pin * 2]]->IE == 0) { @@ -96,7 +96,7 @@ void detachInterrupt(int pin) { } } } - else if (pin >= 20 && pin < 100) {//(20~99:reserved) + else if (pin >= 22 && pin < 100) {//(22~99:reserved) } else if (pin >= 100 && pin < 200) //maryPinAssign(100~119?) { pin = pin - 100; |
