Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

type cast in GCC

2006-02-28 by weartronics

Dear lpc2000,

In the Keil LPC2148 USB examples, EP0 buffer is declared as a byte array
BYTE  EP0Buf[USB_MAX_PACKET0];

but later it is type cast to the packed word array
*((__packed WORD *)EP0Buf) = 0;

I don't understand how the pointer EP0Buf would be changed by casting
it to the __packed word pointer. Is anyone able to explain the
function of the type cast to me so I can write a GCC equivalent (where
the type cast to a packed type is not supported)?

Thanks,

Nic

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.