Skip to content

Commit

Permalink
FHSS: Added callbacks for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Aug 28, 2018
1 parent f39312b commit 0206fc8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@

// Enable this flag to use channel traces
// #define FHSS_CHANNEL_DEBUG
// Enable this flag to use debug callbacks
// #define FHSS_CHANNEL_DEBUG_CBS

#ifdef FHSS_CHANNEL_DEBUG_CBS
void (*fhss_uc_switch)(void) = NULL;
void (*fhss_bc_switch)(void) = NULL;
#endif /*FHSS_CHANNEL_DEBUG_CBS*/

#define DEF_2E24 0x1000000
#define IE_HEADER_LENGTH_MASK 0x007f
Expand Down Expand Up @@ -135,6 +142,11 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay)
#endif /*FHSS_CHANNEL_DEBUG*/
}
fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel);
#ifdef FHSS_CHANNEL_DEBUG_CBS
if (fhss_bc_switch) {
fhss_bc_switch();
}
#endif /*FHSS_CHANNEL_DEBUG_CBS*/
fhss_ws_start_tx_poll_timer(fhss_structure, fhss_structure->callbacks.read_tx_queue_size(fhss_structure->fhss_api, true),
fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval);
}
Expand Down Expand Up @@ -255,6 +267,11 @@ static void fhss_ws_update_uc_channel_callback(fhss_structure_t *fhss_structure)
tr_info("%"PRIu32" UC %u %u", fhss_structure->platform_functions.fhss_get_timestamp(fhss_structure->fhss_api), next_channel, fhss_structure->ws->uc_slot);
#endif /*FHSS_CHANNEL_DEBUG*/
fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel);
#ifdef FHSS_CHANNEL_DEBUG_CBS
if (fhss_uc_switch) {
fhss_uc_switch();
}
#endif /*FHSS_CHANNEL_DEBUG_CBS*/
}

static int fhss_ws_tx_handle_callback(const fhss_api_t *api, bool is_broadcast_addr, uint8_t *destination_address, int frame_type, uint16_t frame_length, uint8_t phy_header_length, uint8_t phy_tail_length, uint32_t tx_time)
Expand Down

0 comments on commit 0206fc8

Please sign in to comment.