Skip to content

Commit

Permalink
Updated source and libraries to compile with Arduino 1.6.5.
Browse files Browse the repository at this point in the history
Unzip libraries.zip into the "libraries" folder in your sketchbook folder.
  • Loading branch information
d0ughb0y committed Aug 28, 2015
1 parent bc2c36e commit f83bea2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Apex.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ boolean process_params(char* inputstring, char* params_[], uint8_t len) {
return true;
}

char* date2file(time_t t,char* base, char* buf) {
char* date2file(time_t t,const char* base, char* buf) {
tmElements_t tm;
breakTime(t, tm);
return date2file(tm, base, buf);
}

char* date2file(tmElements_t tm,char* base, char* buf) {
char* date2file(tmElements_t tm, const char* base, char* buf) {
char* c = buf;
*c++='/';
*c++=base[0];
Expand Down
4 changes: 2 additions & 2 deletions Network.ino
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void send_file_name(TinyWebServer& web_server) {
send_file_name(web_server,fullpath);
}

void send_file_name(TinyWebServer& web_server, char* fullpath) {
void send_file_name(TinyWebServer& web_server, const char* fullpath) {
char* fn;
EthernetClient& client = web_server.get_client();
if (!fullpath) {
Expand All @@ -119,7 +119,7 @@ void send_file_name(TinyWebServer& web_server, char* fullpath) {
= TinyWebServer::get_mime_type_from_filename(fullpath);
char* f = strrchr(fullpath,'/');
if (f>fullpath)
fullpath[f-fullpath]=0;
((char*)fullpath)[f-fullpath]=0;
if ((f==fullpath?sd.chdir():sd.chdir(fullpath))) {
fn = f+1;
if (file_.open(fn,O_READ)) {
Expand Down
10 changes: 5 additions & 5 deletions PWMPumps.ino
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ uint8_t W1Pattern(uint8_t step) {
return val[step];
}

PROGMEM const prog_uint8_t w2val[]={136,156,166,176,186,196,201,208,224,
PROGMEM const uint8_t w2val[]={136,156,166,176,186,196,201,208,224,
241,255,255,241,224,208,191,171,154};
uint8_t W2Pattern(uint8_t step) {
//move up 9 steps, down 6 steps
return pgm_read_byte(w2val+step);
}

PROGMEM const prog_uint8_t w3val[]={128,136,156,166,176,203,230,255,
PROGMEM const uint8_t w3val[]={128,136,156,166,176,203,230,255,
240,224,208,192,176,160,144,136};
uint8_t W3Pattern(uint8_t step) {
//move up 6 steps, down 8 steps
Expand All @@ -219,12 +219,12 @@ uint8_t ELSEPattern(uint8_t step) {
return random(126,255);
}

PROGMEM const prog_uint8_t feedval[]={255,0,0,0,0,0,0,0};
PROGMEM const uint8_t feedval[]={255,0,0,0,0,0,0,0};
uint8_t FeedPattern(uint8_t step) {
return pgm_read_byte(feedval+step);
}

PROGMEM const prog_uint8_t ntmval[]={255,255,255,255,255,255,255,255,255,255,255,255,
PROGMEM const uint8_t ntmval[]={255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,
Expand All @@ -238,7 +238,7 @@ uint8_t NTMPattern(uint8_t step) {
return pgm_read_byte(ntmval+step);
}

PROGMEM const prog_uint8_t cval[]=CUSTOMPATTERN;
PROGMEM const uint8_t cval[]=CUSTOMPATTERN;
uint8_t CustomPattern(uint8_t step) {
return pgm_read_byte(cval+step);
}
Expand Down
10 changes: 5 additions & 5 deletions Sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Sensor* ssensors[3];
uint8_t idx = 0;

Sensor::Sensor(char* name, SensorType type, SensorAddrType addrType, boolean isEZO){
Sensor::Sensor(const char* name, SensorType type, SensorAddrType addrType, boolean isEZO){
_type=type;
_addrType = addrType;
_isEZO = isEZO;
Expand Down Expand Up @@ -173,7 +173,7 @@ char* Sensor::getName(){
return _name;
}

SensorSerial::SensorSerial(char* name,SensorType type, HardwareSerial* saddr, boolean isEZO) :Sensor(name,type,_serial,isEZO) {
SensorSerial::SensorSerial(const char* name,SensorType type, HardwareSerial* saddr, boolean isEZO) :Sensor(name,type,_serial,isEZO) {
ssensors[idx++]=this;
_saddr = saddr;
if (type==_cond)
Expand All @@ -185,7 +185,7 @@ SensorSerial::SensorSerial(char* name,SensorType type, HardwareSerial* saddr, bo
_initialized=false;
}

void SensorSerial::send(char* command) {
void SensorSerial::send(const char* command) {
_saddr->print(command);
_saddr->print("\r");
}
Expand All @@ -210,12 +210,12 @@ boolean SensorSerial::getresponse() {
return _ready;
}

SensorI2C::SensorI2C(char* name,SensorType type, uint8_t i2caddr) :Sensor(name,type,_i2c,true) {
SensorI2C::SensorI2C(const char* name,SensorType type, uint8_t i2caddr) :Sensor(name,type,_i2c,true) {
_i2caddr = i2caddr;
_initialized=false;
}

void SensorI2C::send(char* str) {
void SensorI2C::send(const char* str) {
Wire.beginTransmission(_i2caddr);
Wire.write(str);
Wire.endTransmission();
Expand Down
14 changes: 7 additions & 7 deletions Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class Sensor {
public:
enum SensorType {_ph,_orp,_cond};
enum SensorAddrType {_serial, _i2c};
Sensor(char* name, SensorType type, SensorAddrType addr, boolean isEZO);
Sensor(const char* name, SensorType type, SensorAddrType addr, boolean isEZO);
virtual boolean init();
virtual void update();
virtual void update(uint16_t rawtemp);
virtual boolean getresponse() {};
virtual boolean getresponse(){return false;};
virtual float getVal();
virtual void calibrate(char* calstr);
virtual void reset();
Expand All @@ -35,25 +35,25 @@ class Sensor {
float _value; //last reading value
uint16_t _temp; //temp used for temp compensation
uint8_t _retrycount;
virtual void send(char* command) {};
virtual void send(const char* command) {};
};


class SensorSerial:public Sensor {
public:
SensorSerial(char* name, SensorType type, HardwareSerial* saddr, boolean isEZO);
SensorSerial(const char* name, SensorType type, HardwareSerial* saddr, boolean isEZO);
protected:
HardwareSerial* _saddr;
boolean getresponse();
void send(char* command);
void send(const char* command);
};

class SensorI2C:public Sensor {
public:
SensorI2C(char* name, SensorType type, uint8_t i2caddr);
SensorI2C(const char* name, SensorType type, uint8_t i2caddr);
protected:
uint8_t _i2caddr;
boolean getresponse();
void send(char* command);
void send(const char* command);
};
#endif
2 changes: 1 addition & 1 deletion TinyWebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define __WEB_SERVER_H__

#include <Print.h>
#include <SdFile.h>
#include <SdFat.h>
//class SdFile;
class TinyWebServer;

Expand Down
4 changes: 2 additions & 2 deletions Utils.ino
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void logAlarm() {
}
}

boolean logSetup(const time_t thetime, char* buffer, char* dir, char* ext) {
boolean logSetup(const time_t thetime, char* buffer, const char* dir, const char* ext) {
getdatestring(thetime,buffer);
char fullpath[13] = {
'/',dir[0],dir[1],dir[2],'/',buffer[6],buffer[7],buffer[8],buffer[9],
Expand Down Expand Up @@ -634,7 +634,7 @@ void getfiles(EthernetClient& client, char* rootstr) {
dir_t d;
file_.dirEntry(&d);
client << F("{\"n\":\"");
file_.getFilename(fn);
file_.getSFN(fn);
client << fn;
client << F("\",\"s\":\"");
if (!file_.isDir())
Expand Down
Binary file added libraries.zip
Binary file not shown.

0 comments on commit f83bea2

Please sign in to comment.