Coder Social home page Coder Social logo

flash's People

Contributors

mikalhart avatar mikalhart-intel 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

Watchers

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

flash's Issues

Compiling Basic Example emits warnings

I downloaded Flash-5.tar.gz and installed it in the Arduino libraries folder (C:\Users...me...\Documents\Arduino\libraries on my machine).
I then started Arduino and opened the Flash Basic example and compiled it for a Adafruit Trinket Pro (an avr board). I got several "comparison between signed and unsigned" warnings which I fixed (changed "for (int i...." to "for (size_t i....").

I also got two "dereferencing type-punned pointer will break strict-aliasing rules ..." warnings which I don't know how to fix.

I ran the result and it seemed to work.

I am using Arduino 1.8.5

Not compatible with v>1.5.0

I found this after a while without working on a project that included this library.
There are 2 pull requests that actually solve the problem. I forked from them and included as submodule of my project, and everything goes well (that's a good test).

Any plan of accepting those Pull Requests?

unmatched types in ternary operator

Hello, when I attempt to compile this in the current (1.0.5r2) Arduino (one caveat is that I'm using Teensy3.1, which is an ARM versus an AVR), I get the following error:

C:\Users\X\Arduino\libraries\Flash/Flash.h:78:37: error: operands to ?: have different types 'char*' and 'int'

Coming from this line in Flash.h:

  [code]char *copy(char *to, size_t size = -1, size_t offset = 0) const 
  { 
    return size == -1 ?
      strcpy_P(to, _arr + offset) : strncpy_P(to, _arr + offset, size);
  }[code]

I rejiggered this to:

  [code]void *copy(char *to, size_t size = -1, size_t offset = 0) const 
  { 
    if (size == -1) strcpy_P(to, _arr + offset);
    else (strncpy_P(to, _arr + offset, size));
  }[code]

And the library appears to work... strcpy() and strncpy() are of different types so something should be tweaked. I tried coercing one to int and the other to char* but failed. Does this seem OK to you?

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.