Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions drivers/FlashIAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
#include "platform/NonCopyable.h"
#include <algorithm>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be a bit of an overkill for 'max' - consider using a small macro/inline instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would agree if it was only used in the header file. However, as it is also used in the FlashIAP implementation, and assuming anyone that includes the header file would also use the FlashIAP class, then it shouldn't add any extra code.


// Export ROM end address
#if defined(TOOLCHAIN_GCC_ARM)
extern uint32_t __etext;
#define FLASHIAP_ROM_END ((uint32_t) &__etext)
#elif defined(TOOLCHAIN_ARM)
extern uint32_t Load$$LR$$LR_IROM1$$Limit[];
#define FLASHIAP_ROM_END ((uint32_t)Load$$LR$$LR_IROM1$$Limit)
#elif defined(TOOLCHAIN_IAR)
#pragma section=".rodata"
#pragma section=".text"
#define FLASHIAP_ROM_END (std::max((uint32_t) __section_end(".rodata"), (uint32_t) __section_end(".text")))
#endif

namespace mbed {

Expand Down