Refactor code and make shorter through ternary operator
This commit is contained in:
@@ -644,14 +644,8 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports)
|
|||||||
|
|
||||||
frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
|
frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
|
||||||
{
|
{
|
||||||
frame_type_t current_type;
|
|
||||||
int32_t delta_duplex = get_delta_duplex(current_band, scs_index);
|
int32_t delta_duplex = get_delta_duplex(current_band, scs_index);
|
||||||
|
frame_type_t current_type = delta_duplex == 0 ? TDD : FDD;
|
||||||
if (delta_duplex == 0)
|
|
||||||
current_type = TDD;
|
|
||||||
else
|
|
||||||
current_type = FDD;
|
|
||||||
|
|
||||||
LOG_D(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
LOG_D(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||||
return current_type;
|
return current_type;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user