заменила часть функций на макросы из wiring_LL.h

This commit is contained in:
klassents committed 2024-10-10 19:14:24 +07:00
1 parent d1a5896d2d
commit d7010fba6e
5 files changed
+53 -22

No files matched your search

@@ -198,10 +198,15 @@ void SoftwareSerial::setRX(uint8_t rx)
// attach interrupt to rx pin if available
attachInterrupt(digitalPinToInterrupt(_receivePin), softSerial_handler_wrapper, _inverse_logic ? RISING : FALLING);
// turn on pull up for rx if logic is not inverse
if (!_inverse_logic)
// turn on pull up for rx if logic is not inverse
HAL_GPIO_PinConfig((GPIO_TypeDef *)_receivePortRegister, (HAL_PinsTypeDef)_receiveBitMask,
HAL_GPIO_MODE_GPIO_INPUT, HAL_GPIO_PULL_UP, HAL_GPIO_DS_2MA);
{
uint8_t pinNumber = PIN_MASK_TO_PIN_NUMBER(_receiveBitMask);
if (((GPIO_TypeDef*)_receivePortRegister) == GPIO_0)
PIN_SET_PAD_CONFIG(PORT_0_PUPD, pinNumber, HAL_GPIO_PULL_UP);
else if (((GPIO_TypeDef*)_receivePortRegister) == GPIO_1)
PIN_SET_PAD_CONFIG(PORT_1_PUPD, pinNumber, HAL_GPIO_PULL_UP);
}
// turn off int line for while (it turning on in attachInterrupt())
GPIO_IRQ_LINE_DISABLE(_int_maskLine);
}