Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't have a sd card module #22

Open
tarbear123 opened this issue Sep 27, 2018 · 6 comments
Open

don't have a sd card module #22

tarbear123 opened this issue Sep 27, 2018 · 6 comments

Comments

@tarbear123
Copy link

i don't have a sd card module, where do i put my gifs in the animated gif's example?

@tarbear123
Copy link
Author

hello?

@jasoncoon
Copy link
Contributor

SD card is required.

@mhungerford
Copy link

Its a tiny amount of work to bake them into the firmware... I do this on my system so I don't need an SD-Card at all. I currently have around 12 gifs I switch between.

I created a MemFile.h that provides FileInfo read/seek/position/size/close/name using gifs converted to arrays using bin2h, so sizeof array and having FileInfo private members a fileaddr pointer, fileoffset count, filesize value. Then use this to create FilenameFunctions.cpp with fileOpenFile, fileSeekCallback, filePositionCallback, fileReadCallback, fileReadBlockCallback, which get provided to the gif decoder using the setFileReadCallback/setFileSeekCallback/etc.

My fileOpenFile takes the array pointer and sizeof(array).

Total its 80 lines of code.

@mhungerford
Copy link

//FilenameFunctions.cpp
#include "MemFile.h"

FileInfo file;

bool fileOpenFile(const char *name, const void *address, uint32_t size) {
file.reload(name, address, size);
}

bool fileSeekCallback(unsigned long position) {
return file.seek(position);
}

unsigned long filePositionCallback(void) {
return file.position();
}

int fileReadCallback(void) {
return file.read();
}

int fileReadBlockCallback(void * buffer, int numberOfBytes) {
return file.read(buffer, numberOfBytes);
}

@tarbear123
Copy link
Author

//FilenameFunctions.cpp
#include "MemFile.h"

FileInfo file;

bool fileOpenFile(const char *name, const void *address, uint32_t size) {
file.reload(name, address, size);
}

bool fileSeekCallback(unsigned long position) {
return file.seek(position);
}

unsigned long filePositionCallback(void) {
return file.position();
}

int fileReadCallback(void) {
return file.read();
}

int fileReadBlockCallback(void * buffer, int numberOfBytes) {
return file.read(buffer, numberOfBytes);
}

screenshot 21

is this how you create a new library in atom and where do you put your GIF's?

@tarbear123
Copy link
Author

hello?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants