Commit 2d80e753 authored by Bernd-Christian Renner's avatar Bernd-Christian Renner
Browse files

changed implementation of tx-gain setting/handling (now set upon enabling the...

changed implementation of tx-gain setting/handling  (now set upon enabling the TX board), because new TXB (v5 and newer) disables poti when inactive (off)
parent 5be51c3d
......@@ -81,18 +81,23 @@ txamp_init(void)
bool
txamp_setGainLevel(uint8_t lvl)
{
bool ret;
//bool ret;
if (lvl >= NUM_TXGAIN) {
return false;
}
ret = mcp4561_send(POTI_CMD_WRITE_DATA, TXGAIN[lvl]);
if (ret) {
txLvl = lvl;
}
txLvl = lvl;
return true;
return ret;
// TXB version 5 and above switch the poti off, when not active;
// hence, we can only send the new setting when TX is on.
//ret = mcp4561_send(POTI_CMD_WRITE_DATA, TXGAIN[lvl]);
//if (ret) {
// txLvl = lvl;
//}
//
//return ret;
}
......@@ -143,6 +148,10 @@ txamp_disable()
void
txamp_connectOutput()
{
// use non-volatile write here here
mcp4561_send(POTI_CMD_WRITE_DATA, TXGAIN[txLvl]);
// only enable output, after gain has been set
gpio_set(TXRX_SW_PIN);
}
......
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