Commit Graph

27 Commits

Author SHA1 Message Date
murata 2492b9db7e Plane: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Andrew Tridgell b83f50be0f Plane: use new SRV_Channels API 2017-01-12 17:39:37 +11:00
murata 0ee8edc29d Plane: Change from printf statement to print, println statement. 2016-11-25 15:57:15 -08:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
mirkix 5f5c200625 ArduPlane: Fix filename in header 2016-07-28 18:24:24 -03:00
Andrew Tridgell d3494d1369 Plane: don't stall EKF during baro cal 2016-05-24 17:00:56 +10:00
Tom Pittenger 1a066cadd2 Plane: fixed float->double print warning 2016-05-17 15:57:26 -07:00
dgrat 76362caee0 AP_Math: Replace wrap_* functions with template versions 2016-05-10 11:41:26 -03:00
skyscraper 7f29903287 ArduPlane: Fix up after refactoring RC_Channel class
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:16 +10:00
Andrew Tridgell a7006a7784 Plane: refactor perf variables into a structure 2016-04-21 16:45:02 +10:00
Will Sackfield fabe235130 ArduPlane: initialize the fail_test variable
* Clang complains if variables are not initialized
2016-02-29 14:14:37 +11:00
Andrew Tridgell 513d5c17b9 Plane: allow for settable main loop rate 2015-12-27 14:57:19 +09:00
Jonathan Challinger 05eb723429 Plane: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Lucas De Marchi d1be74c87e ArduPlane: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi d40349d6ae ArduPlane: fix wrong printf format for 32 bits
Heading is a 32 bits value, so use %d.
2015-10-30 14:35:38 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi a964ac38ec Replace use of print_P() with print() 2015-10-30 14:35:21 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Gustavo Jose de Sousa 2cc07d2899 ArduPlane: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:06 +09:00
Randy Mackay 6da53ae3b2 Plane: replace SKIP_GYRO_CAL with INS_GYR_CAL
Also calibrate gyros with accel cal and set trim
2015-09-21 17:06:43 +09:00
Staroselskii Georgii db94c8d53d Plane: make Plane use milligauss 2015-09-09 10:38:16 +10:00
Grant Morphett c5c74eebfc Plane: Using the existing function to check for throttle failsafe
No need to duplicate the code if we have an existing function for this
sort of thing.
2015-09-09 10:28:02 +10:00
Grant Morphett a1b96f659b Plane: Fixing issue 302
Using the configured FS_THR_VALUE to check for failsafe instead of
just checking against 50 below throttle min.
2015-09-09 10:28:02 +10:00
Andrew Tridgell b92c2409e4 Plane: added local millis() and micros() to reduce code size a bit 2015-05-21 07:48:53 +10:00
Andrew Tridgell 18c37935c9 Plane: convert from .pde to .cpp files 2015-05-21 07:48:52 +10:00