Please read the value of PTB directly without modify it as GPIO. You can also confirm it during debug by Port Data Input Register (PDIR).
Hi SZB,
PINS_DRV_ReadPins(PTB);无法返回正确值吗?
根据提示只要该引脚的方向是输入即可获取正确的值。查(Port Data Direction Register (PDDR))寄存器。
当然还要确保PTB口的时钟门是开启的,查PCC PORTB Register (PCC_PORTB)寄存器。
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------