Commit f03e0104 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Config variables: include the forward declaration in the CONFIG_INT_EX definition

(no longer needed to declare CONFIG_VAR_CHANGE_FUNC's twice)

--HG--
branch : config_var_refactor
parent 7ce54e421c23
......@@ -30,10 +30,6 @@
#include "audio-common.c"
#include "boot-hack.h"
static CONFIG_VAR_CHANGE_FUNC(dgain_on_change);
static CONFIG_VAR_CHANGE_FUNC(mgain_on_change);
static CONFIG_VAR_CHANGE_FUNC(mic_power_on_change);
static CONFIG_INT_EX( "audio.dgain.l", dgain_l, 0, dgain_on_change );
static CONFIG_INT_EX( "audio.dgain.r", dgain_r, 0, dgain_on_change );
static CONFIG_INT_EX( "audio.mgain", mgain, 4, mgain_on_change );
......
......@@ -115,9 +115,6 @@ static CONFIG_VAR_CHANGE_FUNC(enable_filters_on_change)
#endif
}
static CONFIG_VAR_CHANGE_FUNC(alc_enable_on_change);
static CONFIG_VAR_CHANGE_FUNC(input_choice_on_change);
static CONFIG_INT_EX("audio.lovl", lovl, 0, lovl_on_change );
static CONFIG_INT_EX("audio.alc-enable", alc_enable, 0, alc_enable_on_change );
static int loopback = 1;
......
......@@ -30,15 +30,6 @@
#include "console.h"
#include "audio-common.c"
static CONFIG_VAR_CHANGE_FUNC(override_audio_on_change);
static CONFIG_VAR_CHANGE_FUNC(analog_gain_on_change);
static CONFIG_VAR_CHANGE_FUNC(analog_boost_on_change);
static CONFIG_VAR_CHANGE_FUNC(audio_filter_on_change);
static CONFIG_VAR_CHANGE_FUNC(filter_hpf2config_on_change);
static CONFIG_VAR_CHANGE_FUNC(recdgain_on_change);
static CONFIG_VAR_CHANGE_FUNC(dgain_on_change);
static CONFIG_VAR_CHANGE_FUNC(effect_mode_on_change);
// Set defaults
CONFIG_INT_EX( "audio.override_audio", cfg_override_audio, 0, override_audio_on_change );
CONFIG_INT_EX( "audio.analog_gain", cfg_analog_gain, 0, analog_gain_on_change );
......
......@@ -93,8 +93,7 @@ struct config_var
#define CONFIG_VAR_ATTR
#endif
#define _CONFIG_VAR( NAME, TYPE_ENUM, TYPE, VAR, VALUE, CHANGE_CBR ) \
TYPE VAR = VALUE; \
#define _CONFIG_VAR( NAME, TYPE_ENUM, VAR, VALUE, CHANGE_CBR ) \
CONFIG_VAR_ATTR struct config_var \
__attribute__((section(".config_vars"))) \
__config_##VAR = \
......@@ -107,10 +106,13 @@ __config_##VAR = \
}
#define CONFIG_INT( NAME, VAR, VALUE ) \
_CONFIG_VAR( NAME, 0, int, VAR, VALUE, NULL )
int VAR = VALUE; \
_CONFIG_VAR( NAME, 0, VAR, VALUE, NULL )
#define CONFIG_INT_EX( NAME, VAR, VALUE, CHANGE_CBR ) \
_CONFIG_VAR( NAME, 0, int, VAR, VALUE, CHANGE_CBR )
int VAR = VALUE; \
static CONFIG_VAR_CHANGE_FUNC(CHANGE_CBR); \
_CONFIG_VAR( NAME, 0, VAR, VALUE, CHANGE_CBR )
#define _CONFIG_ARRAY_ELEMENT( NAME, TYPE_ENUM, VAR, INDEX, VALUE ) \
struct config_var \
......
......@@ -164,7 +164,6 @@ static CONFIG_INT( "zoom.focus_ring", zoom_focus_ring, 0);
CONFIG_INT( "zoom.auto.exposure", zoom_auto_exposure, 0);
#ifdef FEATURE_BULB_TIMER
static CONFIG_VAR_CHANGE_FUNC(bulb_duration_change);
static CONFIG_INT_EX( "bulb.duration", bulb_duration, 5, bulb_duration_change);
static CONFIG_INT ( "bulb.timer", bulb_timer, 0);
static CONFIG_INT ( "bulb.display.mode", bulb_display_mode, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment