mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
84f399ec3c
It both reduces flash size and move symbols to read-only sections. The scheduler_tasks table is one known not to be in read-only section before due to the FastDelegate implementation. Before and after this patch: APMrover2 $ size APMrover2.elf{.old,} text data bss dec hex filename 611406 4832 40920 657158 a0706 APMrover2.elf.old 609686 4824 38936 653446 9f886 APMrover2.elf APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks 0000000000696f80 B Rover::scheduler_tasks 000000000047c440 R Rover::scheduler_tasks As can be seen above, now the scheduler_tasks symbol is in a read-only data section and in all of them we decreased the total size. For APM2 we have a similar situation, but the table was already in text section because it was using plain C pointers: APMrover2 $ size APMrover2.elf{.old,} text data bss dec hex filename 189518 1038 3494 194050 2f602 APMrover2.elf.old 189216 1038 3480 193734 2f4c6 APMrover2.elf APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks 00001f92 T Rover::scheduler_tasks 00001f8a T Rover::scheduler_tasks
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
/*
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef AP_VEHICLE_H
|
|
#define AP_VEHICLE_H
|
|
/*
|
|
this header holds a parameter structure for each vehicle type for
|
|
parameters needed by multiple libraries
|
|
*/
|
|
|
|
#include <AP_Param.h>
|
|
|
|
class AP_Vehicle {
|
|
|
|
public:
|
|
/*
|
|
common parameters for fixed wing aircraft
|
|
*/
|
|
struct FixedWing {
|
|
AP_Int8 throttle_min;
|
|
AP_Int8 throttle_max;
|
|
AP_Int8 throttle_slewrate;
|
|
AP_Int8 throttle_cruise;
|
|
AP_Int8 takeoff_throttle_max;
|
|
AP_Int16 airspeed_min;
|
|
AP_Int16 airspeed_max;
|
|
AP_Int16 pitch_limit_max_cd;
|
|
AP_Int16 pitch_limit_min_cd;
|
|
AP_Int8 autotune_level;
|
|
AP_Int16 land_pitch_cd;
|
|
AP_Float land_flare_sec;
|
|
AP_Int8 stall_prevention;
|
|
};
|
|
|
|
/*
|
|
common parameters for multicopters
|
|
*/
|
|
struct MultiCopter {
|
|
AP_Int16 angle_max;
|
|
};
|
|
};
|
|
|
|
|
|
#include "AP_Vehicle_Type.h"
|
|
|
|
#endif // AP_VEHICLE_H
|