Comply to cfg name.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Feb 2009 14:16:35 +0000 (14:16 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Feb 2009 14:16:35 +0000 (14:16 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2333 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cfg/cfg_thermo.h
bertos/drv/thermo.c

index 4e1e1acf788d77d275d0a95e067b7549cc55ee53..c9039ff6db31d9680f6a65be1f8232ed79650820 100644 (file)
 #define CFG_THERMO_H
 
 /// Interval at which thermo control is performed. $WIZARD = { "type" : "int" }
-#define THERMO_INTERVAL_MS      100
+#define CONFIG_THERMO_INTERVAL_MS        100
 
 /**
  * Number of different samples we interpolate over to get the hifi temperature.
  *
  * $WIZARD = { "type" : "int" }
  */
-#define THERMO_HIFI_NUM_SAMPLES 10
+#define CONFIG_THERMO_HIFI_NUM_SAMPLES    10
 
 #endif /* CFG_THERMO_H */
index 621f3baaa5f0118add62a7dd803ae3c64be7b008..37a1a02a2977bccea5fe5f9537d18819d590404e 100644 (file)
@@ -59,7 +59,7 @@ static Timer thermo_timer;
 
 typedef struct ThermoControlDev
 {
-       deg_t          hifi_samples[THERMO_HIFI_NUM_SAMPLES];
+       deg_t          hifi_samples[CONFIG_THERMO_HIFI_NUM_SAMPLES];
        deg_t          cur_hifi_sample;
        deg_t          target;
        thermostatus_t status;
@@ -92,7 +92,7 @@ static void thermo_do(ThermoDev index)
 
        // Store the sample into the hifi FIFO buffer for later interpolation
        dev->hifi_samples[dev->cur_hifi_sample] = cur_temp;
-       if (++dev->cur_hifi_sample == THERMO_HIFI_NUM_SAMPLES)
+       if (++dev->cur_hifi_sample == CONFIG_THERMO_HIFI_NUM_SAMPLES)
                dev->cur_hifi_sample = 0;
 
        cur_temp = thermo_readTemperature(index);
@@ -194,7 +194,7 @@ void thermo_start(ThermoDev dev)
 
        /* Initialize the hifi FIFO with a constant value (the current temperature) */
        temp = thermo_hw_read(dev);
-       for (i = 0; i < THERMO_HIFI_NUM_SAMPLES; ++i)
+       for (i = 0; i < CONFIG_THERMO_HIFI_NUM_SAMPLES; ++i)
                devs[dev].hifi_samples[i] = temp;
        devs[dev].cur_hifi_sample = 0;
 
@@ -234,10 +234,10 @@ deg_t thermo_readTemperature(ThermoDev dev)
 
        MOD_CHECK(thermo);
 
-       for (i = 0; i < THERMO_HIFI_NUM_SAMPLES; i++)
+       for (i = 0; i < CONFIG_THERMO_HIFI_NUM_SAMPLES; i++)
                accum += devs[dev].hifi_samples[i];
 
-       return (deg_t)(accum / THERMO_HIFI_NUM_SAMPLES);
+       return (deg_t)(accum / CONFIG_THERMO_HIFI_NUM_SAMPLES);
 }
 
 MOD_DEFINE(thermo)
@@ -255,7 +255,7 @@ void thermo_init(void)
 
        MOD_INIT(thermo);
 
-       timer_setDelay(&thermo_timer, ms_to_ticks(THERMO_INTERVAL_MS));
+       timer_setDelay(&thermo_timer, ms_to_ticks(CONFIG_THERMO_INTERVAL_MS));
        timer_setSoftint(&thermo_timer, (Hook)thermo_softint, 0);
        timer_add(&thermo_timer);
 }