summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2015-06-02 23:59:16 +0900
committertmk <hasu@tmk-kbd.com>2015-06-02 23:59:16 +0900
commit37af88217d62f22fd5d64a7b58285ce9a94d2176 (patch)
treef1c94e5f0de80d9fac495ff11829ba9d76199f35
parentfdce0c9cc0b7f8e9f1497cae3ea63a6672ceaf71 (diff)
sun_usb: Fix serial recv intrrupt trriger edge #228
-rw-r--r--converter/sun_usb/config.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/converter/sun_usb/config.h b/converter/sun_usb/config.h
index cfd39cd513..66036da931 100644
--- a/converter/sun_usb/config.h
+++ b/converter/sun_usb/config.h
@@ -56,12 +56,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_SOFT_RXD_BIT 2
#define SERIAL_SOFT_RXD_VECT INT2_vect
/* RXD Interupt */
+#ifdef SERIAL_SOFT_LOGIC_NEGATIVE
+/* enable interrupt: INT2(rising edge) */
+#define INTR_TRIG_EDGE ((1<<ISC21)|(1<<ISC20))
+#else
+/* enable interrupt: INT2(falling edge) */
+#define INTR_TRIG_EDGE ((1<<ISC21)|(0<<ISC20))
+#endif
#define SERIAL_SOFT_RXD_INIT() do { \
/* pin configuration: input with pull-up */ \
SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
- /* enable interrupt: INT2(rising edge) */ \
- EICRA |= ((1<<ISC21)|(1<<ISC20)); \
+ EICRA |= INTR_TRIG_EDGE; \
EIMSK |= (1<<INT2); \
sei(); \
} while (0)