From: marco Date: Wed, 20 Sep 2006 20:12:41 +0000 (+0000) Subject: Names convention, MOD_* macros. X-Git-Tag: 1.0.0~519 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=bee5b90739b848c275160512171a3114532babb4;p=bertos.git Names convention, MOD_* macros. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@722 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/thermo.c b/drv/thermo.c index 5ac45bb5..73a5b451 100755 --- 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); diff --git a/drv/thermo.h b/drv/thermo.h index 81d96d43..8f749a39 100755 --- a/drv/thermo.h +++ b/drv/thermo.h @@ -26,6 +26,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. *#* @@ -88,7 +91,7 @@ thermostatus_t thermo_status(ThermoDev dev); * \param dev Device * \return Current temperature (Celsius degrees * 10) */ -deg_t thermo_read_temperature(ThermoDev dev); +deg_t thermo_readTemperature(ThermoDev dev); #endif /* DRV_THERMO_H */