Skip to content

Commit 9cca341

Browse files
author
Jarkko Paso
committed
FHSS: Use timestamp delivered by MAC
1 parent 883eb46 commit 9cca341

File tree

1 file changed

+3
-3
lines changed
  • source/Service_Libs/fhss

1 file changed

+3
-3
lines changed

source/Service_Libs/fhss/fhss.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static int16_t fhss_synch_state_set_callback(const fhss_api_t *api, fhss_states
735735
memcpy(fhss_structure->synch_parent, beacon_info->source_address, 8);
736736
platform_enter_critical();
737737
// Calculate time since the Beacon was received
738-
uint32_t elapsed_time = fhss_structure->fhss_api->read_timestamp(fhss_structure->fhss_api) - beacon_info->timestamp;
738+
uint32_t elapsed_time = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api) - beacon_info->timestamp;
739739
// Synchronize to given PAN
740740
fhss_beacon_received(fhss_structure, beacon_info->synch_info, elapsed_time);
741741
platform_exit_critical();
@@ -1162,7 +1162,7 @@ static void fhss_receive_frame_callback(const fhss_api_t *api, uint16_t pan_id,
11621162
fhss_update_synch_parent_address(fhss_structure);
11631163
platform_enter_critical();
11641164
// Calculate time since the Beacon was received
1165-
uint32_t elapsed_time = api->read_timestamp(api) - timestamp;
1165+
uint32_t elapsed_time = fhss_structure->callbacks.read_timestamp(api) - timestamp;
11661166
// Synchronize to given PAN
11671167
fhss_beacon_received(fhss_structure, synch_info, elapsed_time);
11681168
platform_exit_critical();
@@ -1422,6 +1422,6 @@ static void fhss_beacon_tasklet_func(arm_event_s *event)
14221422
}
14231423
// Update Beacon info lifetimes
14241424
else if (event->event_type == FHSS_UPDATE_SYNCH_INFO_STORAGE) {
1425-
fhss_update_beacon_info_lifetimes(fhss_structure, fhss_read_timestamp_cb(fhss_structure->fhss_api));
1425+
fhss_update_beacon_info_lifetimes(fhss_structure, fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api));
14261426
}
14271427
}

0 commit comments

Comments
 (0)