__FLASH__
キーワード__FLASH__ キーワードは変数修飾子です。
指定した変数をフラッシュメモリに格納するために指定します。
このキーワードは古い(ベースのmaipleでの記述形式)です。かわりのconstを使って下さい。
__FLASH__の利用例
code:cpp
uint32 array[] __FLASH__ = {0, 1, 2};
新しい記述方法
code:cpp
const uint32 array[] = {0, 1, 2};
補足説明
__FLASH__ キーワードは変数修飾子 __attr_flash のエリアスです。wirish_types.hに定義されています。
wirish_types.h内の定義
code:wirish_types.h
#define __FLASH__ __attr_flash
さらに、 __attr_flashは、libmaple/libmaple_types.h次のように定義されています。
code:libmaple/libmaple_types.h
#define __attr_flash __attribute__((section (".USER_FLASH")))
関連項目
const
__attr flash
License and Attribution: Portions of this page were adapted from the Arduino Reference Documentation, which is released under a Creative Commons Attribution-ShareAlike 3.0 License.
このドキュメントはleafLabs, LLC.が執筆し、たま吉が翻訳・一部加筆修正したものです。
Arduino STM32 リファレンス 日本語版 に戻る