Message Edited by Alban on 2007-03-28 08:45 PM
Solved! Go to Solution.
void main(void)
{
TPacket pck = {0, 0, 0, 0, 0, 0}; //packet structure
char ctmp[MAXDATALEN]; //transceived data
TPacketType type = ptToken;
byte i;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
for(i=0; i<MAXDATALEN; i++) {
ctmp[i] = i+0x30;
}
pck.DestAddr = 1; //Destination device address.
pck.SrcAddr = 2; //Source device address.
pck.Type = type; //Type of the packet.
pck.ID = 8; //Packet identification.
pck.Data = ctmp; //Pointer to the transceived data.
pck.DataLen = MAXDATALEN; //Length of the transceived data.
PckD1_SendPacket(pck);
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;{}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
void main(void)
{
TPacket pck = {0, 0, 0, 0, 0, 0}; //packet structure
char ctmp[MAXDATALEN]; //transceived data
TPacketType type = ptToken;
byte i;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
for(i=0; i<MAXDATALEN; i++) {
ctmp[i] = i+0x30;
}
pck.DestAddr = 1; //Destination device address.
pck.SrcAddr = 2; //Source device address.
pck.Type = type; //Type of the packet.
pck.ID = 8; //Packet identification.
pck.Data = ctmp; //Pointer to the transceived data.
pck.DataLen = MAXDATALEN; //Length of the transceived data.
PckD1_SendPacket(pck);
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;{}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/