Prevent pin glitches on out commutation (#16835)

Better for switching from pulled input to output and also set real output (with no input enabled).
This commit is contained in:
Giuliano Zaro 2020-02-11 17:43:28 +01:00 committed by GitHub
parent 0fd0554b5f
commit 4a733796bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,8 +88,8 @@
const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ const EPortType port = (EPortType)GET_SAMD_PORT(IO); \
const uint32_t pin = GET_SAMD_PIN(IO); \ const uint32_t pin = GET_SAMD_PIN(IO); \
\ \
PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \
PORT->Group[port].DIRSET.reg = MASK(pin); \ PORT->Group[port].DIRSET.reg = MASK(pin); \
PORT->Group[port].PINCFG[pin].reg = 0; \
}while(0) }while(0)
// Set pin as output (open drain) // Set pin as output (open drain)
#define SET_OUTPUT_OD(IO) do{ \ #define SET_OUTPUT_OD(IO) do{ \