]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - converter/pc98_usb/config.h
pc98_usb: Fix pin configuration in README
[max/tmk_keyboard.git] / converter / pc98_usb / config.h
index 04ee5b1101bbc1627fd2f79be6a566c1520443ab..c6315d00b4c71f63536dcc4f8f571430de36a707 100644 (file)
@@ -30,15 +30,22 @@ 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()    ( \
-    host_get_first_key() == KC_CANCEL \
+    keyboard_report->keys[0] == KC_STOP || \
+    keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \
 )
 
 
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* Control LED indicatiors, which doesn't work well with locking support */
+//#define PC98_LED_CONTROL
+
+
 /* PC98 Reset Port shared with TXD */
 #define PC98_RST_DDR    DDRD
 #define PC98_RST_PORT   PORTD
@@ -50,15 +57,17 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* PC98 Retry Port */
 #define PC98_RTY_DDR    DDRD
 #define PC98_RTY_PORT   PORTD
-#define PC98_RTY_BIT    5
+#define PC98_RTY_BIT    1
 
 /*
  * PC98 Serial(USART) configuration
  *     asynchronous, positive logic, 19200baud, bit order: LSB first
  *     1-start bit, 8-data bit, odd parity, 1-stop bit
  */
+
 /*
  * Software Serial
+ *   Add protocol/serial_soft.c to SRC in Makefile
  */
 #define SERIAL_SOFT_BAUD                19200
 #define SERIAL_SOFT_PARITY_ODD
@@ -69,11 +78,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define SERIAL_SOFT_RXD_PORT            PORTD
 #define SERIAL_SOFT_RXD_PIN             PIND
 #define SERIAL_SOFT_RXD_BIT             2
-#ifdef SERIAL_SOFT_LOGIC_NEGATIVE
-    #define SERIAL_SOFT_RXD_READ()      ~(SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
-#else
-    #define SERIAL_SOFT_RXD_READ()      (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
-#endif
+#define SERIAL_SOFT_RXD_READ()          (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
 /* RXD Interupt */
 #define SERIAL_SOFT_RXD_VECT            INT2_vect
 #define SERIAL_SOFT_RXD_INIT()          do { \
@@ -95,21 +100,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define SERIAL_SOFT_TXD_PORT            PORTD
 #define SERIAL_SOFT_TXD_PIN             PIND
 #define SERIAL_SOFT_TXD_BIT             3
-#ifdef SERIAL_SOFT_LOGIC_NEGATIVE
-    #define SERIAL_SOFT_TXD_ON()        do { \
-        SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); \
-    } while (0)
-    #define SERIAL_SOFT_TXD_OFF()       do { \
-        SERIAL_SOFT_TXD_PORT |=  (1<<SERIAL_SOFT_TXD_BIT); \
-    } while (0)
-#else
-    #define SERIAL_SOFT_TXD_ON()        do { \
-        SERIAL_SOFT_TXD_PORT |=  (1<<SERIAL_SOFT_TXD_BIT); \
-    } while (0)
-    #define SERIAL_SOFT_TXD_OFF()       do { \
-        SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); \
-    } while (0)
-#endif
+#define SERIAL_SOFT_TXD_HI()            do { SERIAL_SOFT_TXD_PORT |=  (1<<SERIAL_SOFT_TXD_BIT); } while (0)
+#define SERIAL_SOFT_TXD_LO()            do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
 #define SERIAL_SOFT_TXD_INIT()          do { \
     /* pin configuration: output */ \
     SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
@@ -120,8 +112,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*
  * Hardware Serial(UART)
+ *   Add protocol/serial_uart.c to SRC in Makefile
  */
-#ifdef __AVR_ATmega32U4__
+#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U2__)
     #define SERIAL_UART_BAUD       19200
     #define SERIAL_UART_DATA       UDR1
     #define SERIAL_UART_UBRR       ((F_CPU/(16UL*SERIAL_UART_BAUD))-1)
@@ -133,6 +126,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
         UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \
         UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \
         UCSR1C |= (1<<UPM11) | (1<<UPM10);  /* parity: none(00), even(01), odd(11) */ \
+        DDRD  &= ~(1<<2); PORTD |=  (1<<2); /* Pull-up RXD pin */ \
         sei(); \
     } while(0)
 #else