aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-23 16:59:36 +0200
committerTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-23 16:59:36 +0200
commit81124d50004ee8c0a141771c4b59a79b1a9ec4f1 (patch)
treeb66fc134e967b97191643275def82f862a7593b0
parent852f83844416d399d8efd111da2dd0d4c5580980 (diff)
initialze muted, improved trace on i2c failure
-rw-r--r--README.md15
m---------conf.d/app-templates0
-rw-r--r--data/config_multichannel_audio_kit.xml4
-rw-r--r--ucs2-interface/ucs_lib_interf.c8
4 files changed, 23 insertions, 4 deletions
diff --git a/README.md b/README.md
index 109d260..b74a633 100644
--- a/README.md
+++ b/README.md
@@ -154,4 +154,19 @@ Note: remote-target-populate will
Note that Netbeans impose to set debug directory to ./build/pkgout or it won't find binding symbols for source debugging
+# Default Volume of Amplifiers
+The binding currently supports two use cases for amplifiers.
+1. Amplifiers are initialized with a default volume. The head unit uses software volume
+ to change the volume of streaming data.
+2. Amplifiers are initialized muted. The head unit uses hardware volume (e.g. HAL-MOST-UNICENS)
+ to change the volume of amplifiers remotely.
+Use case 2 is the default use case. If you like to use this binding without hardware volume support
+please adopt the ```config_multichannel_audio_kit.xml``` as explained below.
+
+```
+<!-- Register 7: Master Volume (Max Volume=07 00 00 and Min Volume=07 03 FF) -->
+<!-- - together with HAL-MOST-UNICENS binding use "07 03 FF" = muted after start -->
+<!-- - otherwise use "07 01 50" = default volume -->
+<I2CPortWrite Address="0x2A" Payload="07 03 FF"/>
+```
diff --git a/conf.d/app-templates b/conf.d/app-templates
-Subproject 9c71a765f0e4f53a6bbae5f550515b93eb9d7c5
+Subproject aa763ddec685dc44bcb5d44718d78f3692d4f0d
diff --git a/data/config_multichannel_audio_kit.xml b/data/config_multichannel_audio_kit.xml
index a248607..14da758 100644
--- a/data/config_multichannel_audio_kit.xml
+++ b/data/config_multichannel_audio_kit.xml
@@ -74,7 +74,9 @@
<I2CPortWrite Address="0x2A" Payload="06 00"/>
<I2CPortWrite Address="0x2A" Payload="05 00"/>
<!-- Register 7: Master Volume (Max Volume=07 00 00 and Min Volume=07 03 FF) -->
- <I2CPortWrite Address="0x2A" Payload="07 01 50"/>
+ <!-- - together with HAL-MOST-UNICENS binding use "07 03 FF" = muted after start -->
+ <!-- - otherwise use "07 01 50" = default volume -->
+ <I2CPortWrite Address="0x2A" Payload="07 03 FF"/>
</Script>
<!-- 1st Aux IO -->
diff --git a/ucs2-interface/ucs_lib_interf.c b/ucs2-interface/ucs_lib_interf.c
index 9e7167d..ad256e3 100644
--- a/ucs2-interface/ucs_lib_interf.c
+++ b/ucs2-interface/ucs_lib_interf.c
@@ -174,6 +174,7 @@ bool UCSI_ProcessRxData(UCSI_Data_t *my,
void UCSI_Service(UCSI_Data_t *my)
{
+ Ucs_Return_t ret;
UnicensCmdEntry_t *e;
bool popEntry = true; /*Set to false in specific case, where function will callback asynchrony.*/
assert(MAGIC == my->magic);
@@ -218,12 +219,13 @@ void UCSI_Service(UCSI_Data_t *my)
UCSI_CB_OnUserMessage(my->tag, true, "UnicensCmd_GpioWritePort failed", 0);
break;
case UnicensCmd_I2CWrite:
- if (UCS_RET_SUCCESS == Ucs_I2c_WritePort(my->unicens, e->val.I2CWrite.destination, 0x0F00,
+ ret = Ucs_I2c_WritePort(my->unicens, e->val.I2CWrite.destination, 0x0F00,
(e->val.I2CWrite.isBurst ? UCS_I2C_BURST_MODE : UCS_I2C_DEFAULT_MODE), e->val.I2CWrite.blockCount,
- e->val.I2CWrite.slaveAddr, e->val.I2CWrite.timeout, e->val.I2CWrite.dataLen, e->val.I2CWrite.data, OnUcsI2CWrite))
+ e->val.I2CWrite.slaveAddr, e->val.I2CWrite.timeout, e->val.I2CWrite.dataLen, e->val.I2CWrite.data, OnUcsI2CWrite);
+ if (UCS_RET_SUCCESS == ret)
popEntry = false;
else {
- UCSI_CB_OnUserMessage(my->tag, true, "Ucs_I2c_WritePort failed", 0);
+ UCSI_CB_OnUserMessage(my->tag, true, "Ucs_I2c_WritePort failed ret=%d", 1, ret);
assert(e->val.I2CWrite.result_fptr != NULL);
e->val.I2CWrite.result_fptr(NULL /*processing error*/, e->val.I2CWrite.request_ptr);
}