I don't know that modify my library file right.
///////////////////////////////////////////
temp.h edit:
time_t now(); // return the current time as seconds since Jan 1 1970
time_t now2();
void setTime(time_t t);
void setTime(int hr,int min,int sec,int day, int month, int yr);
void adjustTime(long adjustment);
///////////////////////////////////////////
temp.cpp edit
return sysTime;
}
time_t now2(){
while( millis() - prevMillis >= 1000){
sysTime++;
prevMillis += 1000;
#ifdef TIME_DRIFT_INFO
sysUnsyncedTime++; // this can be compared to the synced time to measure long term drift
#endif
}
return sysTime;
}
void setTime(time_t t){
#ifdef TIME_DRIFT_INFO
if(sysUnsyncedTime == 0)
sysUnsyncedTime = t; // store the time of the first call to set a valid Time
#endif
//////////////////////////////////////////////////////////////////////
OneWire.h edit:
public:
OneWire( uint8_t pin);
// Perform a 1-Wire reset cycle. Returns 1 if a device responds
// with a presence pulse. Returns 0 if there is no device or the
// bus is shorted or otherwise held low for more than 250uS
uint8_t reset(void);
uint8_t reset2(void);
// Issue a 1-Wire rom select command, you do the reset first.
void select(const uint8_t rom[8]);
///////////////////////////////////////////////////////////////////
OneWire.cpp edit:
// Perform the onewire reset function. We will wait up to 250uS for
// the bus to come high, if it doesn't then it is broken or shorted
// and we return a 0;
//
// Returns 1 if a device asserted a presence pulse, 0 otherwise.
//
//uint8_t OneWire::reset(void)
uint8_t OneWire::reset2(void)
{
IO_REG_TYPE mask = bitmask;
volatile IO_REG_TYPE *reg IO_REG_ASM = baseReg;
uint8_t r;
uint8_t retries = 125;
/////////////////////////////////////////////
//delayMicroseconds(410);
uint8_t OneWire::reset(void)
{
uint8_t r = reset2();
delayMicroseconds(410);
return r;
}
return r;
}
//////////////////////////////////////////
EthernetClient.h edit:
virtual int read();
virtual int read(uint8_t *buf, size_t size);
virtual int peek();
virtual void flush();
virtual void stop();
virtual uint8_t connected();
virtual operator bool();
virtual bool operator==(const EthernetClient&);
virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); };
uint8_t* getRemoteIP(uint8_t RemoteIP[]);
friend class EthernetServer;
/////////////////////////////////////////////////////
EthernetClient.cpp edit:
// the next function allows us to use the client returned by
// EthernetServer::available() as the condition in an if-statement.
EthernetClient:
perator bool() {
return _sock != MAX_SOCK_NUM;
}
bool EthernetClient:
perator==(const EthernetClient& rhs) {
return _sock == rhs._sock && _sock != MAX_SOCK_NUM && rhs._sock != MAX_SOCK_NUM;
}
uint8_t* EthernetClient::getRemoteIP(uint8_t remoteIP[])
{
W5100.readSnDIPR(_sock, remoteIP);
return remoteIP;
}