diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2024-04-29 23:32:06 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2024-04-30 00:31:37 +0200 |
commit | 2c0f3fd1e362b1e8f01c4ed15c7173fb1642d7de (patch) | |
tree | 432e883709f583963f8b5760c20a0cf3bd3408d0 /src | |
parent | 21e5cac177896df14d697e35a6e9ca13638f0057 (diff) |
ctl: When setting Sa bits, other bits must remain set to '1'tnt/work
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
Diffstat (limited to 'src')
-rw-r--r-- | src/ctl.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -452,11 +452,14 @@ _e1d_ctl_sabits(void *data, struct msgb *msgb, struct msgb *rmsgb, int *rfd) 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; } |