Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged several contributions on github #2

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Some common rules
#
.*
*.o
*.a
*.s
*.ko
*.so
*.so.dbg
*.i
*.lst
*.symtypes
*.gz
*.bz2
*.lzma
*.xz
*.lz4
*.lzo
*.patch

core
core.*

#
# Backup files
#
*.orig
*~
\#*#

#
# python
#
*.pyc

#
# git files that we don't want to ignore even it they are dot-files
#
!.gitignore

# Some IDE, I don't know which
/.settings
/.cproject
/.project

50 changes: 20 additions & 30 deletions examples/ATS_ClientTest/ATS_ClientTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,34 @@ EthernetClient client;

void setup()
{
int startMemoryUsage;
Ethernet.begin(mac);
startMemoryUsage = ATS_GetFreeMemory();
ATS_begin("Arduino 1.0", "ATS_httpClient Tests");

ATS_PrintTestStatus("1. DCHCP Address obtained", testDHCP());

ATS_ReportMemoryUsage(startMemoryUsage);
ATS_end();

Ethernet.begin(mac);
int startMemoryUsage = ATS_GetFreeMemory();
ATS_begin("Arduino 1.0", "ATS_httpClient Tests");
ATS_PrintTestStatus("1. DCHCP Address obtained", testDHCP());
ATS_ReportMemoryUsage(startMemoryUsage);
ATS_end();
}

//Test if IP DHCP address receieved
boolean testDHCP()
{
Serial.println("testDHCP");

int temp = 0;
IPAddress ip = Ethernet.localIP();
int length = Serial.println(ip);
Serial.println(length);

for (int nn = 0; nn < 4; nn++)
{
temp = temp + ip[nn];
}
if (temp == 0)
{
return false;
}
return true;
Serial.println("testDHCP");

int temp = 0;
IPAddress ip = Ethernet.localIP();
int length = Serial.println(ip);
Serial.println(length);

for (int nn = 0; nn < 4; nn++) {
temp = temp + ip[nn];
}
if (temp == 0) {
return false;
}
return true;
}


void loop()
{


}


86 changes: 32 additions & 54 deletions examples/ATS_Constants/ATS_Constants.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,46 @@
//* Oct 16, 2010 <ROA> Test of Arduino Constants
//************************************************************************

#include <ArduinoTestSuite.h>
#include <ArduinoTestSuite.h>

//************************************************************************
void setup()
{
int startMemoryUsage;

//Start memory usage must be site prior to ATS_begin
startMemoryUsage = ATS_GetFreeMemory();
ATS_begin("Arduino", "Test of Arduino Constants");
/*
* Test Run Start
*/


//test true constant
ATS_PrintTestStatus("1. Test of true constant", true == 1);

//test false consts
ATS_PrintTestStatus( "2. Test of false constant", false == 0);

//Test of HIGH == 1
ATS_PrintTestStatus( "3. Test of HIGH == 1", HIGH == 1);

//Test of LOW == 0
ATS_PrintTestStatus( "4. Test of LOW == 0", LOW == 0);

//Test of INPUT == 1
ATS_PrintTestStatus( "5. Test of INPUT == 1", HIGH == 1);

//Test of OUTPUT == 0
ATS_PrintTestStatus( "6. Test of OUTPUT == 0", LOW == 0);

//test decimal
ATS_PrintTestStatus( "7. Test of decimal constant", 101 == ((1 * pow(10,2)) + (0 * pow(10,1)) + 1));

//test binary
ATS_PrintTestStatus( "8. Test of binary constant", B101 == 5);

//test octal
ATS_PrintTestStatus( "9. Test of octal constant", 0101 == 65);

//test hexadecimal
ATS_PrintTestStatus( "7. Test of hexadecimal constant", (0x101 == 257));

/*
* Test Run End
*/
ATS_ReportMemoryUsage(startMemoryUsage);
ATS_end();

//Start memory usage must be site prior to ATS_begin
int startMemoryUsage = ATS_GetFreeMemory();
ATS_begin("Arduino", "Test of Arduino Constants");
/*
* Test Run Start
*/
//test true constant
ATS_PrintTestStatus("1. Test of true constant", true == 1);
//test false consts
ATS_PrintTestStatus( "2. Test of false constant", false == 0);
//Test of HIGH == 1
ATS_PrintTestStatus( "3. Test of HIGH == 1", HIGH == 1);
//Test of LOW == 0
ATS_PrintTestStatus( "4. Test of LOW == 0", LOW == 0);
//Test of INPUT == 1
ATS_PrintTestStatus( "5. Test of INPUT == 1", HIGH == 1);
//Test of OUTPUT == 0
ATS_PrintTestStatus( "6. Test of OUTPUT == 0", LOW == 0);
//test decimal
ATS_PrintTestStatus( "7. Test of decimal constant", 101 == ((1 * pow(10,2)) + (0 * pow(10,1)) + 1));
//test binary
ATS_PrintTestStatus( "8. Test of binary constant", B101 == 5);
//test octal
ATS_PrintTestStatus( "9. Test of octal constant", 0101 == 65);
//test hexadecimal
ATS_PrintTestStatus( "7. Test of hexadecimal constant", (0x101 == 257));
/*
* Test Run End
*/
ATS_ReportMemoryUsage(startMemoryUsage);
ATS_end();
}


//************************************************************************
void loop()
{


}





85 changes: 28 additions & 57 deletions examples/ATS_Delay/ATS_Delay.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,80 +22,51 @@
//* Oct 28, 2010 <MLS> Started on Delay
//************************************************************************

#include <ArduinoTestSuite.h>
#include <ArduinoTestSuite.h>

//************************************************************************
void setup()
{
short ii;
short testNum;
int startMemoryUsage;
unsigned long startMillis;
unsigned long endMillis;
unsigned long deltaMillis;
unsigned long errMillis;
boolean passed;
char testNameString[80];


startMemoryUsage = ATS_GetFreeMemory();

short ii;
short testNum;
unsigned long startMillis;
unsigned long endMillis;
unsigned long deltaMillis;
unsigned long errMillis;
boolean passed;
char testNameString[80];

int startMemoryUsage = ATS_GetFreeMemory();
ATS_begin("Arduino", "DelayTest");

testNum = 1;
//* we start at 2 because 0/1 are RXD/TXD
for (ii=0; ii<1000; ii+= 15)
{
startMillis = millis();

testNum = 1;
//* we start at 2 because 0/1 are RXD/TXD
for (ii = 0; ii < 1000; ii += 15) {
startMillis = millis();
delay(ii);

endMillis = millis();

deltaMillis = endMillis - startMillis;

if (deltaMillis >= ii)
{
errMillis = deltaMillis - ii;
}
else
{
errMillis = ii - deltaMillis;
}

if (errMillis <= 1)
{
passed = true;
endMillis = millis();
deltaMillis = endMillis - startMillis;
if (deltaMillis >= ii) {
errMillis = deltaMillis - ii;
} else {
errMillis = ii - deltaMillis;
}
else
{
passed = false;
if (errMillis <= 1) {
passed = true;
} else {
passed = false;
}
sprintf(testNameString, "DelayTest.%02d (delay= %4d actual delay=%ld err=%ld)", testNum, ii, deltaMillis, errMillis);

sprintf(testNameString,
"DelayTest.%02d (delay= %4d actual delay=%ld err=%ld)",
testNum, ii, deltaMillis, errMillis);
ATS_PrintTestStatus(testNameString, passed);


testNum++;
}




ATS_ReportMemoryUsage(startMemoryUsage);

ATS_end();

}


//************************************************************************
void loop()
{


}




Loading