The pentultimate param is a c++ function pointer. When I compile with particle compile for my photon, I get this:
HttpDownload.h:62:128: error: expected ‘,’ or ‘…’ before ‘(’ token
Did the compiler change? Are function pointers no longer supported?
C99/C++11, and with it, function pointers, is still fully supported.
The code that you pasted looks fine. And I can paste this into the WebIDE
class HttpDownloadRequest;
class HttpDownloadResponse;
class HttpDownloadHeader;
void download(HttpDownloadRequest &aRequest, HttpDownloadResponse &aResponse, HttpDownloadHeader headers[], void(*callback)(byte*, int, void*), void* callbackParam);
Which compiles fine. So it would seem the error lies somewhere else. If you can paste a link to the code that I can try I’m happy to help you investigate other possible causes of the error.
The problem above was caused by my code not including application.h and using the “byte” typedef - not required on the core, but needed on the photon, apparently
Now I have problems with PIN_MAP, but there are other threads I need to read through on that. I’m guessing the libraries I’m using aren’t updated yet.
@rsteckler, you are correct regarding the PIN_MAP issue. The upcoming firmware release will include a set of fast IO functions that will replace the “direct” PIN_MAP reference with inline functions. This will also make its way to the new Core firmware released that is planned. So this will allow for a standardized way to do fast IO on any existing and future Particle platforms
BTW - a bit write with the new fast IO code takes about 30 nanoseconds
Hmm. I get this:
Sd2Card.cpp:768:40: error: ‘struct GPIO_TypeDef’ has no member named 'BSRR’
PIN_MAP[mosiPin_].gpio_peripheral->BSRR = PIN_MAP[mosiPin_].gpio_pin; // Data High
Sd2Card.cpp:770:40: error: ‘struct GPIO_TypeDef’ has no member named 'BRR’
PIN_MAP[mosiPin_].gpio_peripheral->BRR = PIN_MAP[mosiPin_].gpio_pin; // Data Low
Sd2Card.cpp:772:40: error: ‘struct GPIO_TypeDef’ has no member named 'BSRR’
PIN_MAP[clockPin_].gpio_peripheral->BSRR = PIN_MAP[clockPin_].gpio_pin; // Clock High
Sd2Card.cpp:778:40: error: ‘struct GPIO_TypeDef’ has no member named 'BRR’
PIN_MAP[clockPin_].gpio_peripheral->BRR = PIN_MAP[clockPin_].gpio_pin; // Clock Low