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

Add support for SD card e.g. Sunton 7" #722

Open
Martinson50 opened this issue May 12, 2024 · 5 comments
Open

Add support for SD card e.g. Sunton 7" #722

Martinson50 opened this issue May 12, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Martinson50
Copy link

I have a board with SD card so I hacked this repository locally to add the SDCard as a source of images.
I dont feel to much comfortable to pull a request but to send the changed code in 3 main files:
seems to work without issues when you add src object with Z:/image.png

/src/main.cpp:
#if HASP_USE_SDCARD > 0
sdcardSetup();
#endif

/src/hasp_filesystem.cpp:
bool sdcardSetup(void)

/src/hasp/hasp_attribute.cpp
static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* payload, char** text, bool update)
....
} else if (payload == strstr_P(payload, PSTR("Z:"))) {
char tempsrcf[64] = "";
strncpy(tempsrcf , payload + 2, sizeof(tempsrcf));
int readf = 0;
File file;
file = HASP_SD_FS.open(tempsrcf, "r");
.....

If anyone it's interested in this funcionality I can send the rest of the code or give more info.

@Martinson50 Martinson50 added the enhancement New feature or request label May 12, 2024
@Martinson50
Copy link
Author

By the way audio and i2c sensors added in custom code as proof of concept able to reproduce MP3 SDCard files in this sunton-8048s070c_16MB

@fvanroie
Copy link
Collaborator

This is very interesting indeed. Please share your code in a fork or PR. It is hard to follow when the code is incomplete.
Ideally, all files should be able to use the SD card, like fonts, jsonl, etc...

@darkman7hr
Copy link

+1

@fvanroie
Copy link
Collaborator

I found your fork at https://github.com/Martinson50/openHASP

Make sure not to touch code outside of the scope, or it can not be merged (like QR_CODE).
In any case it is very interesting to see the progress.

@fvanroie
Copy link
Collaborator

fvanroie commented May 23, 2024

I think we need to lay the groundwork for broader support across multiple boards and future proof solution.
Please also join this thread about SD card support #741 and file handling.

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

No branches or pull requests

3 participants