X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=drv%2Fthermo.c;h=73a5b451a6fb9fc4bc0e9631e51633debc3177da;hb=5f3952176a4e9a00ca8dd5ec4a6b994958f89e0a;hp=5ac45bb5e5b61136f626c1af205845d4dbcc9054;hpb=bcf38f772b397e7a8ba781a69aacb9380e54b32a;p=bertos.git diff --git a/drv/thermo.c b/drv/thermo.c old mode 100755 new mode 100644 index 5ac45bb5..73a5b451 --- a/drv/thermo.c +++ b/drv/thermo.c @@ -15,6 +15,9 @@ /*#* *#* $Log$ + *#* Revision 1.3 2006/09/20 20:12:41 marco + *#* Names convention, MOD_* macros. + *#* *#* Revision 1.2 2006/07/19 12:56:26 bernie *#* Convert to new Doxygen style. *#* @@ -80,7 +83,7 @@ static void thermo_do(ThermoDev index) if (++dev->cur_hifi_sample == THERMO_HIFI_NUM_SAMPLES) dev->cur_hifi_sample = 0; - cur_temp = thermo_read_temperature(index); + cur_temp = thermo_readTemperature(index); if (cur_temp == NTC_SHORT_CIRCUIT || cur_temp == NTC_OPEN_CIRCUIT) { @@ -212,17 +215,20 @@ void thermo_clearErrors(ThermoDev dev) /** * Read the temperature of the thermo-device \a dev using mobile mean. */ -deg_t thermo_read_temperature(ThermoDev dev) +deg_t thermo_readTemperature(ThermoDev dev) { int i; long accum = 0; + MOD_CHECK(thermo); + for (i = 0; i < THERMO_HIFI_NUM_SAMPLES; i++) accum += devs[dev].hifi_samples[i]; return (deg_t)(accum / THERMO_HIFI_NUM_SAMPLES); } +MOD_DEFINE(thermo) /** * Init thermo-control and associated hw. @@ -235,6 +241,8 @@ void thermo_init(void) for (int i = 0; i < THERMO_CNT; i++) devs[i].status = THERMO_OFF; + MOD_INIT(thermo); + timer_setDelay(&thermo_timer, ms_to_ticks(THERMO_INTERVAL_MS)); timer_set_event_softint(&thermo_timer, (Hook)thermo_softint, 0); timer_add(&thermo_timer);