AnsweredAssumed Answered

How to correct my code in case of an abnormal branch

Question asked by kim.andy.002 on Jan 19, 2018
Latest reply on Jan 19, 2018 by Andrew Neil

Hi.

 

The below function is called by a few events.

 

int sendDeviceEvent(int idx, char type){
 int result;
 char *buff;

 if(type == TYPE_REG)
 {
 makeRegInfo(idx,buff);
 sendInfoToSlave(buff, sizeof(sRegPoll));
 }
 else if(type == TYPE_128)
 {
 make128Info(idx,buff);
 sendInfoToSlave(buff, sizeof(s128Poll));
 }
 else if(type == TYPE_INV)
 {
 makeInvInfo(idx,buff);
 sendInfoToSlave(buff, sizeof(sInvPoll));
 }

 

 return waitInfoFromSlave(idx);
}

 

If this function is called by EVENT_A(sendDeviceEvent(1, TYPE_REG)), sendInfoToSlave(buff, sizeof(sRegPoll)) is executed normally.

 

But If this function is called by EVENT_B(sendDeviceEvent(1, TYPE_REG)),  sendInfoToSlave(buff, sizeof(sRegPoll)) is not executed. That is, is not branched to sendInfoToSlave().

 

Which point should I check? (IAR, ST32F2xx series)

Thanks.

 

Outcomes