2015-12-15 17:18:38 +01:00
|
|
|
#define MEMSIZE 4096*120
|
2015-12-13 14:28:06 +01:00
|
|
|
|
|
|
|
#include "../lib/io.h"
|
|
|
|
#include "../lib/collection.h"
|
|
|
|
|
2015-12-16 17:13:34 +01:00
|
|
|
collection s;
|
|
|
|
|
2015-12-13 14:28:06 +01:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
io.run("/sys/develop/board", "");
|
2015-12-16 17:13:34 +01:00
|
|
|
test1();
|
|
|
|
test2();
|
|
|
|
}
|
|
|
|
|
|
|
|
void test1() {
|
2015-12-15 17:18:38 +01:00
|
|
|
s.add("Hello");
|
|
|
|
s.add("World!");
|
2015-12-16 17:13:34 +01:00
|
|
|
debugln(s.get(0)); //-> Hello
|
|
|
|
debugln(s.get(1)); //-> World
|
|
|
|
s.drop();
|
|
|
|
}
|
|
|
|
|
2015-12-16 17:15:37 +01:00
|
|
|
void test2()
|
2015-12-16 17:13:34 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
s.add("0");
|
|
|
|
s.add("1");
|
|
|
|
s.add("2");
|
|
|
|
s.add("3");
|
|
|
|
for (i=0; i<s.count; i++) debugln(s.get(i)); //-> 0 1 2 3
|
|
|
|
s.count--;
|
|
|
|
s.count--;
|
|
|
|
s.add("4");
|
|
|
|
for (i=0; i<s.count; i++) debugln(s.get(i)); //-> 0 1 4
|
2015-12-15 17:18:38 +01:00
|
|
|
s.drop();
|
2015-12-13 14:28:06 +01:00
|
|
|
}
|