mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-06-24 07:04:36 +02:00
Fix comment
This commit is contained in:
parent
856f590599
commit
e3452614e6
1 changed files with 7 additions and 6 deletions
13
pcsensor.c
13
pcsensor.c
|
@ -385,7 +385,7 @@ int main(int argc, char **argv) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
devices = calloc(MAX_DEV, sizeof(temper_device_t*));
|
||||
devices = calloc(MAX_DEV, sizeof(temper_device_t));
|
||||
if ((numdev = setup_libusb_access(devices)) < 1) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -411,13 +411,9 @@ int main(int argc, char **argv) {
|
|||
|
||||
do {
|
||||
for (i = 0; i < numdev; i++) {
|
||||
control_transfer(devices[i].handle, uTemperature);
|
||||
interrupt_read(devices[i].handle, answer);
|
||||
devices[i].type->decode_func(answer, tempd, calibration);
|
||||
|
||||
// get localtime
|
||||
t = time(NULL);
|
||||
local = localtime(&t);
|
||||
|
||||
sprintf(strdate, "%04d-%02d-%02dT%02d:%02d:%02d",
|
||||
local->tm_year +1900,
|
||||
local->tm_mon + 1,
|
||||
|
@ -426,6 +422,11 @@ int main(int argc, char **argv) {
|
|||
local->tm_min,
|
||||
local->tm_sec);
|
||||
|
||||
// get temperature
|
||||
control_transfer(devices[i].handle, uTemperature);
|
||||
interrupt_read(devices[i].handle, answer);
|
||||
devices[i].type->decode_func(answer, tempd, calibration);
|
||||
|
||||
// print temperature
|
||||
if (formato==2) {
|
||||
// in Fahrenheit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue