I've found the problem, and a solution!
Turns out this little guy was at fault, in
ccspi.cpp
Code: Select all
void WlanInterruptEnable()
{
DEBUGPRINT_F("\tCC3000: WlanInterruptEnable.\n\r");
delay(100);
attachInterrupt(g_IRQnum, SPI_IRQ, FALLING);
}
Not surprisingly, that delay(100) is quite limiting. I figure the delay is probably there for a reason so I tested slowly reducing this delay, right down to 1ms. It had no negative impact whatsoever.
Code: Select all
void WlanInterruptEnable()
{
DEBUGPRINT_F("\tCC3000: WlanInterruptEnable.\n\r");
delay(1); // 100x faster!
attachInterrupt(g_IRQnum, SPI_IRQ, FALLING);
}
Oh, and I can now transmit nearly 1,000 packets per second.
I'd happily submit this to the repository but I'm hesitant as I don't really know what I've altered. I believe the delay was there due to packets potentially coming in at the same time, and somehow this helps fix a problem because of that. 100ms seems a bit of an insane amount of time to wait though.
By the way, this won't just help with transmitting packets at higher rates. Every SPI command uses this method so all of them had the 100ms delay. Not any more!