GithubHelp home page GithubHelp logo

avr-stl's People

Contributors

andysworkshop avatar felipealmeida avatar gion86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avr-stl's Issues

Red-Black tree iterator increment

The iterator increment method for a Red-Black Tree has an edge case that fails to change the node pointer. If the current node of the iterator is the root and there are no right hand children (and obviously no parent) then the node referenced by the iterator does not change. This means that iterations are effectively halted with the code potentially looping.

I hit the same thing when testing a version I had written and thought I would check the "master version" so to speak.

Issue with the <functional> header.

Hi,
I'm using AVR-STL and I'm having issues with it.

Here is my configuration:

  • AVR-STL 1.1.1
  • Arduino IDE 1.8.5

This code:

#include <functional>

std::function<void()> f;

void setup() {}
void loop() {}

Just a simple use of std::function fails and I get an 'undefined type error' which is decribed by the compiler by:

error: 'function' in namespace 'std' does not name a template type

std::function<void()> f;

 ^

exit status 1
'function' in namespace 'std' does not name a template type

Maybe you could help me with that ?
I can do a pull-request if needed.

I also found that <map> needs <iterator> inclusion before and don't auto-include it.

Thanks by advance.

exit status 1 Error compiling for board Arduino/Genuino Uno

I have just begun using this library and the first thing I tried is, compiling the string example given in this repository. i.e,

 #include <pnew.cpp>
 #include <Arduino.h>
 #include <serstream>
 #include <string>
/*
 * Test std::string
 */

struct TestString {
  static void RunTest() {
    std::ohserialstream serial(Serial);
    std::string str;
    char c;

    for(c='A';c<='Z';c++)
      str+=c;
    serial << str << std::endl;
  }
};
TestString s;

void setup() {
    Serial.begin(115200);
}

void loop() {
    delay(1000);
    s.RunTest();
}

But I am getting the error "Error compiling for board Arduino/Genuino Uno" and the verbose is :

Build options changed, rebuilding all
In file included from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:2:0:

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:20: error: declaration of 'operator new' as non-function

 void* operator new(size_t size_,void *ptr_)

                    ^

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:20: error: 'size_t' was not declared in this scope

e:\arduino-nightly\hardware\tools\avr\avr\include\pnew.cpp:12:33: error: expected primary-expression before 'void'

 void* operator new(size_t size_,void *ptr_)

                                 ^

In file included from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:24:0,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\string:33,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\streambuf:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\serstream:19,

                 from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:5:

e:\arduino-nightly\hardware\tools\avr\avr\include\ostream:281:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'

   class _UCXXEXPORT basic_ostream<charT,traits>::sentry

                                                  ^

In file included from e:\arduino-nightly\hardware\tools\avr\avr\include\string:33:0,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\streambuf:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\istream:22,

                 from e:\arduino-nightly\hardware\tools\avr\avr\include\serstream:19,

                 from C:\Users\Prashant Dandriyal\Documents\Arduino\libraries\first_attempt_vector\first_attempt_vector.ino:5:

e:\arduino-nightly\hardware\tools\avr\avr\include\istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'

  template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {

                                                                                                           ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

arduino-1.8.7 still supported?

I'm trying to just include <vector> for a basic test and I get the following compiler error:

In file included from /opt/arduino-1.8.7/hardware/tools/avr/avr/include/stl_algobase.h:64:0,
                 from /opt/arduino-1.8.7/hardware/tools/avr/avr/include/vector:31,
                 from /tmp/arduino_modified_sketch_766904/sketch_oct20a.ino:1:
/opt/arduino-1.8.7/hardware/tools/avr/avr/include/stl_iterator.h:589:48: error: 'char_traits' does not name a type
           class _CharT = char, class _Traits = char_traits<_CharT>,

Can I have done something wrong? What's the most recent supported version of the Arduino-SDK?

I'm on a Fedora 28 system and tried this with a fresh copy of the arduino-1.8.7 SDK

Serial write issue

Hello,
I'have been using your STL library for a while with Arduino Uno and it works very well.
Now I wanted to help in providing a complete library with examples, and ready to be compiled for Uno with a recent version of avr-gcc, and with the fixes from the comment on the blog post.
I've found a wired behavior in the std::ohserialstream object, when used in the vector example:

for(it=vec.begin();it!=vec.end();it++) serial << *it << std::endl;

the output is only a small part of what is expected.
Also in the blog comments someone else found the same bug. A memory allocation problem could be generating this.

Can you help me with this bug since I'm not really expert with templates? Where should I look for in the library?

Thank you.

I hope the author can set up a License.

Hi friend. I would like to be able to reference your code in the project. But you don't have any license set for this repository. This leaves me unsure if I can cite your work. Can you set a license for this repository? Finally, thank you for the help your article has brought me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.