diff --git a/cm_heatsink_emulator b/cm_heatsink_emulator index ab53fec..f8451ba 160000 --- a/cm_heatsink_emulator +++ b/cm_heatsink_emulator @@ -1 +1 @@ -Subproject commit ab53feccc5de73ab0887c4af2bbc240534d63921 +Subproject commit f8451ba27c64ca642091a4e5a8c6f277c2deea02 diff --git a/main.c b/main.c index 5aab835..57968f4 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include "cm_heatsink_emulator/cm_heatsink_emulator.h" #define POWER 600 // Watts -#define AMBIENT_TEMPERATURE 25 // degC +#define AMBIENT_TEMPERATURE 23 // degC #define C_TH 32688.36649 // Thermal capacity cm_heatsink_thermalElement_t thermElements[3] = { @@ -28,7 +28,11 @@ cm_heatsinkEmul_t thermEmul; int main(void ){ // Init Thermal emulator - cm_heatsinkEmul_init(&thermEmul, thermElements, 1/*(sizeof(thermElements) / sizeof(thermElements[0]))*/, POWER, AMBIENT_TEMPERATURE); + cm_heatsinkEmul_init(&thermEmul, thermElements,(sizeof(thermElements) / sizeof(thermElements[0])), C_TH, POWER, AMBIENT_TEMPERATURE); + + cm_heatsinkEmul_iterate(&thermEmul, 32688.36649); + float t = cm_heatsinkEmul_getElementTemp(&thermEmul, 2); + printf("temp: %f\r\n", t); + return 0; - cm_heatsinkEmul_getRespon(&thermEmul, 0.1); }