Code: Select all
cRPY_16bit[0] = 128;
cRPY_16bit[1] = 128;
cRPY_16bit[2] = 128;
cRPY_16bit[3] = 128;
cRPY_16bit[4] = 128;
spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
spiStart(&SPID2, &ls_spicfg); /* Setup transfer parameters. */
spiSelect(&SPID2); /* Slave Select assertion. */
spiExchange(&SPID2,10,cRPY_16bit,rxbuf_16bit); /* Atomic transfer operations. */
spiUnselect(&SPID2); /* Slave Select de-assertion. */
spiReleaseBus(&SPID2); /* Ownership release. */
Watching the SPI Line with an oscilloscope I see the traffic IF the code above is compiled INSIDE an external thread, conversely it doesn't work IF the code is compiled in the MAIN THREAD (main function).
All the variable used are in the global scope.
Any ideas? Maybe it's a stupid things... in this case SORRY IN ADVANCE!