Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PY32 support. Tested and working with PY32F002A 24MHZ speed (8MHZ not working) #408

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Adafruit_NeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,7 @@ if(is800KHz) {
// ToDo!
}
#endif
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32)
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32) || defined(_PY32_DEF_)
uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80;
uint32_t cyc;
uint32_t saveLoad = SysTick->LOAD, saveVal = SysTick->VAL;
Expand Down Expand Up @@ -3298,6 +3298,9 @@ void Adafruit_NeoPixel::setPin(int16_t p) {
#if defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32)
gpioPort = digitalPinToPort(p);
gpioPin = STM_LL_GPIO_PIN(digitalPinToPinName(p));
#elif defined(_PY32_DEF_)
gpioPort = digitalPinToPort(p);
gpioPin = PY32_LL_GPIO_PIN(digitalPinToPinName(p));
#elif defined(ARDUINO_ARCH_CH32)
PinName const pin_name = digitalPinToPinName(pin);
gpioPort = get_GPIO_Port(CH_PORT(pin_name));
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_NeoPixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class Adafruit_NeoPixel {
volatile uint8_t *port; ///< Output PORT register
uint8_t pinMask; ///< Output PORT bitmask
#endif
#if defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32) || defined(ARDUINO_ARCH_CH32)
#if defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ARDUINO_CORE_STM32) || defined(ARDUINO_ARCH_CH32) || defined(_PY32_DEF_)
GPIO_TypeDef *gpioPort; ///< Output GPIO PORT
uint32_t gpioPin; ///< Output GPIO PIN
#endif
Expand Down
Loading