Doc fixes.
[bertos.git] / drv / thermo.c
old mode 100755 (executable)
new mode 100644 (file)
index 5ac45bb..fb8cbb7
@@ -1,8 +1,33 @@
 /**
  * \file
  * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction.  Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License.  This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
  * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
- * This file is part of DevLib - See README.devlib for information.
+ *
  * -->
  *
  * \brief Thermo-control driver
@@ -15,6 +40,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 +108,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 +240,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 +266,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);