1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

host emulation: improve udp, persistent spiffs (#5605)

This commit is contained in:
david gauchard
2019-01-15 22:56:54 +01:00
committed by GitHub
parent 8a64a1236f
commit 6bd26a3b4a
16 changed files with 266 additions and 142 deletions

View File

@ -25,7 +25,7 @@
class SpiffsMock {
public:
SpiffsMock(size_t fs_size, size_t fs_block, size_t fs_page, bool storage = true);
SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
void reset();
~SpiffsMock();
@ -33,21 +33,12 @@ protected:
void load ();
void save ();
// it was a vector, but CI tests & valgrind complain with:
// Syscall param write(buf) points to uninitialised byte(s)
// by 0x43E9FF: SpiffsMock::save() (spiffs_mock.cpp:116)
// = if (::write(fs, &m_fs[0], m_fs_size) != (ssize_t)m_fs_size)
// so switched to a regular array
// and that bug is still here
// XXXWIPTODO
uint8_t* m_fs;
size_t m_fs_size;
bool m_storage;
std::vector<uint8_t> m_fs;
String m_storage;
bool m_overwrite;
};
#define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
#define SPIFFS_MOCK_RESET() spiffs_mock.reset()
#endif /* spiffs_mock_hpp */