|
34 | 34 |
|
35 | 35 | // Enable this flag to use channel traces |
36 | 36 | // #define FHSS_CHANNEL_DEBUG |
| 37 | +// Enable this flag to use debug callbacks |
| 38 | +// #define FHSS_CHANNEL_DEBUG_CBS |
| 39 | + |
| 40 | +#ifdef FHSS_CHANNEL_DEBUG_CBS |
| 41 | +void (*fhss_uc_switch)(void) = NULL; |
| 42 | +void (*fhss_bc_switch)(void) = NULL; |
| 43 | +#endif /*FHSS_CHANNEL_DEBUG_CBS*/ |
37 | 44 |
|
38 | 45 | #define DEF_2E24 0x1000000 |
39 | 46 | #define IE_HEADER_LENGTH_MASK 0x007f |
@@ -135,6 +142,11 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay) |
135 | 142 | #endif /*FHSS_CHANNEL_DEBUG*/ |
136 | 143 | } |
137 | 144 | fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel); |
| 145 | +#ifdef FHSS_CHANNEL_DEBUG_CBS |
| 146 | + if (fhss_bc_switch) { |
| 147 | + fhss_bc_switch(); |
| 148 | + } |
| 149 | +#endif /*FHSS_CHANNEL_DEBUG_CBS*/ |
138 | 150 | fhss_ws_start_tx_poll_timer(fhss_structure, fhss_structure->callbacks.read_tx_queue_size(fhss_structure->fhss_api, true), |
139 | 151 | fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval); |
140 | 152 | } |
@@ -255,6 +267,11 @@ static void fhss_ws_update_uc_channel_callback(fhss_structure_t *fhss_structure) |
255 | 267 | tr_info("%"PRIu32" UC %u %u", fhss_structure->platform_functions.fhss_get_timestamp(fhss_structure->fhss_api), next_channel, fhss_structure->ws->uc_slot); |
256 | 268 | #endif /*FHSS_CHANNEL_DEBUG*/ |
257 | 269 | fhss_structure->callbacks.change_channel(fhss_structure->fhss_api, next_channel); |
| 270 | +#ifdef FHSS_CHANNEL_DEBUG_CBS |
| 271 | + if (fhss_uc_switch) { |
| 272 | + fhss_uc_switch(); |
| 273 | + } |
| 274 | +#endif /*FHSS_CHANNEL_DEBUG_CBS*/ |
258 | 275 | } |
259 | 276 |
|
260 | 277 | 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) |
|
0 commit comments