AnsweredAssumed Answered

Problem with STDV-Cosmic compiler

Question asked by nam_hieu.le_huy on Feb 5, 2013
Latest reply on Apr 27, 2013 by M.E
I am a newbie at cosmic and I met something strange when using STVD with cosmic compiler to run my project. I hope that somebody can explain it for me.
This is my project:

It is my main:
#include "peripheral.h"
#include "si4432.h"

static WORKING_AREA(waProtocolThread, 384);
void main(void)
{
    SetupSENSOR();
#if 1
    /*Test NTC_Comparator 2*/
    while(1)
    {
        SI_ReadRegister(0x26);
    }

#else
     chThdCreateStatic(waProtocolThread, sizeof(waProtocolThread), NORMALPRIO, CP_SENSORThread, NULL);
#endif
  while (TRUE) {};
}

And this is my subfunction SI_ReadRegister() stored in si4432.c
uint8_t SI_ReadRegister (const uint8_t Addr) {
    uint8_t Rpl;
    SI_NSEL_LO();
    SI_ReadWriteByte (Addr);
    Rpl =  SI_ReadWriteByte (0);
    SI_NSEL_HI();
    return Rpl;
}

The problem is: I want to set parameter Addr in subfunction to 0x26, however the value of this parameter is another number, and the value of Rpl is 0x26!
I attach a picture when debuging.

Attachments

Outcomes