Does the pointer operation for PxOUT work correctly?
volatile
この質問に関して Jens-Michael Grossさんの回答で以下(volatile)が資料を読んでも気づかなかった点だった。
the original PxOUT register was a volatile unsigned char 'variable'
異なるMSP430でのピン使用
また、異なるMSP430で同じピンの変数(か同等の機構)を使うにはどうすればいいかという質問をしている。
それに対する回答として Jens-Michael Grossさんの回答が参考になる
Most projects use a project-specific definition header file. With project-specific defines:
#define LEDPORT_OUT P1OUT
The code then uses LEDPORT_OUT instead of the specific P1OUT.
This won't work for precompiled libraries, but leads to way more efficient code.