mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 18:26:30 +00:00
update to ufilesystem
This commit is contained in:
parent
0af9a948ee
commit
b8ce02c0ad
20
tasmota/xdrv_13_display.ino
Normal file → Executable file
20
tasmota/xdrv_13_display.ino
Normal file → Executable file
@ -497,7 +497,7 @@ void DisplayText(void)
|
||||
cp += var;
|
||||
linebuf[fill] = 0;
|
||||
break;
|
||||
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
case 'P':
|
||||
{ char *ep=strchr(cp,':');
|
||||
if (ep) {
|
||||
@ -682,7 +682,7 @@ void DisplayText(void)
|
||||
RedrawGraph(temp,temp1);
|
||||
break;
|
||||
}
|
||||
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
if (*cp=='s') {
|
||||
cp++;
|
||||
var=atoiv(cp,&temp);
|
||||
@ -1569,8 +1569,8 @@ char get_jpeg_size(unsigned char* data, unsigned int data_size, unsigned short *
|
||||
#endif // JPEG_PICTS
|
||||
#endif // ESP32
|
||||
|
||||
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT) && defined(USE_DISPLAY)
|
||||
extern FS *fsp;
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
extern FS *ufsp;
|
||||
#define XBUFF_LEN 128
|
||||
void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) {
|
||||
if (!renderer) return;
|
||||
@ -1586,7 +1586,7 @@ void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) {
|
||||
|
||||
if (!strcmp(estr,"rgb")) {
|
||||
// special rgb format
|
||||
fp=fsp->open(file,FILE_READ);
|
||||
fp=ufsp->open(file,FS_FILE_READ);
|
||||
if (!fp) return;
|
||||
uint16_t xsize;
|
||||
fp.read((uint8_t*)&xsize,2);
|
||||
@ -1621,7 +1621,7 @@ void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) {
|
||||
// jpeg files on ESP32 with more memory
|
||||
#ifdef ESP32
|
||||
#ifdef JPEG_PICTS
|
||||
fp=fsp->open(file,FILE_READ);
|
||||
fp=ufsp->open(file,FS_FILE_READ);
|
||||
if (!fp) return;
|
||||
uint32_t size = fp.size();
|
||||
uint8_t *mem = (uint8_t *)special_malloc(size+4);
|
||||
@ -1914,7 +1914,7 @@ void DisplayCheckGraph() {
|
||||
}
|
||||
|
||||
|
||||
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
#ifdef ESP32
|
||||
#include <SD.h>
|
||||
#endif
|
||||
@ -1925,8 +1925,8 @@ void Save_graph(uint8_t num, char *path) {
|
||||
struct GRAPH *gp=graph[index];
|
||||
if (!gp) return;
|
||||
File fp;
|
||||
fsp->remove(path);
|
||||
fp=fsp->open(path,FILE_WRITE);
|
||||
ufsp->remove(path);
|
||||
fp=ufsp->open(path,FS_FILE_WRITE);
|
||||
if (!fp) return;
|
||||
char str[32];
|
||||
sprintf_P(str,PSTR("%d\t%d\t%d\t"),gp->xcnt,gp->xs,gp->ys);
|
||||
@ -1951,7 +1951,7 @@ void Restore_graph(uint8_t num, char *path) {
|
||||
struct GRAPH *gp=graph[index];
|
||||
if (!gp) return;
|
||||
File fp;
|
||||
fp=fsp->open(path,FILE_READ);
|
||||
fp=ufsp->open(path,FS_FILE_READ);
|
||||
if (!fp) return;
|
||||
char vbuff[32];
|
||||
char *cp=vbuff;
|
||||
|
@ -69,6 +69,8 @@ AudioGeneratorMP3 *decoder = NULL;
|
||||
void *mp3ram = NULL;
|
||||
|
||||
|
||||
extern FS *ufsp;
|
||||
|
||||
#ifdef ESP8266
|
||||
const int preallocateBufferSize = 5*1024;
|
||||
const int preallocateCodecSize = 29192; // MP3 codec max mem needed
|
||||
@ -391,7 +393,7 @@ static const uint8_t wavHTemplate[] PROGMEM = { // Hardcoded simple WAV header w
|
||||
0x64, 0x61, 0x74, 0x61, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
bool SaveWav(char *path, uint8_t *buff, uint32_t size) {
|
||||
File fwp = fsp->open(path, FILE_WRITE);
|
||||
File fwp = ufsp->open(path, FILE_WRITE);
|
||||
uint8_t wavHeader[sizeof(wavHTemplate)];
|
||||
memcpy_P(wavHeader, wavHTemplate, sizeof(wavHTemplate));
|
||||
|
||||
@ -552,7 +554,7 @@ void I2S_WR_Show(void) {
|
||||
|
||||
#ifdef ESP32
|
||||
void Play_mp3(const char *path) {
|
||||
#if defined(USE_SCRIPT) && defined(USE_SCRIPT_FATFS)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
if (decoder || mp3) return;
|
||||
if (!out) return;
|
||||
|
||||
@ -566,7 +568,7 @@ void Play_mp3(const char *path) {
|
||||
I2S_Task = false;
|
||||
}
|
||||
|
||||
file = new AudioFileSourceFS(*fsp,path);
|
||||
file = new AudioFileSourceFS(*ufsp,path);
|
||||
id3 = new AudioFileSourceID3(file);
|
||||
|
||||
if (mp3ram) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user