Merge remote-tracking branch 'origin/development'

This commit is contained in:
John Wellbelove 2016-03-06 12:49:40 +00:00
commit cc459381a6
9 changed files with 25 additions and 27 deletions

BIN
etl.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
etl.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 20 KiB

BIN
etl.xar Normal file

Binary file not shown.

BIN
etl16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
etl32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
etl48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -7,6 +7,7 @@
#include <etl_arduino.h> // Contains platform macros for Arduino.
#include <list.h>
#include <container.h>
void setup()
{
@ -14,43 +15,40 @@ void setup()
pinMode(13, OUTPUT);
}
void iterate(const etl::ilist<int>& delays)
{
etl::ilist<int>::const_iterator itr;
// Iterate through the list.
itr = delays.begin();
while (itr != delays.end())
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(*itr++); // wait
}
}
void loop()
{
int delay_times1[] = { 900, 800, 700, 600, 500, 400, 300, 200, 100 };
int delay_times2[] = { 400, 300, 200, 100 };
// Fill the first delay list, then reverse it.
etl::list<int, 10> delays1(etl::begin(delay_times1), etl::end(delay_times1));
// Notice how we don't have to know the size of the array!
const size_t size1 = sizeof(etl::array_size(delay_times1));
etl::list<int, size1> delays1(etl::begin(delay_times1), etl::end(delay_times1));
delays1.reverse();
// Fill the second delay list,
etl::list<int, 4> delays2(etl::begin(delay_times2), etl::end(delay_times2));
const size_t size2 = sizeof(etl::array_size(delay_times2));
etl::list<int, size2> delays2(etl::begin(delay_times2), etl::end(delay_times2));
while (true)
{
// Common iterator for both lists;
etl::ilist<int>::const_iterator itr;
// Iterate through the first list.
itr = delays1.begin();
while (itr != delays1.end())
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(*itr++); // wait
}
// Iterate through the second list.
itr = delays2.begin();
while (itr != delays2.end())
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(*itr++); // wait
}
iterate(delays1);
iterate(delays2);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -193,7 +193,7 @@ namespace etl
//*********************************************************************
void resize(size_t new_size)
{
//ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full));
ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full));
// Size up or size down?
if (new_size > current_size)