![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
vr1.1
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of CDMS_RTOS_v1_1 by
science.cpp
- Committer:
- cholletisaik777
- Date:
- 2015-06-15
- Revision:
- 0:d6e3d1e21484
- Child:
- 2:4c79b3dfef31
File content as of revision 0:d6e3d1e21484:
#include "mbed.h" #include "func_head.h" Serial sr(USBTX,USBRX); SPISlave pl_spi2(PTD6, PTD7, PTD5,PTD4 ); // mosi, miso, sclk, ssel --> using SPI1 int payloadBins = 4; void FUNC_PL_RCV_SC_DATA() { sr.printf("in FUNC_PL_RCV_SC_DATA\r\n"); uint8_t scienceRawPacket[payloadBins]; for(int i=0; i<payloadBins;i++) { while(!pl_spi2.receive()); // blocking statement --> waiting for data from Payload uint8_t v = pl_spi2.read(); // Read byte from master scienceRawPacket[i] = v; } // serial feedback sr.printf("Packet recieved\r\r\n"); for(int i=0;i<payloadBins;i++) { sr.printf("%0x\t",scienceRawPacket[i]); scienceRawPacket[i] = 0; } sr.printf("\r\r\n"); }