]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Completing Sony OA-S3400 adapter.
authorJacob Alexander <triplehaata@gmail.com>
Mon, 7 May 2012 17:00:29 +0000 (13:00 -0400)
committerJacob Alexander <triplehaata@gmail.com>
Mon, 7 May 2012 17:00:29 +0000 (13:00 -0400)
- Fixed final bug regarding key release
- Added LED support calls
- Fixed minor keymapping bug for TAB
- Changed default keymap to Colemak

Keymap/sonyoas3400.h
Scan/SonyOA-S3400/scan_loop.c
Scan/SonyOA-S3400/setup.cmake

index aebf4820258930afc2d0034fd669a2092031d7d4..0ed79173e50b71520a6b516827d3e0963127b1a1 100644 (file)
@@ -38,7 +38,7 @@ static uint8_t sonyoas3400_DefaultMap[] = {
                                0, // 0x06
                                0, // 0x07
                                KEY_BACKSPACE, // 0x08
-                               0, // 0x09
+                               KEY_TAB, // 0x09
                                0, // 0x0A
                                0, // 0x0B
                                0, // 0x0C
@@ -190,7 +190,7 @@ static uint8_t sonyoas3400_DefaultMap[] = {
                                0, // 0x9E
                                0, // 0x9F
                                0, // 0xA0
-                               KEY_TAB, // 0xA1
+                               0, // 0xA1
                                0, // 0xA2
                                0, // 0xA3
                                0, // 0xA4
@@ -297,7 +297,7 @@ static uint8_t sonyoas3400_ColemakMap[] = {
                                0, // 0x06
                                0, // 0x07
                                KEY_BACKSPACE, // 0x08
-                               0, // 0x09
+                               KEY_TAB, // 0x09
                                0, // 0x0A
                                0, // 0x0B
                                0, // 0x0C
@@ -449,7 +449,7 @@ static uint8_t sonyoas3400_ColemakMap[] = {
                                0, // 0x9E
                                0, // 0x9F
                                0, // 0xA0
-                               KEY_TAB, // 0xA1
+                               0, // 0xA1
                                0, // 0xA2
                                0, // 0xA3
                                0, // 0xA4
index a694fa4621eaec74b55c8e39ab97798d91f03bac..dda9b28e4688f2c5adec02a89a6fa4bdf0169209 100644 (file)
@@ -342,6 +342,17 @@ void processKeyValue( uint8_t keyValue )
                }
        }
 
+       // TODO Move to Macro Section
+       switch ( keyValue )
+       {
+       case 0xD3: // F11
+               scan_sendData( 0x01 );
+               break;
+       case 0xD4: // F12
+               scan_sendData( 0x02 );
+               break;
+       }
+
        // Scan code is now finalized, and ready to add to buffer
        // Note: Scan codes come from 3 different interrupts and a manual key scan into this function
 
@@ -390,6 +401,9 @@ void processKeyValue( uint8_t keyValue )
                                        // Decrement Buffer
                                        KeyIndex_BufferUsed--;
 
+                                       // Start at this position again for the next loop
+                                       c--;
+
                                        break;
                                }
                        }
@@ -485,8 +499,21 @@ ISR(INT7_vect)
 
 // Send data to keyboard
 // Sony OA-S3400 has no serial/parallel dataport to send data too...
+// Using this function for LED enable/disable
 uint8_t scan_sendData( uint8_t dataPayload )
 {
+       switch ( dataPayload )
+       {
+       case 0x01:
+               LED1_PORT ^= (1 << LED1_POS);
+               break;
+       case 0x02:
+               LED2_PORT ^= (1 << LED2_POS);
+               break;
+       default:
+               erro_print("Invalid data send attempt");
+               break;
+       }
        return 0;
 }
 
index 286771ea82efd094f7331643d14c5012619f84c6..ac61c7d7d7e13d75b1f6df67744d6548d11631b4 100644 (file)
@@ -41,7 +41,7 @@ add_definitions( -I${HEAD_DIR}/Keymap )
 #| Keymap Settings
 add_definitions(
        -DMODIFIER_MASK=sonyoas3400_ModifierMask
-       #-DKEYINDEX_MASK=sonyoas3400_ColemakMap
-       -DKEYINDEX_MASK=sonyoas3400_DefaultMap
+       -DKEYINDEX_MASK=sonyoas3400_ColemakMap
+       #-DKEYINDEX_MASK=sonyoas3400_DefaultMap
 )