diff --git a/cm_heatsink_emulator.c b/cm_heatsink_emulator.c index aca4f8c..d3d16ab 100644 --- a/cm_heatsink_emulator.c +++ b/cm_heatsink_emulator.c @@ -79,6 +79,15 @@ int cm_heatsinkEmul_setFan(cm_heatsinkEmul_t *inst, float fan_speed){ return 0; } +int cm_heatsinkEmul_setPower(cm_heatsinkEmul_t *inst, float power){ + + if(!isStructOk(inst)) return 1; + inst->power = power; + + return 0; + +} + int cm_heatsinkEmul_init(cm_heatsinkEmul_t *inst, cm_heatsink_thermalElement_t *elements, int elements_Count, float C_th, float power, float ambientTemp){ diff --git a/cm_heatsink_emulator.h b/cm_heatsink_emulator.h index 538303d..50b1ba5 100644 --- a/cm_heatsink_emulator.h +++ b/cm_heatsink_emulator.h @@ -46,6 +46,7 @@ typedef struct { int cm_heatsinkEmul_iterate(cm_heatsinkEmul_t *inst, float dtime); float cm_heatsinkEmul_getElementTemp(cm_heatsinkEmul_t *inst, int element_idx); +int cm_heatsinkEmul_setPower(cm_heatsinkEmul_t *inst, float power); int cm_heatsinkEmul_init(cm_heatsinkEmul_t *inst, cm_heatsink_thermalElement_t *elements, int elements_Count, float C_th, float power, float ambientTemp); #endif /* CM_HEATSINK_EMULATOR_H_ */