好像MCC不能准确生成PORT相应的代码,可以把下面的放到你的代码里试试<div>/*Setup LED0 pin and turn it off*/</div><div>PORTB.DIRSET = PIN3_bm;</div><div>PORTB.OUTSET = PIN3_bm;</div><div><span style="white-space:pre"> </span></div><div>/*Setup SW0*/</div><div>PORTB.DIRCLR = PIN2_bm;</div><div>PORTB.PIN2CTRL = PORT_ISC_FALLING_gc | PORT_PULLUPEN_bm; </div>
|