RADIO: Prevent clang build warning

clang will warn if in the ifs below, as in case
no condition is true, the variables are not set.
But the condition in checked before entering the function.
Nontheless, let's just start setting them all to zero to
silence it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-09-13 12:58:18 +02:00
parent 5aac1c2b8e
commit 8f485bcfd3
2 changed files with 12 additions and 12 deletions

View File

@ -737,10 +737,10 @@ static void start_Tx(void) {
nrfra_check_packet_conf();
//TOLOW: Add support for other packet formats and bitrates
uint8_t preamble_len;
uint8_t address_len;
uint8_t header_len;
uint payload_len;
uint8_t preamble_len = 0;
uint8_t address_len = 0;
uint8_t header_len = 0;
uint payload_len = 0;
uint8_t crc_len = nrfra_get_crc_length();
if (NRF_RADIO_regs.MODE == RADIO_MODE_MODE_Ble_1Mbit) {
@ -836,7 +836,7 @@ static void Rx_handle_address_end_response(bs_time_t address_time) {
//TODO: Discard Ieee802154_250Kbit frames with length == 0
bs_time_t payload_end;
bs_time_t payload_end = 0;
if ((NRF_RADIO_regs.MODE == RADIO_MODE_MODE_Ble_1Mbit)
|| (NRF_RADIO_regs.MODE == RADIO_MODE_MODE_Ble_2Mbit)) {

View File

@ -211,15 +211,15 @@ int nrfra_is_HW_TIFS_enabled(void) {
void nrfra_prep_rx_request(p2G4_rxv2_t *rx_req, p2G4_address_t *rx_addresses) {
//TOLOW: Add support for other packet formats and bitrates
uint8_t preamble_length;
uint8_t address_length;
uint8_t header_length;
uint64_t address;
bs_time_t pre_trunc;
uint16_t sync_threshold;
uint8_t preamble_length = 0;
uint8_t address_length = 0;
uint8_t header_length = 0;
uint64_t address = 0;
bs_time_t pre_trunc = 0;
uint16_t sync_threshold = 0;
uint32_t freq_off = NRF_RADIO_regs.FREQUENCY & RADIO_FREQUENCY_FREQUENCY_Msk;
double bits_per_us;
double bits_per_us = 0;
if ((NRF_RADIO_regs.MODE == RADIO_MODE_MODE_Ble_1Mbit)
|| (NRF_RADIO_regs.MODE == RADIO_MODE_MODE_Ble_2Mbit)