Ejemplo n.º 1
0
void set_parameters(void) {
	fill(20);

	// parameters not used yet <--

	// call this after reading paramter packet into buff[]
	//param.devicecode = buff[0];
	//param.revision = buff[1];
	//param.progtype = buff[2];
	//param.parmode = buff[3];
	//param.polling = buff[4];
	//param.selftimed = buff[5];
	//param.lockbytes = buff[6];
	//param.fusebytes = buff[7];
	//param.flashpoll = buff[8];
	// ignore buff[9] (= buff[8])
	// following are 16 bits (big endian)
#define beget16(addr) (*addr * 256 + *(addr+1) )
	//param.eeprompoll = beget16(&buff[10]);
	ram.isp.param.pagesize = beget16(&ram.RingBuffer_Data[12]);
	ram.isp.param.eepromsize = beget16(&ram.RingBuffer_Data[14]);

	// 32 bits flashsize (big endian)
	//param.flashsize = buff[16] * 0x01000000
	//	+ buff[17] * 0x00010000
	//	+ buff[18] * 0x00000100
	//	+ buff[19];
}
Ejemplo n.º 2
0
void ESP8266AVRISP::set_parameters() {
    // call this after reading paramter packet into buff[]
    param.devicecode = buff[0];
    param.revision   = buff[1];
    param.progtype   = buff[2];
    param.parmode    = buff[3];
    param.polling    = buff[4];
    param.selftimed  = buff[5];
    param.lockbytes  = buff[6];
    param.fusebytes  = buff[7];
    param.flashpoll  = buff[8];
    // ignore buff[9] (= buff[8])
    // following are 16 bits (big endian)
    param.eeprompoll = beget16(&buff[10]);
    param.pagesize   = beget16(&buff[12]);
    param.eepromsize = beget16(&buff[14]);

    // 32 bits flashsize (big endian)
    param.flashsize = buff[16] * 0x01000000
                    + buff[17] * 0x00010000
                    + buff[18] * 0x00000100
                    + buff[19];
}