initialze muted, improved trace on i2c failure
authorTobias Jahnke <tjahnk@users.noreply.github.com>
Wed, 23 Aug 2017 14:59:36 +0000 (16:59 +0200)
committerTobias Jahnke <tjahnk@users.noreply.github.com>
Wed, 23 Aug 2017 14:59:36 +0000 (16:59 +0200)
README.md
conf.d/app-templates
data/config_multichannel_audio_kit.xml
ucs2-interface/ucs_lib_interf.c

index 109d260..b74a633 100644 (file)
--- 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"/>
+```
index 9c71a76..aa763dd 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9c71a765f0e4f53a6bbae5f550515b93eb9d7c53
+Subproject commit aa763ddec685dc44bcb5d44718d78f3692d4f0dc
index a248607..14da758 100644 (file)
@@ -74,7 +74,9 @@
     <I2CPortWrite Address="0x2A" Payload="06 00"/>\r
     <I2CPortWrite Address="0x2A" Payload="05 00"/>\r
     <!-- Register 7: Master Volume (Max Volume=07 00 00 and Min Volume=07 03 FF) -->\r
-    <I2CPortWrite Address="0x2A" Payload="07 01 50"/>\r
+    <!--   - together with HAL-MOST-UNICENS binding use "07 03 FF" = muted after start -->\r
+    <!--   - otherwise use "07 01 50" = default volume -->\r
+    <I2CPortWrite Address="0x2A" Payload="07 03 FF"/>\r
   </Script>\r
 \r
   <!-- 1st Aux IO -->\r
index 9e7167d..ad256e3 100644 (file)
@@ -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);
             }