mikalhart / flash Goto Github PK
View Code? Open in Web Editor NEWAn Arduino library for smoother, easier access to Flash data.
An Arduino library for smoother, easier access to Flash data.
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
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?
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?
This would give more visibility to your fantastic job.
See: https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.