feat: add SDCardManager rename method and EInkDisplay improvements
- Add rename() method to SDCardManager for file/directory moves - Improve EInkDisplay grayscale handling
This commit is contained in:
parent
bd4e670750
commit
dede09001c
@ -399,11 +399,21 @@ void EInkDisplay::copyGrayscaleBuffers(const uint8_t* lsbBuffer, const uint8_t*
|
||||
#ifdef EINK_DISPLAY_SINGLE_BUFFER_MODE
|
||||
/**
|
||||
* In single buffer mode, this should be called with the previously written BW buffer
|
||||
* to reconstruct the RED buffer for proper differential fast refreshes following a
|
||||
* grayscale display.
|
||||
* to restore proper BW state after a grayscale display.
|
||||
*
|
||||
* The approach: Don't call grayscaleRevert() at all. Instead, just sync the RAMs with
|
||||
* BW data and clear the grayscale mode flag. The physical pixels will stay in their
|
||||
* current grayscale states, but subsequent refreshes will naturally transition them
|
||||
* as the new BW content is displayed.
|
||||
*/
|
||||
void EInkDisplay::cleanupGrayscaleBuffers(const uint8_t* bwBuffer) {
|
||||
// Clear grayscale mode - we don't want grayscaleRevert to be called later
|
||||
// because the RAMs won't have valid grayscale data anymore
|
||||
inGrayscaleMode = false;
|
||||
|
||||
// Sync both RAMs with BW content for proper fast refresh behavior
|
||||
setRamArea(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
||||
writeRamBuffer(CMD_WRITE_RAM_BW, bwBuffer, BUFFER_SIZE);
|
||||
writeRamBuffer(CMD_WRITE_RAM_RED, bwBuffer, BUFFER_SIZE);
|
||||
}
|
||||
#endif
|
||||
@ -416,8 +426,7 @@ void EInkDisplay::displayBuffer(RefreshMode mode) {
|
||||
|
||||
// If currently in grayscale mode, revert first to black/white
|
||||
if (inGrayscaleMode) {
|
||||
inGrayscaleMode = false;
|
||||
grayscaleRevert();
|
||||
grayscaleRevert(); // grayscaleRevert() sets inGrayscaleMode = false internally
|
||||
}
|
||||
|
||||
// Set up full screen RAM area
|
||||
@ -477,8 +486,7 @@ void EInkDisplay::displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
|
||||
|
||||
// displayWindow is not supported while the rest of the screen has grayscale content, revert it
|
||||
if (inGrayscaleMode) {
|
||||
inGrayscaleMode = false;
|
||||
grayscaleRevert();
|
||||
grayscaleRevert(); // grayscaleRevert() sets inGrayscaleMode = false internally
|
||||
}
|
||||
|
||||
// Calculate window buffer size
|
||||
|
||||
@ -29,6 +29,7 @@ class SDCardManager {
|
||||
bool exists(const char* path) { return sd.exists(path); }
|
||||
bool remove(const char* path) { return sd.remove(path); }
|
||||
bool rmdir(const char* path) { return sd.rmdir(path); }
|
||||
bool rename(const char* oldPath, const char* newPath) { return sd.rename(oldPath, newPath); }
|
||||
|
||||
bool openFileForRead(const char* moduleName, const char* path, FsFile& file);
|
||||
bool openFileForRead(const char* moduleName, const std::string& path, FsFile& file);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user