summaryrefslogtreecommitdiff
path: root/converter/pc98_usb/config.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-02-24 18:10:50 +0900
committertmk <nobody@nowhere>2013-02-24 18:10:50 +0900
commitfea6792f1636a716e799539b072930461bfcba67 (patch)
tree49f7fc333ac37d2bbb8050dc4b543e5efa2f0bea /converter/pc98_usb/config.h
parent79b1f129085425c72b72bee28ed065bf243c0a0b (diff)
New keymap of PC98
Diffstat (limited to 'converter/pc98_usb/config.h')
-rw-r--r--converter/pc98_usb/config.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/converter/pc98_usb/config.h b/converter/pc98_usb/config.h
index 6ef2c6ac30..aa0476e3e8 100644
--- a/converter/pc98_usb/config.h
+++ b/converter/pc98_usb/config.h
@@ -30,12 +30,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 16
#define MATRIX_COLS 8
+/* To use new keymap framework */
+#define USE_KEYMAP_V2
/* key combination for command */
#define IS_COMMAND() ( \
- keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \
- keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
- keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+ host_get_first_key() == KC_CANCEL \
)
@@ -46,11 +46,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_BAUD 19200
#define SERIAL_PARITY_ODD
#define SERIAL_BIT_ORDER_LSB
+#define SERIAL_LOGIC_POSITIVE
-/* PC98 Reset Port */
+/* PC98 Reset Port shared with TXD */
#define PC98_RST_DDR DDRD
#define PC98_RST_PORT PORTD
-#define PC98_RST_BIT 1
+#define PC98_RST_BIT 3
/* PC98 Ready Port */
#define PC98_RDY_DDR DDRD
#define PC98_RDY_PORT PORTD
@@ -65,7 +66,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_RXD_PORT PORTD
#define SERIAL_RXD_PIN PIND
#define SERIAL_RXD_BIT 2
+#ifdef SERIAL_LOGIC_NEGATIVE
+#define SERIAL_RXD_READ() ~(SERIAL_RXD_PIN&(1<<SERIAL_RXD_BIT))
+#else
#define SERIAL_RXD_READ() (SERIAL_RXD_PIN&(1<<SERIAL_RXD_BIT))
+#endif
/* RXD Interupt */
#define SERIAL_RXD_VECT INT2_vect
#define SERIAL_RXD_INIT() do { \
@@ -75,6 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* enable interrupt: INT2(falling edge) */ \
EICRA |= ((1<<ISC21)|(0<<ISC20)); \
EIMSK |= (1<<INT2); \
+ sei(); \
} while (0)
#define SERIAL_RXD_INT_ENTER()
#define SERIAL_RXD_INT_EXIT() do { \
@@ -82,14 +88,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
EIFR = (1<<INTF2); \
} while (0)
-/* TXD Port: Not used */
+/* TXD Port */
#define SERIAL_TXD_DDR DDRD
#define SERIAL_TXD_PORT PORTD
#define SERIAL_TXD_PIN PIND
#define SERIAL_TXD_BIT 3
-/* negative logic */
+#ifdef SERIAL_LOGIC_NEGATIVE
#define SERIAL_TXD_ON() do { SERIAL_TXD_PORT &= ~(1<<SERIAL_TXD_BIT); } while (0)
#define SERIAL_TXD_OFF() do { SERIAL_TXD_PORT |= (1<<SERIAL_TXD_BIT); } while (0)
+#else
+#define SERIAL_TXD_ON() do { SERIAL_TXD_PORT |= (1<<SERIAL_TXD_BIT); } while (0)
+#define SERIAL_TXD_OFF() do { SERIAL_TXD_PORT &= ~(1<<SERIAL_TXD_BIT); } while (0)
+#endif
#define SERIAL_TXD_INIT() do { \
/* pin configuration: output */ \
SERIAL_TXD_DDR |= (1<<SERIAL_TXD_BIT); \