Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/01/04 02:24
Read: times


 
#63784 - Keil C error
I'm trying to write code to scan a key matrix. I haven't a clue why Keil's C compiler doesn't like the Return statement in the enclosed code fragment. I continue to receive "Error C267 'Return': Requires ANSI-Style Prototype" .

unsigned char KeyScan (void)
{

//Scan 4 row by 5 column key matrix
//Rows (port C4-C7 pins) are outputs
//Columns (port A0-A4 pulled hi 10k) read back
//Low on Column = Key pressed

unsigned char Key_C, Key_P, Row_C;

Key_P = 0xFF; //clear all previous key values
Key_C = 0xFF; //clear all current key values

Row_Out = Row_0; //Set Row_0 low to scan
Key_P = (~(Column_In | 0xE0)); //Mask unused bits and invert bits
if (Key_P) //if key was press on this row
{
Row_C = 0; //Row that key was found on
Delay (30); //wait 30 ms for key to stop bouncing
Key_C = (~(Column_In | 0xE0));
Key_C = Key_C ^ Key_P;//check if key still down
if (!Key_C) // Same Key still down
{
Key_C = Parse_Key (Row_C, Key_P); //convert to key number
Return (Key_C); //return with key value
}
}

Please Help
Thanks
Brian

List of 4 messages in thread
TopicAuthorDate
Keil C error            01/01/70 00:00      
   RE: Keil C error            01/01/70 00:00      
      RE: Keil C error            01/01/70 00:00      
         RE: Keil C error            01/01/70 00:00      

Back to Subject List