|
22 | 22 | #include "Service_Libs/fhss/fhss.h"
|
23 | 23 | #include "Service_Libs/fhss/fhss_channel.h"
|
24 | 24 | #include "Service_Libs/fhss/fhss_beacon.h"
|
| 25 | +#include "platform/arm_hal_interrupt.h" |
25 | 26 | #include "randLIB.h"
|
26 | 27 | #include "ns_trace.h"
|
27 | 28 |
|
@@ -124,10 +125,12 @@ void fhss_receive_frame_cb(const fhss_api_t *api, uint16_t pan_id, uint8_t *sour
|
124 | 125 | if (!fhss_compare_with_synch_parent_address(fhss_structure, source_address)) {
|
125 | 126 | // Synch parent address needs to be updated in case parent has changed
|
126 | 127 | fhss_update_synch_parent_address(fhss_structure);
|
| 128 | + platform_enter_critical(); |
127 | 129 | // Calculate time since the Beacon was received
|
128 | 130 | uint32_t elapsed_time = api->read_timestamp(api) - timestamp;
|
129 | 131 | // Synchronize to given PAN
|
130 | 132 | fhss_beacon_received(fhss_structure, synch_info, elapsed_time);
|
| 133 | + platform_exit_critical(); |
131 | 134 | }
|
132 | 135 | }
|
133 | 136 | } else if (FHSS_SYNCH_REQUEST_FRAME == frame_type) {
|
@@ -220,10 +223,12 @@ void fhss_synch_state_set_cb(const fhss_api_t *api, fhss_states fhss_state, uint
|
220 | 223 | fhss_beacon_info_t *beacon_info = fhss_get_beacon_info(fhss_structure, pan_id);
|
221 | 224 | if (beacon_info) {
|
222 | 225 | memcpy(fhss_structure->synch_parent, beacon_info->source_address, 8);
|
| 226 | + platform_enter_critical(); |
223 | 227 | // Calculate time since the Beacon was received
|
224 | 228 | uint32_t elapsed_time = api->read_timestamp(api) - beacon_info->timestamp;
|
225 | 229 | // Synchronize to given PAN
|
226 | 230 | fhss_beacon_received(fhss_structure, beacon_info->synch_info, elapsed_time);
|
| 231 | + platform_exit_critical(); |
227 | 232 | // Delete stored Beacon infos
|
228 | 233 | fhss_flush_beacon_info_storage(fhss_structure);
|
229 | 234 | fhss_structure->synch_panid = pan_id;
|
|
0 commit comments