diff options
author | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-11 09:22:38 +0200 |
---|---|---|
committer | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-16 16:00:50 +0200 |
commit | 3d4ecfd96e63d4fbc719e4be06e022a6811b0c1e (patch) | |
tree | 351064b91588e3d7b3c191bf93fe430c05f7d316 /HAL-afb/hal-most-unicens/hal_most_unicens.c | |
parent | eb6b00b52432941cf081a3b511c70e758f6a7213 (diff) |
MOST ALSA mixer controls now mapped to UNCENS I2C commands
Diffstat (limited to 'HAL-afb/hal-most-unicens/hal_most_unicens.c')
-rw-r--r-- | HAL-afb/hal-most-unicens/hal_most_unicens.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/HAL-afb/hal-most-unicens/hal_most_unicens.c b/HAL-afb/hal-most-unicens/hal_most_unicens.c index ace9399..a5971fb 100644 --- a/HAL-afb/hal-most-unicens/hal_most_unicens.c +++ b/HAL-afb/hal-most-unicens/hal_most_unicens.c @@ -23,11 +23,11 @@ #include "wrap_unicens.h" #include "wrap_volume.h" +#define PCM_MAX_CHANNELS 6 + static int master_volume; static json_bool master_switch; -static int pcm_volume[6]; - -/*static uint8_t test[3] = {0x07,0x03,0xFF};*/ +static int pcm_volume[PCM_MAX_CHANNELS]; void unicens_master_vol_cb(halCtlsEnumT tag, alsaHalCtlMapT *control, void* handle, json_object *j_obj) { @@ -35,9 +35,7 @@ void unicens_master_vol_cb(halCtlsEnumT tag, alsaHalCtlMapT *control, void* hand if (wrap_json_unpack(j_obj, "[i!]", &master_volume) == 0) { AFB_NOTICE("master_volume: %s, value=%d", j_str, master_volume); - /*wrap_ucs_i2cwrite(0x270, test, 3); - wrap_ucs_i2cwrite(0x271, test, 3); - wrap_ucs_i2cwrite(0x272, test, 3);*/ + wrap_volume_master(master_volume); } else { AFB_NOTICE("master_volume: INVALID STRING %s", j_str); @@ -63,6 +61,7 @@ void unicens_pcm_vol_cb(halCtlsEnumT tag, alsaHalCtlMapT *control, void* handle, if (wrap_json_unpack(j_obj, "[iiiiii!]", &pcm_volume[0], &pcm_volume[1], &pcm_volume[2], &pcm_volume[3], &pcm_volume[4], &pcm_volume[5]) == 0) { AFB_NOTICE("pcm_vol: %s", j_str); + wrap_volume_pcm(pcm_volume, PCM_MAX_CHANNELS/*array size*/); } else { AFB_NOTICE("pcm_vol: INVALID STRING %s", j_str); |