Hello,
My code is as below. In my code I am not able to receive data from by slave device. My code is as below
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "Pins1.h"
#include "SM1.h"
#include "SS1.h"
/* Including shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "PDD_Includes.h"
#include "Init_Config.h"
/* User includes (#include below this line is not maintained by Processor Expert) */
#include "stdio.h"
#include <string.h>
/* Global Variables */
#define DATA_SIZE 2
#define DATA_SIZ 2
#define BLOCK_SIZE 13
volatile bool SlaveReceivedFlg = FALSE;
volatile bool MasterReceivedFlg = FALSE;
int master_send[20] = {0,0,0,0,0,0,0,0,0,0,0,9,8,7,6,5,4,3,2,1};
int slave_send[1] = ;
int master_receive[20] ;
int slave_receive[1] = ;
uint8_t OutData[BLOCK_SIZE] = {0,1,2,3,4,5,6,7,8};
uint8_t InpData[BLOCK_SIZE];
/* User includes (#include below this line is not maintained by Processor Expert) */
/*lint -save -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
uint32 i = 0;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
SM1_Init(SM1_DeviceData);
for(;;){
SM1_SendBlock(SM1_DeviceData, master_send, DATA_SIZE);
SM1_ReceiveBlock(SM1_DeviceData, master_receive, DATA_SIZ);
MasterReceivedFlg = FALSE;
/// while(!MasterReceivedFlg);
SM1_SendBlock(SM1_DeviceData, master_send, DATA_SIZE);
SM1_ReceiveBlock(SM1_DeviceData, master_receive, DATA_SIZE);
MasterReceivedFlg = FALSE;
while(!MasterReceivedFlg);
for(i=0;i<10000000;i++){} //Delay
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!