thermferm/thermferm.c

changeset 189
cc2b04d4db99
parent 188
4fc17ef4593f
child 194
9eaaba49450f
equal deleted inserted replaced
188:4fc17ef4593f 189:cc2b04d4db99
333 333
334 do { 334 do {
335 if (my_shutdown) 335 if (my_shutdown)
336 run = 0; 336 run = 0;
337 337
338 /*
339 * Timed schedulers
340 */
341 now = time(NULL); 338 now = time(NULL);
342 if (now != last) { 339 if (now != last) {
340 /*
341 * Each second
342 */
343 last = now; 343 last = now;
344 seconds++; 344 seconds++;
345 345
346 #ifdef HAVE_WIRINGPI_H 346 #ifdef HAVE_WIRINGPI_H
347 row = 3; 347 row = 3;
411 unit->beer_state = 2; 411 unit->beer_state = 2;
412 } 412 }
413 } 413 }
414 414
415 /* 415 /*
416 * Handle profile
417 */
418 if ((unit->mode == UNITMODE_PROFILE) && (unit->profile)) {
419 /*
420 * unit->profile - uuid of the selected profile.
421 * unit->prof_started - start time or 0 if not yet running.
422 * unit->prof_state - PROFILE_OFF|PROFILE_PAUSE|PROFILE_RUN|PROFILE_DONE
423 * unit->prof_target - Calculated target temperature.
424 */
425 // off. Target is ??
426 // pause Target is keep target.
427 // run. Target must be calculated using steps.
428 // done. Target is last target.
429 }
430
431 /*
416 * Manual switching 432 * Manual switching
417 */ 433 */
418 if (unit->mode == UNITMODE_NONE) { 434 if (unit->mode == UNITMODE_NONE) {
419 device_out(unit->heater_address, unit->heater_state); 435 device_out(unit->heater_address, unit->heater_state);
420 device_out(unit->cooler_address, unit->cooler_state); 436 device_out(unit->cooler_address, unit->cooler_state);

mercurial