v0.5.0 #19

Merged
klassents merged 310 commits from v0.5.0 into main 2025-04-28 07:06:11 +03:00
Showing only changes of commit c23cd3e06d - Show all commits

View File

@ -94,17 +94,13 @@ uint32_t analogInputToChannelNumber(uint32_t PinNumber)
// ---------------------- PWM ---------------------- //
// use only if digitalPinHasPWM() == true
#define PWM_PIN_TO_PORT_NUMBER(pin) (((pin) & 16) ? 1 : 0)
// use only if digitalPinHasPWM() == true
static inline uint8_t pwmPinToGpioPinShift(uint8_t digitalPin)
{
return digitalPin & 3;
}
// use only if digitalPinHasPWM() == true
// return true if digitalPin configured as pwm
bool digitalPinPwmIsOn(uint8_t digitalPin)
{
uint8_t config = 0;
uint8_t pinShift = pwmPinToGpioPinShift(digitalPin);
uint8_t pinShift = digitalPin & 3;
if (PWM_PIN_TO_PORT_NUMBER(digitalPin) == 0)
config = PIN_GET_PAD_CONFIG(PORT_0_CFG, pinShift);