mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 14:08:52 +08:00
syslink_main: fix int type passed to param_get()
This commit is contained in:
@@ -190,7 +190,7 @@ Syslink::update_params(bool force_set)
|
||||
|
||||
// reading parameter values into temp variables
|
||||
|
||||
uint32_t channel, rate, addr1, addr2;
|
||||
int32_t channel, rate, addr1, addr2;
|
||||
uint64_t addr = 0;
|
||||
|
||||
param_get(_param_radio_channel, &channel);
|
||||
@@ -198,7 +198,8 @@ Syslink::update_params(bool force_set)
|
||||
param_get(_param_radio_addr1, &addr1);
|
||||
param_get(_param_radio_addr2, &addr2);
|
||||
|
||||
memcpy(&addr, &addr2, 4); memcpy(((char *)&addr) + 4, &addr1, 4);
|
||||
memcpy(&addr, &addr2, 4);
|
||||
memcpy(((char *)&addr) + 4, &addr1, 4);
|
||||
|
||||
|
||||
hrt_abstime t = hrt_absolute_time();
|
||||
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
int _params_sub;
|
||||
|
||||
// Current parameter values
|
||||
uint32_t _channel, _rate;
|
||||
int32_t _channel, _rate;
|
||||
uint64_t _addr;
|
||||
hrt_abstime _params_update[3]; // Time at which the parameters were updated
|
||||
hrt_abstime _params_ack[3]; // Time at which the parameters were acknowledged by the nrf module
|
||||
|
||||
Reference in New Issue
Block a user