![](/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:
- sakthipriya
- Date:
- 2015-06-16
- Revision:
- 3:0c3f7c3fabc9
- Parent:
- 2:4c79b3dfef31
- Child:
- 7:c270a9e37290
File content as of revision 3:0c3f7c3fabc9:
#include "mbed.h" #include "func_head.h" Serial sr(USBTX,USBRX); SPISlave pl_spi(PTE18, PTE19, PTE17, PTE16 ); // mosi, miso, sclk, ssel --> using SPI1 //SPISlave pl_spi(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_spi.receive()); // blocking statement --> waiting for data from Payload uint8_t v = pl_spi.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"); }