Hi folks!
We’re really excited to release v0.4.4, but we’ve also noticed that it can cause a couple of issues with libraries (and code more broadly). The known problems are using PIN_MAP
and #include “pinmap_impl.h"
- both primarily used when adding Photon compatibility with Core code in things that use very low-level calls. You can fix the compile error and retain functionality by replacing PIN_MAP
with PIN_MAP2
to eliminate a name collision and remove #include “pinmap_impl.h"
Here’s an example of fixed code from Neopixel that also allows different behaviors on Cores and Photons:
#if PLATFORM_ID == 0 // Core
#define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
#define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
#elif PLATFORM_ID == 6 // Photon
//#include "pinmap_impl.h"
STM32_Pin_Info* PIN_MAP2 = HAL_Pin_Map(); // Pointer required for highest access speed
#define pinLO(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRH = PIN_MAP2[_pin].gpio_pin)
#define pinHI(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRL = PIN_MAP2[_pin].gpio_pin)
#else
#error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core or Photon ***"
#endif
// fast pin access
#define pinSet(_pin, _hilo) (_hilo ? pinHI(_pin) : pinLO(_pin))
The Neopixel, InternetButton, and deprecated SparkButton libraries have been fixed and the changes pushed out to the already in-use instances of those libraries. If you find other code or libraries that used to work but were broken by the update, post them here!