...     
        pwmvalue = MAX_POWER_LOSS / (uint32_t)Current_meas;
...