keil_examples/EMAC/EMAC.c
// copies bytes from frame port to MCU-memory
// NOTES: * an odd number of byte may only be transfered
//          if the frame is read to the end!
//        * MCU-memory MUST start at word-boundary
copies bytes from frame port to MCU-memory
NOTES: * an odd number of byte may only be transfered
if the frame is read to the end.
MCU-memory MUST start at word-boundary
copies bytes from frame port to MCU - memory NOTES : * an odd number of byte may only be transfered if the frame is read to the end . MCU - memory MUST start at word - boundary
void CopyFromFrame_EMAC(void *Dest, unsigned short Size)
{
  unsigned short * piDest;                       
  piDest = Dest;                                 
  while (Size > 1) {
    *piDest++ = ReadFrame_EMAC();
    Size -= 2;
  }
  if (Size) {                                         
    *(unsigned char *)piDest = (char)ReadFrame_EMAC();
  }                                                   
}
void CopyFromFrame_EMAC ( void * Dest , unsigned short Size ) { unsigned short * piDest ; piDest = Dest ; while ( Size > 1 ) { * piDest ++ = ReadFrame_EMAC ( ) ; Size -= 2 ; } if ( Size ) { * ( unsigned char * ) piDest = ( char ) ReadFrame_EMAC ( ) ; } }
copies bytes from frame port to MCU-memory
NOTES: * an odd number of byte may only be transfered
if the frame is read to the end!
copies bytes from frame port to MCU - memory NOTES : * an odd number of byte may only be transfered if the frame is read to the end!
// Keil: Pointer added to correct expression // Keil: Line added // check for leftover byte... // the LAN-Controller will return 0 // for the highbyte