I am getting a bit confusing with pointers, I want to update the variable tmpTwoComplement, if I do update as in this code snippet, it does work:
int16_t max30205MeasureTemperature(int16_t *tmpTwoComplement) {
    char regT = MAX30205_REG_TEMPERATURE;
    max30205_raw_data rawTemp;
    max30205_read_reg_as_temperature(regT, &rawTemp);
    *tmpTwoComplement = rawTemp.swrd;
}
but this one doesn't, why?
int16_t max30205MeasureTemperature(int16_t *tmpTwoComplement) {
    char regT = MAX30205_REG_TEMPERATURE;
    max30205_raw_data rawTemp;
    max30205_read_reg_as_temperature(regT, &rawTemp);
    tmpTwoComplement = &rawTemp.swrd;
}
I always call the above function as
max30205MeasureTemperature(®isterTemp);
being
typedef union max30205_raw_data {
    struct {
        uint8_t lsb;
        uint8_t msb;
    };
    struct {
        uint16_t magnitude_bits:15;
        uint16_t sign_bit:1;
    };
    uint16_t uwrd;
    int16_t swrd;
} max30205_raw_data;
tempSamplesUpdatedMAX30205 = true;
 
     
     
     
    