Skip to content

Commit 770ce00

Browse files
committed
samples: direct_test_mode: Simplify statement
Simplify the statement so that it becomes easier to understand. Signed-off-by: Rubin Gerritsen <[email protected]>
1 parent 51c54c8 commit 770ce00

File tree

1 file changed

+5
-2
lines changed
  • samples/bluetooth/direct_test_mode/src

1 file changed

+5
-2
lines changed

samples/bluetooth/direct_test_mode/src/dtm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,8 +2045,11 @@ static uint32_t dtm_packet_interval_calculate(uint32_t test_payload_length,
20452045

20462046
if (dtm_inst.cte_info.mode != DTM_CTE_MODE_OFF) {
20472047
/* Add 8 - bit S1 field with CTEInfo. */
2048-
((test_packet_length += mode) == RADIO_MODE_MODE_Ble_1Mbit) ?
2049-
8 : 4;
2048+
if (mode == NRF_RADIO_MODE_BLE_1MBIT) {
2049+
test_packet_length += 8; /* 1 byte */
2050+
} else {
2051+
test_packet_length += 4; /* 0.5 byte */
2052+
}
20502053

20512054
/* Add CTE length in us to test packet length. */
20522055
test_packet_length +=

0 commit comments

Comments
 (0)