|
@@ -75,7 +75,7 @@ static u_char KbRemapKey(u_short LongKey);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Clear the eventbuffer of this module
|
|
* \brief Clear the eventbuffer of this module
|
|
|
*
|
|
*
|
|
@@ -83,7 +83,7 @@ static u_char KbRemapKey(u_short LongKey);
|
|
|
*
|
|
*
|
|
|
* \param *pEvent pointer to the event queue
|
|
* \param *pEvent pointer to the event queue
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
static void KbClearEvent(HANDLE *pEvent)
|
|
static void KbClearEvent(HANDLE *pEvent)
|
|
|
{
|
|
{
|
|
|
NutEnterCritical();
|
|
NutEnterCritical();
|
|
@@ -93,7 +93,7 @@ static void KbClearEvent(HANDLE *pEvent)
|
|
|
NutExitCritical();
|
|
NutExitCritical();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Low-level keyboard scan
|
|
* \brief Low-level keyboard scan
|
|
|
*
|
|
*
|
|
@@ -102,8 +102,8 @@ static void KbClearEvent(HANDLE *pEvent)
|
|
|
*
|
|
*
|
|
|
* After each keyboard-scan, check for a valid MMCard
|
|
* After each keyboard-scan, check for a valid MMCard
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
-int KbScan()
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
|
|
+void KbScan()
|
|
|
{
|
|
{
|
|
|
u_char KeyNibble0, KeyNibble1, KeyNibble2, KeyNibble3;
|
|
u_char KeyNibble0, KeyNibble1, KeyNibble2, KeyNibble3;
|
|
|
|
|
|
|
@@ -156,17 +156,17 @@ int KbScan()
|
|
|
KeyFound |= (KeyNibble1 & 0x00F0); // b7..b4 in 'KeyNibble1' to b7...b4 in 'KeyFound' -- do nothing
|
|
KeyFound |= (KeyNibble1 & 0x00F0); // b7..b4 in 'KeyNibble1' to b7...b4 in 'KeyFound' -- do nothing
|
|
|
KeyFound |= ((KeyNibble2<<4) & 0x0F00); // b7..b4 in 'KeyNibble2' to b11..b8 in 'KeyFound' << shift 4 left
|
|
KeyFound |= ((KeyNibble2<<4) & 0x0F00); // b7..b4 in 'KeyNibble2' to b11..b8 in 'KeyFound' << shift 4 left
|
|
|
KeyFound |= ((KeyNibble3<<8) & 0xF000); // b7..b4 in 'KeyNibble3' to b15..b12 in 'KeyFound' << shift 8 left
|
|
KeyFound |= ((KeyNibble3<<8) & 0xF000); // b7..b4 in 'KeyNibble3' to b15..b12 in 'KeyFound' << shift 8 left
|
|
|
- return KeyFound;
|
|
|
|
|
|
|
+ KbInjectKey(KbRemapKey(KeyFound));
|
|
|
#endif // USE_JTAG
|
|
#endif // USE_JTAG
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Remap the 16-bit value for the active key to an 8-bit value
|
|
* \brief Remap the 16-bit value for the active key to an 8-bit value
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
static u_char KbRemapKey(u_short LongKey)
|
|
static u_char KbRemapKey(u_short LongKey)
|
|
|
{
|
|
{
|
|
|
switch (LongKey)
|
|
switch (LongKey)
|
|
@@ -192,25 +192,25 @@ static u_char KbRemapKey(u_short LongKey)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Return the repeating property for this key
|
|
* \brief Return the repeating property for this key
|
|
|
*
|
|
*
|
|
|
* \return 'TRUE' in case the key was repeating, 'FALSE' if not
|
|
* \return 'TRUE' in case the key was repeating, 'FALSE' if not
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
static u_char KbKeyIsRepeating(u_short Key)
|
|
static u_char KbKeyIsRepeating(u_short Key)
|
|
|
{
|
|
{
|
|
|
return(KeyRepeatArray[KbRemapKey(Key)]==KEY_REPEAT);
|
|
return(KeyRepeatArray[KbRemapKey(Key)]==KEY_REPEAT);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief set the property of this key to repeating or not-repeating
|
|
* \brief set the property of this key to repeating or not-repeating
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
void KbSetKeyRepeating(u_char Key, u_char Property)
|
|
void KbSetKeyRepeating(u_char Key, u_char Property)
|
|
|
{
|
|
{
|
|
|
// check arguments
|
|
// check arguments
|
|
@@ -220,7 +220,7 @@ void KbSetKeyRepeating(u_char Key, u_char Property)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Wait until an event was pushed on the eventqueue for this module
|
|
* \brief Wait until an event was pushed on the eventqueue for this module
|
|
|
*
|
|
*
|
|
@@ -232,7 +232,7 @@ void KbSetKeyRepeating(u_char Key, u_char Property)
|
|
|
* \return KB_OK in case an event was found
|
|
* \return KB_OK in case an event was found
|
|
|
* \return KB_ERROR in case no event was found (return due to timeout)
|
|
* \return KB_ERROR in case no event was found (return due to timeout)
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
int KbWaitForKeyEvent(u_long dwTimeout)
|
|
int KbWaitForKeyEvent(u_long dwTimeout)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -248,7 +248,7 @@ int KbWaitForKeyEvent(u_long dwTimeout)
|
|
|
return(nError);
|
|
return(nError);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Return the databyte that was receeived in the IR-stream
|
|
* \brief Return the databyte that was receeived in the IR-stream
|
|
|
*
|
|
*
|
|
@@ -260,7 +260,7 @@ int KbWaitForKeyEvent(u_long dwTimeout)
|
|
|
*
|
|
*
|
|
|
* \todo implement a key-buffer for this routine
|
|
* \todo implement a key-buffer for this routine
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
u_char KbGetKey()
|
|
u_char KbGetKey()
|
|
|
{
|
|
{
|
|
|
return(KeyBuffer[0]);
|
|
return(KeyBuffer[0]);
|
|
@@ -275,7 +275,7 @@ void KbInjectKey(u_char VirtualKey)
|
|
|
KeyBuffer[0]=VirtualKey;
|
|
KeyBuffer[0]=VirtualKey;
|
|
|
NutEventPostFromIrq(&hKBEvent); // 'valid key' detected -> generate Event
|
|
NutEventPostFromIrq(&hKBEvent); // 'valid key' detected -> generate Event
|
|
|
}
|
|
}
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
/*!
|
|
/*!
|
|
|
* \brief Initialise the Keyboard module
|
|
* \brief Initialise the Keyboard module
|
|
|
*
|
|
*
|
|
@@ -288,7 +288,7 @@ void KbInjectKey(u_char VirtualKey)
|
|
|
* when no key is pressed. Use negative logic to detect keys.
|
|
* when no key is pressed. Use negative logic to detect keys.
|
|
|
* So default state of the colums is '1'
|
|
* So default state of the colums is '1'
|
|
|
*/
|
|
*/
|
|
|
-/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
|
|
|
|
|
|
|
+/* ����������������������������������������������������������������������� */
|
|
|
void KbInit()
|
|
void KbInit()
|
|
|
{
|
|
{
|
|
|
u_char i;
|
|
u_char i;
|