Gast
#877784
Hallo zusammen
ich habe code für [WriteProgMem] und ich moechte eine Funktion schreiben
die die von Funktion WriteProgMem geschrieben werden und ich schaffe
nicht.Das sind die Code
void WriteProgMem(void) //TESTED: Passed
{
/*
* The write holding register for the 18F4550 family is
* actually 32-byte. The code below only tries to write
* 16-byte because the GUI program only sends out 16-byte
* at a time.
* This limitation will be fixed in the future version.
*/
dataPacket.ADR.low &= 0b11110000; //Force 16-byte boundary
EECON1 = 0b10000100; //Setup writes: EEPGD=1,WREN=1
//LEN = # of byte to write
for (counter = 0; counter < (dataPacket.len); counter++)
{
*((dataPacket.ADR.pAdr)+counter) = \
dataPacket.data[counter];
dataPacket.data[counter]= ??????;
if ((counter & 0b00001111) == 0b00001111)
{
StartWrite();
}//end if
}//end for
}//end WriteProgMem
und das ist meine Funktion:
unsigned char AND(unsigned char IN1,unsigned char IN2)
{if(IN1&&In2)
return(1);
}
und ich will AND, IN1, IN2 in Flash schreiben.
Grüß