diff --git a/fancontrol/fancontrol.cpp b/fancontrol/fancontrol.cpp index 4a53390..5cb6ae5 100644 --- a/fancontrol/fancontrol.cpp +++ b/fancontrol/fancontrol.cpp @@ -1096,9 +1096,9 @@ switch (msg) { if (temp < 128 && temp!= 0) { if (Fahrenheit) - sprintf_s(obuf2,sizeof(obuf2), "%d°F", temp* 9 /5 +32); + sprintf_s(obuf2,sizeof(obuf2), "%d° F", temp* 9 /5 +32); else - sprintf_s(obuf2, sizeof(obuf2), "%d°C", temp); + sprintf_s(obuf2, sizeof(obuf2), "%d° C", temp); size_t strlen_templist2 = strlen_s(templist2,sizeof(templist2)); @@ -1599,11 +1599,11 @@ void FANCONTROL::ProcessTextIcons(void){ if (dishow && !this->NoBallons){ if (Fahrenheit){ - ppTbTextIcon[0]->DiShowballon(_T("shows max. temperature in °F and sensor name, left click on icon shows or hides control window, right click shows menue"), + ppTbTextIcon[0]->DiShowballon(_T("shows max. temperature in ° F and sensor name, left click on icon shows or hides control window, right click shows menue"), _T("TPFanControl new text icon"),NIIF_INFO,11); } else { - ppTbTextIcon[0]->DiShowballon(_T("shows max. temperature in °C and sensor name, left click on icon shows or hides control window, right click shows menue"), + ppTbTextIcon[0]->DiShowballon(_T("shows max. temperature in ° C and sensor name, left click on icon shows or hides control window, right click shows menue"), _T("TPFanControl new text icon"),NIIF_INFO,11); } diff --git a/fancontrol/fanstuff.cpp b/fancontrol/fanstuff.cpp index 28380c5..95d2f81 100644 --- a/fancontrol/fanstuff.cpp +++ b/fancontrol/fanstuff.cpp @@ -22,12 +22,12 @@ #include "TVicPort.h" #define TP_ECOFFSET_FAN_SWITCH (char)0x31 -#define TP_ECOFFSET_FAN1 (char)0x0000 -#define TP_ECOFFSET_FAN2 (char)0x0001 -#define TP_ECOFFSET_FAN (char)0x2F // 1 byte (binary xyzz zzz) -#define TP_ECOFFSET_FANSPEED (char)0x84 // 16 bit word, lo/hi byte -#define TP_ECOFFSET_TEMP0 (char)0x78 // 8 temp sensor bytes from here -#define TP_ECOFFSET_TEMP1 (char)0xC0 // 4 temp sensor bytes from here +#define TP_ECOFFSET_FAN1 (char)0x0000 +#define TP_ECOFFSET_FAN2 (char)0x0001 +#define TP_ECOFFSET_FAN (char)0x2F // 1 byte (binary xyzz zzz) +#define TP_ECOFFSET_FANSPEED (char)0x84 // 16 bit word, lo/hi byte +#define TP_ECOFFSET_TEMP0 (char)0x78 // 8 temp sensor bytes from here +#define TP_ECOFFSET_TEMP1 (char)0xC0 // 4 temp sensor bytes from here @@ -99,9 +99,9 @@ FANCONTROL::HandleData(void) // title string (for minimized window) if(Fahrenheit) - sprintf_s(title2,sizeof(title2), "%d°F", this->MaxTemp* 9/5 +32); + sprintf_s(title2,sizeof(title2), "%d° F", this->MaxTemp* 9/5 +32); else - sprintf_s(title2,sizeof(title2), "%d°C", this->MaxTemp); + sprintf_s(title2,sizeof(title2), "%d° C", this->MaxTemp); // display fan state @@ -160,9 +160,9 @@ FANCONTROL::HandleData(void) // display temperature list if(Fahrenheit) - sprintf_s(obuf2,sizeof(obuf2), "%d°F", this->MaxTemp* 9 /5 +32); + sprintf_s(obuf2,sizeof(obuf2), "%d° F", this->MaxTemp* 9 /5 +32); else - sprintf_s(obuf2,sizeof(obuf2), "%d°C", this->MaxTemp); + sprintf_s(obuf2,sizeof(obuf2), "%d° C", this->MaxTemp); ::SetDlgItemText(this->hwndDialog, 8103, obuf2); @@ -173,9 +173,9 @@ FANCONTROL::HandleData(void) if (temp < 128 && temp!= 0) { if(Fahrenheit) - sprintf_s(obuf2,sizeof(obuf2), "%d°F", temp* 9 /5 +32); + sprintf_s(obuf2,sizeof(obuf2), "%d° F", temp* 9 /5 +32); else - sprintf_s(obuf2,sizeof(obuf2), "%d°C", temp); + sprintf_s(obuf2,sizeof(obuf2), "%d° C", temp); if (SlimDialog && StayOnTop) sprintf_s(templist2+strlen(templist2), sizeof(templist2)-strlen(templist2), "%d %s %s", i+1, @@ -237,9 +237,9 @@ FANCONTROL::HandleData(void) } templist[strlen(templist)-1]= '\0'; if (Fahrenheit) - sprintf_s(CurrentStatus, sizeof(CurrentStatus), "Fan: 0x%02x / Switch: %d°F (%s)", State.FanCtrl, MaxTemp* 9 /5 +32, templist); + sprintf_s(CurrentStatus, sizeof(CurrentStatus), "Fan: 0x%02x / Switch: %d° F (%s)", State.FanCtrl, MaxTemp* 9 /5 +32, templist); else - sprintf_s(CurrentStatus, sizeof(CurrentStatus), "Fan: 0x%02x / Switch: %d°C (%s)", State.FanCtrl, MaxTemp, templist); + sprintf_s(CurrentStatus, sizeof(CurrentStatus), "Fan: 0x%02x / Switch: %d° C (%s)", State.FanCtrl, MaxTemp, templist); // display fan speed (experimental, not visible) // fanspeed= (this->State.FanSpeedHi << 8) | this->State.FanSpeedLo; @@ -413,17 +413,17 @@ FANCONTROL::SetFan(const char *source, int fanctrl, BOOL final) for (int i = 0; i < 5; i++) { // set new fan level - ok= this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN1); - ok= this->WriteByteToEC(TP_ECOFFSET_FAN, fanctrl); + ok = this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN1); + ok = this->WriteByteToEC(TP_ECOFFSET_FAN, fanctrl); ::Sleep(300); - ok= this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN2); + ok = this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN2); ok = this->WriteByteToEC(TP_ECOFFSET_FAN, fanctrl); // verify completion - ok= this->ReadByteFromEC(TP_ECOFFSET_FAN, &this->State.FanCtrl); - ok= this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN1); + ok = this->ReadByteFromEC(TP_ECOFFSET_FAN, &this->State.FanCtrl); + ok = this->WriteByteToEC(TP_ECOFFSET_FAN_SWITCH, TP_ECOFFSET_FAN1); ok = this->ReadByteFromEC(TP_ECOFFSET_FAN, &this->State.FanCtrl); if (this->State.FanCtrl == fanctrl) @@ -618,6 +618,7 @@ FANCONTROL::ReadEcRaw(FCSTATE *pfcstate) } if (!this->UseTWR){ idxtemp= 0; + for (i= 0; i<8 && ok; i++) { // temp sensors 0x78 - 0x7f ok= ReadByteFromEC(TP_ECOFFSET_TEMP0+i, &pfcstate->Sensors[idxtemp]); if (this->ShowBiasedTemps) diff --git a/fancontrol/misc.cpp b/fancontrol/misc.cpp index 8a246ad..df35198 100644 --- a/fancontrol/misc.cpp +++ b/fancontrol/misc.cpp @@ -518,7 +518,7 @@ FANCONTROL::ReadConfig(const char *configfile) if (Fahrenheit){ strcpy_s(buf,sizeof(buf), " "); for (i= 0; this->SmartLevels[i].temp!=-1; i++) { - sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d°F->", + sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d° F->", i>0 ? ", " : "", this->SmartLevels[i].temp); if (this->SmartLevels[i].fan!=0x80) sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%d", @@ -530,7 +530,7 @@ FANCONTROL::ReadConfig(const char *configfile) else { strcpy_s(buf,sizeof(buf), " Levels= "); for (i= 0; this->SmartLevels[i].temp!=-1; i++) { - sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d°C -> ", + sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d° C -> ", i>0 ? ", " : "", this->SmartLevels[i].temp); if (this->SmartLevels[i].fan!=0x80) @@ -551,7 +551,7 @@ FANCONTROL::ReadConfig(const char *configfile) if (Fahrenheit){ strcpy_s(buf,sizeof(buf), " "); for (i= 0; this->SmartLevels2[i].temp2!=-1; i++) { - sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d°F->", + sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d° F->", i>0 ? ", " : "", this->SmartLevels2[i].temp2); if (this->SmartLevels2[i].fan2!=0x80) sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%d", @@ -563,7 +563,7 @@ FANCONTROL::ReadConfig(const char *configfile) else { strcpy_s(buf,sizeof(buf), " Levels2= "); for (i= 0; this->SmartLevels2[i].temp2!=-1; i++) { - sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d°C -> ", + sprintf_s(buf+strlen(buf),sizeof(buf)-strlen(buf), "%s%d° C -> ", i>0 ? ", " : "", this->SmartLevels2[i].temp2); if (this->SmartLevels2[i].fan2!=0x80) @@ -578,7 +578,7 @@ FANCONTROL::ReadConfig(const char *configfile) } if (Fahrenheit) { - sprintf_s(buf,sizeof(buf), " SensorOffset1-12= %d %d %d %d %d %d %d %d %d %d %d %d °F", + sprintf_s(buf,sizeof(buf), " SensorOffset1-12= %d %d %d %d %d %d %d %d %d %d %d %d ° F", this->SensorOffset[0], this->SensorOffset[1], this->SensorOffset[2], this->SensorOffset[3], this->SensorOffset[4], this->SensorOffset[5], this->SensorOffset[6], this->SensorOffset[7], this->SensorOffset[8], @@ -587,7 +587,7 @@ FANCONTROL::ReadConfig(const char *configfile) for (i= 0; i<15; i++) {SensorOffset[i]= SensorOffset[i] * 5/9;} } else { - sprintf_s(buf,sizeof(buf), " SensorOffset1-12= %d %d %d %d %d %d %d %d %d %d %d %d °C", + sprintf_s(buf,sizeof(buf), " SensorOffset1-12= %d %d %d %d %d %d %d %d %d %d %d %d ° C", this->SensorOffset[0], this->SensorOffset[1], this->SensorOffset[2], this->SensorOffset[3], this->SensorOffset[4], this->SensorOffset[5], this->SensorOffset[6], this->SensorOffset[7], this->SensorOffset[8], diff --git a/fancontrol/res/fancontrol.aps b/fancontrol/res/fancontrol.aps index 3815b25..0b4607f 100644 Binary files a/fancontrol/res/fancontrol.aps and b/fancontrol/res/fancontrol.aps differ