直接操作Pn_OUT寄存器会存在读改写(read-modify-write)的问题,当用OUT写port口的时候它先把port的当前状态读回来,根据要写的数据修改读回来的数据,再写到port口,这种操作可能会对该端口的其他pin产生影响。UM中有提到:Note that the bits of Pn_OUT.Px can be individually set/reset by writing appropriate values into the port output modification register Pn_OMR, avoiding read-modify-write operations on the Pn_OUT, which might affect other pins of the port.