Other HI-TECH Compilers & Products >> 8051 Legacy Compiler

Brent W
Silicon Labs Team Member
*****

Reged: Aug 21 2007
Posts: 2
Loc: Austin, TX
Error "Can't generate code for this expression"
      Fri Sep 07 2007 08:40 PM

Hi,

I'm porting an HID USB mouse example to HI-Tech 8051 ver 9.01 and am getting the error above. I've reduced the code to fit in this post (shows error at 'EP_STATUS[0] = EP_IDLE;' line).

Please use Code tags to maintain formatting and improve code readability. I have added them here. (mod)
Code:
#define  EP_IDLE                 0x00  // This signifies Endpoint Idle State
#define EP_HALT 0x03 // Endpoint Halt State (return stalls)

unsigned char EP_STATUS[3] = {EP_IDLE, EP_HALT, EP_HALT};

void Usb_Reset (void);

void main (void)
{

Usb_Reset ();

while (1) // Spin forever
{
}
}

void Usb_Reset (void)
{
EP_STATUS[0] = EP_IDLE; // Set default Endpoint Status
EP_STATUS[1] = EP_HALT;
EP_STATUS[2] = EP_HALT;
}



Any help would be greatly appreciated.

Thanks,

Brent

Edited by Dan Henry (Sat Sep 08 2007 01:19 PM)

Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* Error "Can't generate code for this expression" Brent W Fri Sep 07 2007 08:40 PM
. * * Re: Error "Can't generate code for this expression" Dan HenryModerator   Sat Sep 08 2007 02:04 PM
. * * Re: Error "Can't generate code for this expression" Dan HenryModerator   Sat Sep 08 2007 03:05 PM
. * * Re: Error "Can't generate code for this expression" Brent W   Mon Sep 10 2007 12:37 PM

Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:  ndouglas, jtemples, Dan Henry, Andrew L, mikerj, dave g, meisty, josh stevo 



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Thread views: 3515

Rate this thread

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5