mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-07-09 20:54:37 +02:00
Fix styles
This commit is contained in:
parent
9291d90320
commit
7eb9e1cdb1
1 changed files with 19 additions and 19 deletions
18
pcsensor.c
18
pcsensor.c
|
@ -231,7 +231,7 @@ void interrupt_read(libusb_device_handle *dev) {
|
|||
}
|
||||
}
|
||||
|
||||
void interrupt_read_temperature(libusb_device_handle *dev, float *tempInC, float *TempExC) {
|
||||
void interrupt_read_temperature(libusb_device_handle *dev, float *tempInC, float *tempExC) {
|
||||
int r,s,i, temperature;
|
||||
unsigned char answer[reqIntLen];
|
||||
bzero(answer, reqIntLen);
|
||||
|
@ -254,7 +254,7 @@ void interrupt_read_temperature(libusb_device_handle *dev, float *tempInC, float
|
|||
|
||||
temperature = (answer[5] & 0xFF) + ((signed char)answer[4] << 8);
|
||||
temperature += calibration;
|
||||
*TempExC = temperature * (125.0 / 32000.0);
|
||||
*tempExC = temperature * (125.0 / 32000.0);
|
||||
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ int main( int argc, char **argv) {
|
|||
libusb_device_handle **handles;
|
||||
int numdev,i;
|
||||
float tempInC;
|
||||
float TempExC;
|
||||
float tempExC;
|
||||
int c;
|
||||
struct tm *local;
|
||||
time_t t;
|
||||
|
@ -359,7 +359,7 @@ int main( int argc, char **argv) {
|
|||
do {
|
||||
for (i = 0; i < numdev; i++) {
|
||||
control_transfer(handles[i], uTemperature);
|
||||
interrupt_read_temperature(handles[i], &tempInC, &TempExC);
|
||||
interrupt_read_temperature(handles[i], &tempInC, &tempExC);
|
||||
|
||||
t = time(NULL);
|
||||
local = localtime(&t);
|
||||
|
@ -367,10 +367,10 @@ int main( int argc, char **argv) {
|
|||
if (mrtg) {
|
||||
if (formato==2) {
|
||||
printf("%.2f\n", (9.0 / 5.0 * tempInC + 32.0));
|
||||
printf("%.2f\n", (9.0 / 5.0 * TempExC + 32.0));
|
||||
printf("%.2f\n", (9.0 / 5.0 * tempExC + 32.0));
|
||||
} else {
|
||||
printf("%.2f\n", tempInC);
|
||||
printf("%.2f\n", TempExC);
|
||||
printf("%.2f\n", tempExC);
|
||||
}
|
||||
|
||||
printf("%02d:%02d\n",
|
||||
|
@ -389,13 +389,13 @@ int main( int argc, char **argv) {
|
|||
|
||||
if (formato==2) {
|
||||
printf("Temperature (%d:internal) %.2fF\n", i, (9.0 / 5.0 * tempInC + 32.0));
|
||||
printf("Temperature (%d:external) %.2fF\n", i, (9.0 / 5.0 * TempExC + 32.0));
|
||||
printf("Temperature (%d:external) %.2fF\n", i, (9.0 / 5.0 * tempExC + 32.0));
|
||||
} else if (formato==1) {
|
||||
printf("Temperature (%d:internal) %.2fC\n", i, tempInC);
|
||||
printf("Temperature (%d:external) %.2fC\n", i, TempExC);
|
||||
printf("Temperature (%d:external) %.2fC\n", i, tempExC);
|
||||
} else {
|
||||
printf("Temperature (%d:internal) %.2fF %.2fC\n", i, (9.0 / 5.0 * tempInC + 32.0), tempInC);
|
||||
printf("Temperature (%d:external) %.2fF %.2fC\n", i, (9.0 / 5.0 * TempExC + 32.0), TempExC);
|
||||
printf("Temperature (%d:external) %.2fF %.2fC\n", i, (9.0 / 5.0 * tempExC + 32.0), tempExC);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue