thermometer
int thermometer = (pBase->miscConfiguration >> 1) & 0x3;
return --thermometer;
int thermometer = ar9003_hw_get_thermometer(ah);
u8 therm_on = (thermometer < 0) ? 0 : 1;
therm_on = thermometer == 0;
therm_on = thermometer == 1;
therm_on = thermometer == 2;
struct thermometer *thermometer)
tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1));
thermometer->tz = tz;
thermometer->tz[thermometer->nr_tz].fd_temp = fd;
thermometer->tz[thermometer->nr_tz].name = strdup(name);
thermometer->tz[thermometer->nr_tz].polling = polling;
thermometer->nr_tz++;
struct thermometer *thermometer)
tz_regex->polling, thermometer))
static int thermometer_start(struct thermometer *thermometer,
INFO("Capturing %d thermal zone(s) temperature...\n", thermometer->nr_tz);
for (i = 0; i < thermometer->nr_tz; i++) {
thermometer->tz[i].name, options->postfix);
fprintf(f, "timestamp(ms) %s(°mC)\n", thermometer->tz[i].name);
thermometer->tz[i].file_out = f;
DEBUG("Created '%s' file for thermal zone '%s'\n", path, thermometer->tz[i].name);
thermometer->tz[i].fd_timer = timerfd_create(CLOCK_MONOTONIC, 0);
if (thermometer->tz[i].fd_timer < 0) {
thermometer->tz[i].name);
thermometer->tz[i].name, thermometer->tz[i].polling);
msec_to_timespec(thermometer->tz[i].polling);
if (timerfd_settime(thermometer->tz[i].fd_timer, 0,
if (mainloop_add(thermometer->tz[i].fd_timer,
&thermometer->tz[i]))
static int thermometer_stop(struct thermometer *thermometer)
for (i = 0; i < thermometer->nr_tz; i++)
fclose(thermometer->tz[i].file_out);
struct thermometer thermometer = { 0 };
if (thermometer_init(&config, &thermometer))
if (thermometer_start(&thermometer, &options))
if (thermometer_stop(&thermometer))