My code will compile on the particle-cli but not on the web IDE. The error is that a function was not declared in this scope. The function is “defined” at the top of the file with the macros created to deal with the PIN_MAP issue. Any idea why it wouldn’t work in the web IDE? Here’s the code that seems to be affecting this:
#if defined(PLATFORM_ID) //Only defined if a Particle device
#include "application.h"
STM32_Pin_Info* PIN_MAP = HAL_Pin_Map(); // Pointer required for highest access speed
#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
#define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRRH = PIN_MAP[_pin].gpio_pin)
#define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRRL = PIN_MAP[_pin].gpio_pin)
#else
#error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core or Photon ***"
#endif
#endif
/********************************** low level pin interface */
inline void Adafruit_SSD1351::spiwrite(uint8_t c) {
//Serial.println(c, HEX);
if (!_sid) {
SPI.transfer(c);
// might be able to make this even faster but
// a delay -is- required
//delayMicroseconds(1);
return;
}
//Software SPI, MSB first
for (uint8_t bit = 0; bit < 8; bit++) {
pinLO(_sclk); // PIN_MAP[_sclk].gpio_peripheral->BRR = PIN_MAP[_sclk].gpio_pin; // Clock Low
if (c & (1 << (7-bit))) // walk down mask from bit 7 to bit 0
pinHI(_sid); // PIN_MAP[_sid].gpio_peripheral->BSRR = PIN_MAP[_sid].gpio_pin; // Data High
else
pinLO(_sid); // PIN_MAP[_sid].gpio_peripheral->BRR = PIN_MAP[_sid].gpio_pin; // Data Low
pinHI(_sclk); // PIN_MAP[_sclk].gpio_peripheral->BSRR = PIN_MAP[_sclk].gpio_pin; // Clock High
}
}
The errors are that pinLO and pinHI are not declared in this scope. But it works fine in the cli. Any ideas??