@@ -44,23 +44,23 @@ void (*fhss_uc_switch)(void) = NULL;
44
44
void (* fhss_bc_switch )(void ) = NULL ;
45
45
#endif /*FHSS_CHANNEL_DEBUG_CBS*/
46
46
// Seconds to milliseconds
47
- #define S_TO_MS (x ) (((int32_t )x)*1000)
47
+ #define S_TO_MS (x ) (((int64_t )x)*1000)
48
48
// Milliseconds to seconds
49
49
#define MS_TO_S (x ) divide_integer(x, 1000)
50
50
// Seconds to microseconds
51
- #define S_TO_US (x ) (((int32_t )x)*1000000)
51
+ #define S_TO_US (x ) (((int64_t )x)*1000000)
52
52
// Microseconds to seconds
53
53
#define US_TO_S (x ) divide_integer(x, 1000000)
54
54
// Milliseconds to microseconds
55
- #define MS_TO_US (x ) (((int32_t )x)*1000)
55
+ #define MS_TO_US (x ) (((int64_t )x)*1000)
56
56
// Microseconds to milliseconds
57
57
#define US_TO_MS (x ) divide_integer(x, 1000)
58
58
// Milliseconds to nanoseconds
59
- #define MS_TO_NS (x ) (((int32_t )x)*1000000)
59
+ #define MS_TO_NS (x ) (((int64_t )x)*1000000)
60
60
// Nanoseconds to milliseconds
61
61
#define NS_TO_MS (x ) divide_integer(x, 1000000)
62
62
// Microseconds to nanoseconds
63
- #define US_TO_NS (x ) (((int32_t )x)*1000)
63
+ #define US_TO_NS (x ) (((int64_t )x)*1000)
64
64
// Nanoseconds to microseconds
65
65
#define NS_TO_US (x ) divide_integer(x, 1000)
66
66
#define DEF_2E24 0x1000000
@@ -86,7 +86,7 @@ static bool fhss_ws_check_tx_allowed(fhss_structure_t *fhss_structure);
86
86
static uint32_t fhss_set_txrx_slot_length (fhss_structure_t * fhss_structure );
87
87
88
88
// This function supports rounding up
89
- static int32_t divide_integer (int32_t dividend , int32_t divisor )
89
+ static int32_t divide_integer (int64_t dividend , int32_t divisor )
90
90
{
91
91
if (dividend < 0 ) {
92
92
return (dividend - divisor / 2 ) / divisor ;
@@ -821,8 +821,6 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
821
821
uint32_t prev_synchronization_time = fhss_structure -> ws -> synchronization_time ;
822
822
fhss_structure -> ws -> synchronization_time = fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api );
823
823
uint32_t time_since_last_synch_us = fhss_structure -> ws -> synchronization_time - prev_synchronization_time ;
824
- // IOTTHD-3571, temporary debug traces
825
- tr_debug ("time_since_last_synch_us: %" PRIu32 ", synchronization_time: %" PRIu32 ", prev_synchronization_time: %" PRIu32 "" , time_since_last_synch_us , fhss_structure -> ws -> synchronization_time , prev_synchronization_time );
826
824
uint32_t own_bc_interval_offset = fhss_ws_calculate_broadcast_interval_offset (fhss_structure , fhss_structure -> ws -> synchronization_time );
827
825
fhss_stop_timer (fhss_structure , fhss_broadcast_handler );
828
826
uint32_t time_from_reception_ms = US_TO_MS (fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api ) - bc_timing_info -> bt_rx_timestamp );
0 commit comments