for(i=0; i<64; i++)
TX1_write2buff(tmp[i]); // Return data to serial port
TX1_write2buff(0x0d);
TX1_write2buff(0x0a);
}
else if(RX1_Buffer[0] == 'M') //PC requests to return 64 bytes of EEPROM data
{
PrintString1("MOVCData be read
如下:
\r\n");
EEPROM_MOVC_read_n(addr,tmp,64);
for(i=0; i<64; i++)
TX1_write2buff(tmp[i]); // Return data to serial port
TX1_write2buff(0x0d);
TX1_write2buff(0x0a);
}
else PrintString1("
命令错误
!\r\n");
}
else PrintString1("
命令错误
!\r\n");
}
RX1_Cnt = 0;
}
}
}
}
/**********************************************/
/*************** send a byte *******************************/
void TX1_write2buff(u8 dat) //write send buffer
{
B_TX1_Busy = 1; //Set sending busy flag
SBUF = dat; //send a byte
while(B_TX1_Busy); //wait for sending complish
}
//========================================================================
// Function: void PrintString1(u8 *puts)
// Description: UART1 send string function.
// Parameters:puts: String pointer.
// Return: none.
// Version: VER1.0
// Date: 2014-11-28
// Remark:
//========================================================================
void PrintString1(u8 *puts) //send a string
{
for (; *puts != 0; puts++) //End with stop 0
{
TX1_write2buff(*puts);
}
}
//========================================================================
// Function: void UART1_config(void)
// Description: UART1 initialization function.
// Parameters:none.
// Return: none.
// Version: VER1.0
// Date: 2014-11-28