Skip to content

Allow external PWM motor channels without native GPIO - #81

Open
dhairyajangir wants to merge 1 commit into
adafruit:mainfrom
dhairyajangir:fix/optional-pwm-and-gpio-imports
Open

dhairyajangir wants to merge 1 commit into
adafruit:mainfrom
dhairyajangir:fix/optional-pwm-and-gpio-imports

Conversation

@dhairyajangir

Copy link
Copy Markdown

Summary

Use the existing PWM typing fallback when Blinka reports that a board's optional PWM backend is missing. Let the stepper import when only the optional GPIO type is unavailable. Native type hints still resolve when the backends are available, and unrelated runtime errors still propagate.

Thanks to CameronBrooks11 for the forced-board reproduction and fallback diagnosis in #80.

Verification

Tested forced Raspberry Pi 4 and Pi 5 with Blinka 9.2.0 and 10.1.0. The patched driver passed DC motor, servo, and both stepper pin-mode checks against mock pins on all four configurations. Also verified native annotation resolution and the unsupported-PWM and unexpected-error paths.

With adafruit/Adafruit_CircuitPython_BusDevice#105 applied, the same four configurations also drove the DC motor and servo through the actual PCA9685 Python driver on a simulated I²C bus.

Fixes #80.

AI assistance was used for the patch and verification.

@dhairyajangir

Copy link
Copy Markdown
Author

Build CI passes on 5f9aee98. Could a maintainer review this optional-backend import fix for #80 and let me know if anything remains before landing? The description records the Pi 4/Pi 5 and Blinka 9.2/10.1 mock-pin checks, native annotation checks and error-path controls. The PCA9685 simulated-I2C checks also used the related BusDevice #105 patch. I can address review feedback.

AI assisted with the review and this update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

motor, servo and stepper can't be imported on a Pi without Blinka's GPIO/PWM libraries

1 participant