Reverse the port logic