
// Receive Data from the IF2 buffer
bit receive_data (char MsgNum)
{
  SFRPAGE  = CAN0_PAGE; // IF2 already set up for RX

  CAN0ADR  = IF2CMDRQST;// Point to Command Request Reg.
  CAN0DATL = MsgNum;    // Move new data for RX from Msg Obj "MsgNum"
                        // Move new data to a
  // --initiates write to Msg Obj
  // 3-6 CAN clock cycles to move IF register contents to the Msg Obj in CAN RAM
  while (CAN0DATH > 0x7f); // wait for busy to go away !

  CAN0ADR  = IF2MSGC;
  if(!(CAN0DATH & 0x80)) {
    SFRPAGE  = LEGACY_PAGE;
    return(0);
  }
  CAN0DATH=0;

  CAN0ADR  = IF2DATA1;  // Point to 1st byte of Data Field
