| 102 | } |
| 103 | |
| 104 | void processKeyValue( uint8_t keyValue ) |
| 105 | { |
| 106 | // Finalize output buffer |
| 107 | // Mask 8th bit |
| 108 | keyValue &= 0x7F; |
| 109 | |
| 110 | // Interpret scan code |
| 111 | switch ( keyValue ) |
| 112 | { |
| 113 | case 0x40: // Clear buffer command |
| 114 | info_printNL("CLEAR!"); |
| 115 | |
| 116 | BufferReadyToClear = 1; |
| 117 | break; |
| 118 | case 0x7F: |
| 119 | scan_lockKeyboard(); |
| 120 | _delay_ms(3000); |
| 121 | scan_unlockKeyboard(); |
| 122 | |
| 123 | default: |
| 124 | // Make sure the key isn't already in the buffer |
| 125 | for ( uint8_t c = 0; c < KeyIndex_BufferUsed + 1; c++ ) |
| 126 | { |
| 127 | // Key isn't in the buffer yet |
| 128 | if ( c == KeyIndex_BufferUsed ) |
| 129 | { |
| 130 | Macro_bufferAdd( keyValue ); |
| 131 | break; |
| 132 | } |
| 133 | |
| 134 | // Key already in the buffer |
| 135 | if ( KeyIndex_Buffer[c] == keyValue ) |
| 136 | break; |
| 137 | } |
| 138 | break; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // USART Receive Buffer Full Interrupt |
| 143 | ISR(USART1_RX_vect) |
no outgoing calls
no test coverage detected
searching dependent graphs…