Commit Graph

383 Commits

Author SHA1 Message Date
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
Randy Mackay ca942f39dd AP_Motors_Heli: remove unused allow_arming check 2015-10-27 09:14:40 +09:00
Caio Marcelo de Oliveira Filho 417651b1dc AP_Motors: remove unnecessary board includes from examples 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Lucas De Marchi f43f6c53f7 AP_Motors: Group writes to motors
Surround calls to rcout->write() with rcout->cork() and rcout->push().
If the RCOutput implementation allows the writes are grouped and only
sent together to the underlying hardware.
2015-10-06 10:42:18 +11:00
Lucas De Marchi e938075581 AP_MotorsCoax: get rid of _motor_to_channel_map 2015-09-29 12:01:41 +09:00
Lucas De Marchi ec4ebfde83 AP_MotorsSingle: get rid of _motor_to_channel_map 2015-09-29 12:01:28 +09:00
Lucas De Marchi 537599c01b AP_MotorsTri: get rid of _motor_to_channel_map 2015-09-29 12:01:14 +09:00
Lucas De Marchi 1572c9d4f4 AP_MotorsMatrix: get rid of _motor_to_channel_map 2015-09-29 12:00:56 +09:00
Lucas De Marchi 43268b9822 AP_MotorsHeli: get rid of _motor_to_channel_map 2015-09-29 12:00:18 +09:00
Lucas De Marchi 7ea141b774 AP_Motors_Multi: get rid of _motor_to_channel_map 2015-09-29 11:59:48 +09:00
Lucas De Marchi d97d97dc54 AP_Motors: get rid of _motor_to_channel_map
This was only used for supporting APM1. The removal was mostly automatic
with:

    sed -i 's/pgm_read_byte(&_motor_to_channel_map\[\([^]]*\)\])/\1/g' libraries/AP_Motors/*.cpp
    sed -i 's/_motor_to_channel_map\[\([^]]*\)\]/\1/g' libraries/AP_Motors/*.cpp

And then remove references to MOTOR_TO_CHANNEL_MAP and
_motor_to_channel_map and make sure the variable used in shifts is
unsigned
2015-09-29 11:59:25 +09:00
Andrew Tridgell f22a1d3e6d AP_Motors: display message in heli parameter_check() 2015-09-25 12:30:34 +10:00
Andrew Tridgell 9da2b2b430 AP_Motors: added H_GYR_GAIN_ACRO 2015-09-25 12:30:33 +10:00
Randy Mackay 1024790633 MotorsMulti: add throttle_max accessor 2015-09-07 15:10:02 +09:00
Randy Mackay e3ff4ed9c4 MotorsHeli: integrate RotorControlState 2015-08-31 11:43:59 +09:00
Randy Mackay cb47311416 MotorsHeli_RSC: add RotorControlMode enum 2015-08-31 11:43:58 +09:00
Randy Mackay 72efc85ee8 MotorsHeli_RSC: RotorControlState enum 2015-08-31 11:43:57 +09:00
Robert Lefebvre bde43412d8 AP_MotorsHeli: Fix RSC Mode 3 2015-08-31 11:43:55 +09:00
Robert Lefebvre 38ccd6e04f AP_MotorsHeli_RSC: Fix tail_type control 2015-08-31 11:43:54 +09:00
Robert Lefebvre 535da1d79a AP_MotorsHeli_Single: DDVPT to use it's own ramp and runup times 2015-08-31 11:43:51 +09:00
Robert Lefebvre 28318c4116 AP_MotorsHeli: Move Output functions into parent class 2015-08-31 11:43:50 +09:00
Robert Lefebvre 84102c3e3f AP_MotorsHeli: Rework how servo setup is done. 2015-08-31 11:43:49 +09:00
Robert Lefebvre 345663f705 AP_MotorsHeli: Simplify servo init/reset 2015-08-31 11:43:48 +09:00
Robert Lefebvre b11600aebe AP_MotorsHeli: Move set_delta_phase_angle into _Single class 2015-08-31 11:43:47 +09:00
Robert Lefebvre 3756c6b3f3 AP_MotorsHeli: Create RSC Throttle Curve mode for controlling gas engines. 2015-08-31 11:43:45 +09:00
Robert Lefebvre f853979816 AP_MotorsHeli: run RSC Control function in Output Min function
Move Output_Min() function into Heli_Single class as it will eventually be overloaded by other helicopter class types.
2015-08-31 11:43:44 +09:00
Robert Lefebvre 315f0408ae AP_MotorsHeli: RSC controller to use speed ramp as simple float scalar 2015-08-31 11:27:52 +09:00
Robert Lefebvre 91c7663ca2 AP_MotorsHeli: Set range of new RSC Servo object. 2015-08-31 11:27:51 +09:00
Robert Lefebvre cefa0c28a6 AP_MotorsHeli: RSC Mode 0 no longer a valid mode 2015-08-31 11:27:48 +09:00
Robert Lefebvre 981c96d8bc AP_MotorsHeli: Add more parameter checks 2015-08-31 11:27:47 +09:00
Robert Lefebvre ed08e9d531 AP_MotorsHeli_RSC: Split out rotor speed estimate into it's own function 2015-08-31 11:27:46 +09:00
Robert Lefebvre 064cc63512 AP_MotorsHeli: Colyaw function to check if rotor speed control is above idle 2015-08-31 11:27:45 +09:00
Robert Lefebvre 77e4bf39aa AP_MotorsHeli: rework RSC output() function to implement idle speed function
Also, split out speed_ramp function
2015-08-31 11:27:44 +09:00
Robert Lefebvre c3e7eed299 AP_MotorsHeli_Single: Fix recalc_scalars function 2015-08-31 11:27:42 +09:00
Robert Lefebvre 214d60abb9 AP_MotorsHeli: Create RSC_IDLE param 2015-08-31 11:27:41 +09:00
Robert Lefebvre 27f8d6bcd5 AP_MotorsHeli: Change RSC output() function into a state machine. 2015-08-31 11:27:40 +09:00
Robert Lefebvre 10b0be9e75 AP_MotorsHeli: Fully detail tradheli output functions and move manual servo handling 2015-08-31 11:27:39 +09:00
Robert Lefebvre 7dda0f651a AP_MotorsHeli: Rename tradheli servo objects for clarity 2015-08-31 11:27:38 +09:00
Robert Lefebvre 457d939e77 AP_MotorsHeli: Update includes so that it builds 2015-08-31 11:27:37 +09:00
Fredrik Hedberg e6119cf51f AP_Motors: Fix param indices in AP_MotorsHeli. 2015-08-31 11:27:36 +09:00
Fredrik Hedberg 411947ea7c AP_Motors: Rename output_yaw to move_yaw in AP_MotorsHeli_Single. 2015-08-31 11:27:35 +09:00
Fredrik Hedberg 1e8be73a27 AP_Motors: Fix formatting in AP_MotorsHeli_RSC. 2015-08-31 11:27:34 +09:00
Fredrik Hedberg e6957df54a AP_Motors: Fix param range comment in AP_MotorsHeli. 2015-08-31 11:27:33 +09:00
Fredrik Hedberg 97e09fa9b0 AP_Motors: Move traditional helicopter controls into AP_MotorsHeli_Single.
Original commit by fhedberg, had to fix merge conflicts and now it appears I did the commit?
2015-08-31 11:27:31 +09:00
Fredrik Hedberg af69a20ba5 AP_Motors: Break out yaw output in AP_MotorsHeli. 2015-08-31 11:27:30 +09:00
Fredrik Hedberg feb32f40ed AP_Motors: Break out servo init and reset in AP_MotorsHeli. 2015-08-31 11:27:29 +09:00
Fredrik Hedberg ae9a16dc27 AP_Motors: Move rotor speed control into AP_MotorsHeli_RSC. 2015-08-31 11:27:28 +09:00