From: asterix Date: Mon, 9 Feb 2009 14:16:35 +0000 (+0000) Subject: Comply to cfg name. X-Git-Tag: 2.1.0~349 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=25debf82616a67ecb6abc97a1c4a7d9f61360bf9;p=bertos.git Comply to cfg name. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2333 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cfg/cfg_thermo.h b/bertos/cfg/cfg_thermo.h index 4e1e1acf..c9039ff6 100644 --- a/bertos/cfg/cfg_thermo.h +++ b/bertos/cfg/cfg_thermo.h @@ -40,13 +40,13 @@ #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 */ diff --git a/bertos/drv/thermo.c b/bertos/drv/thermo.c index 621f3baa..37a1a02a 100644 --- a/bertos/drv/thermo.c +++ b/bertos/drv/thermo.c @@ -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); }