2013-02-04 07:46 PM
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: &sharpinclude ''peripheral.h'' &sharpinclude ''si4432.h'' static WORKING_AREA(waProtocolThread, 384); void main(void) { SetupSENSOR(); &sharpif 1 /*Test NTC_Comparator 2*/ while(1) { SI_ReadRegister(0x26); } &sharpelse chThdCreateStatic(waProtocolThread, sizeof(waProtocolThread), NORMALPRIO, CP_SENSORThread, NULL); &sharpendif 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. #cosmic #stvd2013-04-27 02:49 AM
Is there any warnings during compile time?
is SI_ReadRegister () declared in si4432.h correctly?