mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 21:20:11 +00:00
[flash] avoid build when not needed (#5235)
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
#include "common/code_utils.hpp"
|
#include "common/code_utils.hpp"
|
||||||
#include "common/instance.hpp"
|
#include "common/instance.hpp"
|
||||||
|
|
||||||
|
#if OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||||
|
|
||||||
namespace ot {
|
namespace ot {
|
||||||
|
|
||||||
const uint32_t ot::Flash::sSwapActive;
|
const uint32_t ot::Flash::sSwapActive;
|
||||||
@@ -306,3 +308,5 @@ void Flash::Wipe(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ot
|
} // namespace ot
|
||||||
|
|
||||||
|
#endif // OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace ot {
|
|||||||
|
|
||||||
void TestFlash(void)
|
void TestFlash(void)
|
||||||
{
|
{
|
||||||
|
#if OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||||
uint8_t readBuffer[256];
|
uint8_t readBuffer[256];
|
||||||
uint8_t writeBuffer[256];
|
uint8_t writeBuffer[256];
|
||||||
|
|
||||||
@@ -182,6 +183,7 @@ void TestFlash(void)
|
|||||||
VerifyOrQuit(length == key, "Get() did not return expected length");
|
VerifyOrQuit(length == key, "Get() did not return expected length");
|
||||||
VerifyOrQuit(memcmp(readBuffer, writeBuffer, length) == 0, "Get() did not return expected value");
|
VerifyOrQuit(memcmp(readBuffer, writeBuffer, length) == 0, "Get() did not return expected value");
|
||||||
}
|
}
|
||||||
|
#endif // OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ot
|
} // namespace ot
|
||||||
|
|||||||
Reference in New Issue
Block a user