AirModeYaw - Change airmode type from bool to int

This commit is contained in:
bresch
2018-12-13 09:50:07 +01:00
committed by Beat Küng
parent b2fd8abf9e
commit 7cc00f41d2
12 changed files with 33 additions and 39 deletions
+4 -6
View File
@@ -116,7 +116,7 @@ static void subscribe();
static void task_main(int argc, char *argv[]);
static void update_params(bool &airmode);
static void update_params(int32_t &airmode);
/* mixer initialization */
int initialize_mixer(const char *mixer_filename);
@@ -135,15 +135,13 @@ int mixer_control_callback(uintptr_t handle,
}
void update_params(bool &airmode)
void update_params(int32_t &airmode)
{
// multicopter air-mode
param_t param_handle = param_find("MC_AIRMODE");
if (param_handle != PARAM_INVALID) {
int32_t val;
param_get(param_handle, &val);
airmode = val > 0;
param_get(param_handle, (int32_t *)&airmode);
}
}
@@ -257,7 +255,7 @@ void task_main(int argc, char *argv[])
// subscribe and set up polling
subscribe();
bool airmode = false;
int32_t airmode = false;
update_params(airmode);
int params_sub = orb_subscribe(ORB_ID(parameter_update));