forked from Archive/PX4-Autopilot
Merge branch 'master' of github.com:PX4/Firmware into gimbal_rc_control
This commit is contained in:
commit
7232a6f143
|
@ -98,8 +98,7 @@ else
|
||||||
mixer load /dev/pwm_output /etc/mixers/FMU_RET.mix
|
mixer load /dev/pwm_output /etc/mixers/FMU_RET.mix
|
||||||
fi
|
fi
|
||||||
fw_att_control start
|
fw_att_control start
|
||||||
# Not ready yet for prime-time
|
fw_pos_control_l1 start
|
||||||
#fw_pos_control_l1 start
|
|
||||||
|
|
||||||
if [ $EXIT_ON_END == yes ]
|
if [ $EXIT_ON_END == yes ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -91,8 +91,7 @@ att_pos_estimator_ekf start
|
||||||
#
|
#
|
||||||
mixer load /dev/pwm_output /etc/mixers/FMU_AERT.mix
|
mixer load /dev/pwm_output /etc/mixers/FMU_AERT.mix
|
||||||
fw_att_control start
|
fw_att_control start
|
||||||
# Not ready yet for prime-time
|
fw_pos_control_l1 start
|
||||||
#fw_pos_control_l1 start
|
|
||||||
|
|
||||||
if [ $EXIT_ON_END == yes ]
|
if [ $EXIT_ON_END == yes ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -103,6 +103,7 @@ private:
|
||||||
|
|
||||||
bool _running;
|
bool _running;
|
||||||
int _led_interval;
|
int _led_interval;
|
||||||
|
bool _should_run;
|
||||||
int _counter;
|
int _counter;
|
||||||
|
|
||||||
void set_color(rgbled_color_t ledcolor);
|
void set_color(rgbled_color_t ledcolor);
|
||||||
|
@ -136,6 +137,7 @@ RGBLED::RGBLED(int bus, int rgbled) :
|
||||||
_brightness(1.0f),
|
_brightness(1.0f),
|
||||||
_running(false),
|
_running(false),
|
||||||
_led_interval(0),
|
_led_interval(0),
|
||||||
|
_should_run(false),
|
||||||
_counter(0)
|
_counter(0)
|
||||||
{
|
{
|
||||||
memset(&_work, 0, sizeof(_work));
|
memset(&_work, 0, sizeof(_work));
|
||||||
|
@ -248,6 +250,11 @@ RGBLED::led_trampoline(void *arg)
|
||||||
void
|
void
|
||||||
RGBLED::led()
|
RGBLED::led()
|
||||||
{
|
{
|
||||||
|
if (!_should_run) {
|
||||||
|
_running = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
case RGBLED_MODE_BLINK_SLOW:
|
case RGBLED_MODE_BLINK_SLOW:
|
||||||
case RGBLED_MODE_BLINK_NORMAL:
|
case RGBLED_MODE_BLINK_NORMAL:
|
||||||
|
@ -409,10 +416,10 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
{
|
{
|
||||||
if (mode != _mode) {
|
if (mode != _mode) {
|
||||||
_mode = mode;
|
_mode = mode;
|
||||||
bool should_run = false;
|
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case RGBLED_MODE_OFF:
|
case RGBLED_MODE_OFF:
|
||||||
|
_should_run = false;
|
||||||
send_led_enable(false);
|
send_led_enable(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -423,7 +430,7 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGBLED_MODE_BLINK_SLOW:
|
case RGBLED_MODE_BLINK_SLOW:
|
||||||
should_run = true;
|
_should_run = true;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_led_interval = 2000;
|
_led_interval = 2000;
|
||||||
_brightness = 1.0f;
|
_brightness = 1.0f;
|
||||||
|
@ -431,7 +438,7 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGBLED_MODE_BLINK_NORMAL:
|
case RGBLED_MODE_BLINK_NORMAL:
|
||||||
should_run = true;
|
_should_run = true;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_led_interval = 500;
|
_led_interval = 500;
|
||||||
_brightness = 1.0f;
|
_brightness = 1.0f;
|
||||||
|
@ -439,7 +446,7 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGBLED_MODE_BLINK_FAST:
|
case RGBLED_MODE_BLINK_FAST:
|
||||||
should_run = true;
|
_should_run = true;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_led_interval = 100;
|
_led_interval = 100;
|
||||||
_brightness = 1.0f;
|
_brightness = 1.0f;
|
||||||
|
@ -447,14 +454,14 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGBLED_MODE_BREATHE:
|
case RGBLED_MODE_BREATHE:
|
||||||
should_run = true;
|
_should_run = true;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_led_interval = 25;
|
_led_interval = 25;
|
||||||
send_led_enable(true);
|
send_led_enable(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGBLED_MODE_PATTERN:
|
case RGBLED_MODE_PATTERN:
|
||||||
should_run = true;
|
_should_run = true;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
_brightness = 1.0f;
|
_brightness = 1.0f;
|
||||||
send_led_enable(true);
|
send_led_enable(true);
|
||||||
|
@ -466,16 +473,11 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if it should run now, start the workq */
|
/* if it should run now, start the workq */
|
||||||
if (should_run && !_running) {
|
if (_should_run && !_running) {
|
||||||
_running = true;
|
_running = true;
|
||||||
work_queue(LPWORK, &_work, (worker_t)&RGBLED::led_trampoline, this, 1);
|
work_queue(LPWORK, &_work, (worker_t)&RGBLED::led_trampoline, this, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if it should stop, then cancel the workq */
|
|
||||||
if (!should_run && _running) {
|
|
||||||
_running = false;
|
|
||||||
work_cancel(LPWORK, &_work);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -583,6 +583,15 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||||
errx(1, "unable to create logging folder, exiting.");
|
errx(1, "unable to create logging folder, exiting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *converter_in = "/etc/logging/conv.zip";
|
||||||
|
char* converter_out = malloc(120);
|
||||||
|
sprintf(converter_out, "%s/conv.zip", folder_path);
|
||||||
|
|
||||||
|
if (file_copy(converter_in, converter_out)) {
|
||||||
|
errx(1, "unable to copy conversion scripts, exiting.");
|
||||||
|
}
|
||||||
|
free(converter_out);
|
||||||
|
|
||||||
/* only print logging path, important to find log file later */
|
/* only print logging path, important to find log file later */
|
||||||
warnx("logging to directory: %s", folder_path);
|
warnx("logging to directory: %s", folder_path);
|
||||||
|
|
||||||
|
@ -1251,7 +1260,7 @@ int file_copy(const char *file_old, const char *file_new)
|
||||||
fclose(source);
|
fclose(source);
|
||||||
fclose(target);
|
fclose(target);
|
||||||
|
|
||||||
return ret;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_command(struct vehicle_command_s *cmd)
|
void handle_command(struct vehicle_command_s *cmd)
|
||||||
|
|
Loading…
Reference in New Issue