tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/36691?usp=email )
Change subject: ctl: When setting Sa bits, other bits must remain set to '1' ......................................................................
ctl: When setting Sa bits, other bits must remain set to '1'
Some of the other bits will be used 'as-is'. For instance the bit 0 (MSB) will be copied from this if operating in nocrc4 mode.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: Id482c6a114e7bf051d157e81038f015e9d26fa99 --- M src/ctl.c 1 file changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/91/36691/1
diff --git a/src/ctl.c b/src/ctl.c index 331f2ad..e63589b 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -452,11 +452,14 @@ return 0; }
- line->ts0.tx_frame = ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */ - ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */ - ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */ - ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */ - (sa_bits & 0x10); /* Bit 4 -> Sa4 */ + line->ts0.tx_frame = ( + ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */ + ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */ + ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */ + ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */ + (sa_bits & 0x10) | /* Bit 4 -> Sa4 */ + 0xe0 + );
return 0; }