Skip to content

Commit 87c9571

Browse files
committed
TFT GIF decoder enabled
FFat prepared for flash >= 8M
1 parent 1e65ee6 commit 87c9571

File tree

8 files changed

+356
-288
lines changed

8 files changed

+356
-288
lines changed

Content_on_SD_Card.zip

116 KB
Binary file not shown.

dependencies.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ dependencies:
55
type: idf
66
version: 4.4.5
77
manifest_hash: c898fc8385345090dc6162cd32eb12b42f8d9b5d9880156fae8e8f128cd6fd17
8-
target: esp32s3
8+
target: esp32
99
version: 1.0.0

lib/tftLib/src/tft.cpp

Lines changed: 200 additions & 173 deletions
Large diffs are not rendered by default.

miniwebradio16MB.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Name, Type, SubType, Offset, Size, Flags
22
phy_init, data, phy, 0x9000, 0x7000,
33
nvs, data, nvs, 0x10000, 0x40000,
4-
factory, app, factory, 0x50000, 0xF90000,
4+
factory, app, factory, 0x50000, 0x400000,
5+
ffat, data, fat, 0x450000, 0xB90000,
56
coredump, data, coredump, 0xFE0000, 0x10000,

miniwebradio8MB.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Name, Type, SubType, Offset, Size, Flags
22
phy_init, data, phy, 0x9000, 0x7000,
33
nvs, data, nvs, 0x10000, 0x40000,
4-
factory, app, factory, 0x50000, 0x7A0000,
4+
factory, app, factory, 0x50000, 0x400000,
5+
ffat, data, fat, 0x450000, 0x3A0000,
56
coredump, data, coredump, 0x7F0000, 0x10000,
67

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ build_unflags =
3838

3939

4040
[env:esp32s3]
41-
board_build.partitions = miniwebradio4MB.csv ; 4MB Flash
42-
;board_build.partitions = miniwebradio8MB.csv ; 8MB Flash
41+
;board_build.partitions = miniwebradio4MB.csv ; 4MB Flash
42+
board_build.partitions = miniwebradio8MB.csv ; 8MB Flash
4343
;board_build.partitions = miniwebradio16MB.csv ; 16MB Flash
4444

4545
board = esp32-12k ; 4MB Flash, 8MB quad PSRAM

src/common.h

Lines changed: 92 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#define TFT_CONTROLLER 3 // (0)ILI9341, (1)HX8347D, (2)ILI9486a, (3)ILI9486b, (4)ILI9488, (5)ST7796, (6)ST7796RPI
1111
#define DISPLAY_INVERSION 0 // (0) off (1) on
1212
#define TFT_ROTATION 3 // 1 or 3 (landscape)
13-
#define TFT_FREQUENCY 40000000 // 27000000, 40000000, 80000000
13+
#define TFT_FREQUENCY 80000000 // 80000000, 40000000, 27000000, 20000000, 10000000
1414
#define TP_VERSION 3 // (0)ILI9341, (1)ILI9341RPI, (2)HX8347D, (3)ILI9486, (4)ILI9488, (5)ST7796, (3)ST7796RPI
1515
#define TP_ROTATION 3 // 1 or 3 (landscape)
1616
#define AUDIOTASK_CORE 1 // 0 or 1
1717
#define AUDIOTASK_PRIO 2 // 0 ... 24 Priority of the Task (0...configMAX_PRIORITIES -1)
18-
#define SDMMC_FREQUENCY 80000000 // 40000000, 2000000, 10000000, not every SD Card will run at 40MHz
18+
#define SDMMC_FREQUENCY 80000000 // 80000000, 40000000, 27000000, 20000000, 10000000 not every SD Card will run at 80MHz
1919
#define FTP_USERNAME "esp32" // user and pw in FTP Client
2020
#define FTP_PASSWORD "esp32"
2121
#define CONN_TIMEOUT 500 // unencrypted connection timeout in ms (http://...)
@@ -29,6 +29,7 @@
2929
#include <SPI.h>
3030
#include <SD_MMC.h>
3131
#include <FS.h>
32+
#include <FFat.h>
3233
#include <Wire.h>
3334
#include <ESPmDNS.h>
3435
#include <WiFiClient.h>
@@ -142,96 +143,97 @@
142143
/**********************************************************************************************************************/
143144

144145
// //prototypes (main.cpp)
145-
boolean defaultsettings();
146-
boolean saveStationsToNVS();
147-
boolean saveDefaultIRbuttonsToNVS();
148-
void saveIRbuttonsToNVS();
149-
void loadIRbuttonsFromNVS();
150-
void updateSettings();
151-
void urldecode(char *str);
152-
const char* SD_stringifyDirContent(String path);
153-
void setTFTbrightness(uint8_t duty);
154-
void showHeadlineVolume();
155-
void showHeadlineTime(bool complete = true);
156-
void showHeadlineItem(uint8_t idx);
157-
void showFooterIPaddr();
158-
void showFooterStaNr();
159-
void showFooterRSSI(boolean show = false);
160-
void fall_asleep();
161-
void wake_up();
162-
void setRTC(const char* TZString);
163-
void vector_clear_and_shrink(vector<char*>&vec);
164-
void dlna_items_vector_clear_ans_shrink();
165-
void updateSleepTime(boolean noDecrement = false);
166-
void showVolumeBar();
167-
void showBrightnessBar();
168-
void showFooter();
169-
void display_info(const char *str, int32_t xPos, int32_t yPos, uint16_t color, uint16_t margin_l, uint16_t margin_r, uint16_t winWidth, uint16_t winHeight);
170-
void showStreamTitle(const char* streamTitle);
171-
void showVUmeter();
172-
void updateVUmeter();
173-
void showLogoAndStationName();
174-
void showStationName(String sn);
175-
void showStationLogo(String ln);
176-
void showFileLogo(uint8_t state);
177-
void showFileName(const char* fname);
178-
void showFileNumber();
179-
void showStationsList(uint16_t staListNr);
180-
void display_time(boolean showall = false);
181-
void display_alarmDays(uint8_t ad, boolean showall=false);
182-
void display_alarmtime(int8_t xy = 0, int8_t ud = 0, boolean showall = false);
183-
void display_sleeptime(int8_t ud = 0);
184-
boolean drawImage(const char* path, uint16_t posX, uint16_t posY, uint16_t maxWidth = 0 , uint16_t maxHeigth = 0);
185-
bool SD_listDir(const char* path, boolean audioFilesOnly, boolean withoutDirs);
186-
boolean isAudio(File file);
187-
boolean isPlaylist(File file);
188-
bool connectToWiFi();
189-
void openAccessPoint();
190-
const char* byte_to_binary(int8_t x);
191-
uint32_t simpleHash(const char* str);
192-
void trim(char *s);
193-
bool startsWith (const char* base, const char* str);
194-
bool endsWith (const char* base, const char* str);
195-
int32_t indexOf (const char* base, const char* str, int32_t startIndex);
196-
int32_t lastIndexOf(const char* haystack, const char needle);
197-
boolean strCompare(char* str1, char* str2);
198-
boolean strCompare(const char* str1, char* str2);
199-
char* x_ps_strdup(const char* str);
200-
int16_t strlenUTF8(const char* str);
201-
int32_t map_l(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max);
202-
void SerialPrintflnCut(const char* item, const char* color, const char* str);
203-
const char* scaleImage(const char* path);
204-
void setVolume(uint8_t vol);
146+
boolean defaultsettings();
147+
boolean saveStationsToNVS();
148+
boolean saveDefaultIRbuttonsToNVS();
149+
void saveIRbuttonsToNVS();
150+
void loadIRbuttonsFromNVS();
151+
void updateSettings();
152+
void urldecode(char* str);
153+
const char* SD_stringifyDirContent(String path);
154+
void setTFTbrightness(uint8_t duty);
155+
void showHeadlineVolume();
156+
void showHeadlineTime(bool complete = true);
157+
void showHeadlineItem(uint8_t idx);
158+
void showFooterIPaddr();
159+
void showFooterStaNr();
160+
void showFooterRSSI(boolean show = false);
161+
void fall_asleep();
162+
void wake_up();
163+
void setRTC(const char* TZString);
164+
void vector_clear_and_shrink(vector<char*>& vec);
165+
void dlna_items_vector_clear_ans_shrink();
166+
boolean copySDtoFFat(const char* path);
167+
void updateSleepTime(boolean noDecrement = false);
168+
void showVolumeBar();
169+
void showBrightnessBar();
170+
void showFooter();
171+
void display_info(const char* str, int32_t xPos, int32_t yPos, uint16_t color, uint16_t margin_l, uint16_t margin_r, uint16_t winWidth, uint16_t winHeight);
172+
void showStreamTitle(const char* streamTitle);
173+
void showVUmeter();
174+
void updateVUmeter();
175+
void showLogoAndStationName();
176+
void showStationName(String sn);
177+
void showStationLogo(String ln);
178+
void showFileLogo(uint8_t state);
179+
void showFileName(const char* fname);
180+
void showFileNumber();
181+
void showStationsList(uint16_t staListNr);
182+
void display_time(boolean showall = false);
183+
void display_alarmDays(uint8_t ad, boolean showall = false);
184+
void display_alarmtime(int8_t xy = 0, int8_t ud = 0, boolean showall = false);
185+
void display_sleeptime(int8_t ud = 0);
186+
boolean drawImage(const char* path, uint16_t posX, uint16_t posY, uint16_t maxWidth = 0, uint16_t maxHeigth = 0);
187+
bool SD_listDir(const char* path, boolean audioFilesOnly, boolean withoutDirs);
188+
boolean isAudio(File file);
189+
boolean isPlaylist(File file);
190+
bool connectToWiFi();
191+
void openAccessPoint();
192+
const char* byte_to_binary(int8_t x);
193+
uint32_t simpleHash(const char* str);
194+
void trim(char* s);
195+
bool startsWith(const char* base, const char* str);
196+
bool endsWith(const char* base, const char* str);
197+
int32_t indexOf(const char* base, const char* str, int32_t startIndex);
198+
int32_t lastIndexOf(const char* haystack, const char needle);
199+
boolean strCompare(char* str1, char* str2);
200+
boolean strCompare(const char* str1, char* str2);
201+
char* x_ps_strdup(const char* str);
202+
int16_t strlenUTF8(const char* str);
203+
int32_t map_l(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max);
204+
void SerialPrintflnCut(const char* item, const char* color, const char* str);
205+
const char* scaleImage(const char* path);
206+
void setVolume(uint8_t vol);
205207
inline uint8_t getvolume();
206-
uint8_t downvolume();
207-
uint8_t upvolume();
208-
void setStation(uint16_t sta);
209-
void nextStation();
210-
void prevStation();
211-
void StationsItems();
212-
void setStationViaURL(const char* url);
213-
void changeBtn_pressed(uint8_t btnNr);
214-
void changeBtn_released(uint8_t btnNr);
215-
void savefile(const char* fileName, uint32_t contentLength);
216-
String setTone();
217-
String setI2STone();
218-
void SD_playFile(const char* path, uint32_t resumeFilePos = 0, bool showFN = true);
219-
void SD_playFolder(const char* folderPath, bool showFN);
220-
bool SD_rename(const char* src , const char* dest);
221-
bool SD_newFolder(const char* folderPathName);
222-
bool SD_delete(const char* itemPath);
223-
void processPlaylist(boolean first = false);
224-
void changeState(int32_t state);
225-
void connecttohost(const char* host);
226-
void connecttoFS(const char* filename, uint32_t resumeFilePos = 0);
227-
void stopSong();
208+
uint8_t downvolume();
209+
uint8_t upvolume();
210+
void setStation(uint16_t sta);
211+
void nextStation();
212+
void prevStation();
213+
void StationsItems();
214+
void setStationViaURL(const char* url);
215+
void changeBtn_pressed(uint8_t btnNr);
216+
void changeBtn_released(uint8_t btnNr);
217+
void savefile(const char* fileName, uint32_t contentLength);
218+
String setTone();
219+
String setI2STone();
220+
void SD_playFile(const char* path, uint32_t resumeFilePos = 0, bool showFN = true);
221+
void SD_playFolder(const char* folderPath, bool showFN);
222+
bool SD_rename(const char* src, const char* dest);
223+
bool SD_newFolder(const char* folderPathName);
224+
bool SD_delete(const char* itemPath);
225+
void processPlaylist(boolean first = false);
226+
void changeState(int32_t state);
227+
void connecttohost(const char* host);
228+
void connecttoFS(const char* filename, uint32_t resumeFilePos = 0);
229+
void stopSong();
228230
void IRAM_ATTR headphoneDetect();
229-
int32_t DLNA_setCurrentServer(String serverName);
230-
void DLNA_showServer();
231-
void DLNA_browseServer(String objectId, uint8_t level);
232-
void DLNA_getFileItems(String uri);
233-
void DLNA_showContent(String objectId, uint8_t level);
234-
void showDlnaItemsList(uint8_t level, uint16_t itemNr);
231+
int32_t DLNA_setCurrentServer(String serverName);
232+
void DLNA_showServer();
233+
void DLNA_browseServer(String objectId, uint8_t level);
234+
void DLNA_getFileItems(String uri);
235+
void DLNA_showContent(String objectId, uint8_t level);
236+
void showDlnaItemsList(uint8_t level, uint16_t itemNr);
235237

236238
//prototypes (audiotask.cpp)
237239
void audioInit();

0 commit comments

Comments
 (0)