Commit Graph

233 Commits

Author SHA1 Message Date
Andrew Tridgell 4705be97bf AP_HAL: support %lld and %llu in internal printf
useful for log messages with 64 bit timestamps
2015-05-27 11:54:17 +10:00
Andrew Tridgell 1a2b02a563 AP_HAL: removed AVR special case
no longer needed
2015-05-26 14:34:13 +10:00
Lucas De Marchi 84f399ec3c APMrover2: Start using new Functor implementation
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
2015-05-26 13:46:55 +10:00
Lucas De Marchi 20ef7efaf6 AP_HAL: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:55 +10:00
Lucas De Marchi 9f0af5b9cb AP_HAL: add fallback implementation of functor macros 2015-05-26 13:46:51 +10:00
Lucas De Marchi 83efb9280b AP_HAL: use variadic templates in FastDelegate
Now that we are using C++11 we can use variadic templates to simplify
the FastDelegate classes. It also simplifies moving away from the
FastDelegate implementation.
2015-05-26 13:46:51 +10:00
Lucas De Marchi 4b5cf24a81 Allow to change to functor implementation
Start to add code behind APM_BUILD_FUNCTOR to support changing the
functor implementation (without breaking the build while the change is
not complete).
2015-05-26 13:46:49 +10:00
Lucas De Marchi a1e1503e1a AP_HAL: Add Functor implementation
This is a Functor implementation that should cover the use cases we have
for FastDelegate. In contrary to the latter, it can be constructed at
compile time so the compiler can safely put it in a read-only section
which covers the cases in which we are not using it.
2015-05-26 13:46:49 +10:00
Andrew Tridgell 9336914598 AP_HAL: added sendto socket method 2015-05-22 16:07:44 +10:00
Andrew Tridgell d57fcf7e46 AP_HAL: added workaround for AVR delegates in PROGMEM 2015-05-21 07:48:45 +10:00
Andrew Tridgell be587beedc AP_HAL: disable nagle on sockets for faster local operation 2015-05-21 07:48:45 +10:00
Randy Mackay 0d72f3ac29 AP_HAL: fix example sketches 2015-05-12 14:42:15 +09:00
Andrew Tridgell 414f4125de AP_HAL: use FD_CLOEXEC to prevent sockets being inherited in SITL 2015-05-11 08:05:51 +10:00
Andrew Tridgell 692fc18698 AP_HAL: protect Socket.h from double include 2015-05-10 21:02:04 +10:00
Tom Pittenger 4b6d0d8e24 AP_HAL: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Andrew Tridgell 2369e06815 AP_HAL: fixed SITL build on windows 2015-05-06 09:07:03 +10:00
Andrew Tridgell 4c11002976 AP_HAL: added HAL_OS_SOCKETS define
used for systems with BSD sockets
2015-05-05 21:34:19 +10:00
Andrew Tridgell 08b9ed3342 AP_HAL: added socket handling class 2015-05-05 21:34:19 +10:00
Andrew Tridgell 35d22b9d57 AP_HAL: added getopt_cpp class
a simple port of getopt_long to C++
2015-05-05 09:45:58 +10:00
Andrew Tridgell 40e3b422b5 HAL_SITL: rename HAL_AVR_SITL to HAL_SITL
it is nothing to do with the original AVR emulation now
2015-05-05 09:45:54 +10:00
Andrew Tridgell df21c6c68d AP_HAL: support micros64() and millis64() on all platforms
this will allow for 64 bit timestamps in DF logs (Peter is working on
that)
2015-04-30 12:17:34 +10:00
Mikhail Avkhimenia 7ba6a5e346 AP_HAL: Specify terrain directory for Navio 2015-04-14 10:16:25 +10:00
Andrew Tridgell 55019abd71 AP_HAL: allow for default parameter override for PX4 and SITL 2015-04-04 09:01:40 -07:00
Andrew Tridgell b52918331a AP_HAL: make PXF use AK8963 compass by default 2015-03-13 18:46:15 +11:00
Andrew Tridgell d186b82edc AP_HAL: consolidate AK8963 defines 2015-03-13 18:46:15 +11:00
mirkix 4f1dd85e47 AP_HAL: Add test sketch for RC input to RC output pass through 2015-03-11 21:14:15 +09:00
Andrew Tridgell c63540f7b1 AP_HAL: added delay_microseconds_boost()
this will be used by wait_for_sample() to boost priority for a short
period at the end of each delay_microseconds()
2015-02-16 11:52:37 +11:00
Jonathan Challinger aa7776ea59 AP_HAL: add soft_armed state to hal.util 2015-02-11 20:25:10 +11:00
Grant Morphett 525787078f AP_HAL: Changes to fix the warnings in rover sitl build.
We are starting the process of resolving all the warnings in the
ardupilot builds of all vehicles and platforms.
2015-02-11 18:16:45 +11:00
Andrew Tridgell 3075cb058d AP_HAL: changed semantics of RCInput.new_input()
this makes calling new_input() in RCInput clear the new input
flag. This fixes an issue with calls to read() for auxillary channels
clearing the new_input flag, which could cause brief failsafe
conditions.
2015-02-09 10:39:05 +11:00
Emile Castelnuovo a0673b56f9 AP_HAL: added new VRBRAIN boards and new subtypes 2015-02-02 08:43:58 +11:00
LukeMike edd0f13845 AP_HAL: mapped the different sizes of storage for all VR boards 2015-02-02 08:43:58 +11:00
Randy Mackay f84d31b838 HAL: fix example sketch 2015-01-28 17:15:40 +09:00
mirkix d11c5286c3 AP_HAL: HAL_COMPASS_AK8963 used but not defined anywhere 2015-01-22 14:35:51 +11:00
mirkix 7ceb93befa AP_HAL: make the examples usable with Linux 2015-01-22 14:30:47 +11:00
mirkix 70445d11f6 AP_HAL: add support for BBBMINI, simple ArduPilot DIY Cape for the BeagleBone Black 2015-01-12 21:36:40 +13:00
Andrew Tridgell 6fb00f4fc3 AP_HAL: create a common utility/RingBuffer.h header 2015-01-07 08:41:14 +11:00
Staroselskii Georgii a08a34f863 AP_HAL: changed default compass for Navio 2015-01-07 08:41:13 +11:00
Staroselskii Georgii e4a21f291d AP_HAL_Linux: added LinuxSPIUARTDriver that can handle SPI-driven Ublox 2015-01-07 08:41:12 +11:00
Andrew Tridgell 6993be54b7 HAL_Linux: raise storage size to 16k
match PX4 size
2015-01-03 14:06:54 +11:00
Andrew Tridgell 5aabfd4dc4 AP_HAL: added RCInput example sketch 2014-12-02 15:49:50 +11:00
Andrew Tridgell 8e36c1cd60 AP_HAL: fixed RCOutput example 2014-12-02 15:03:59 +11:00
Andrew Tridgell 4ec6a74829 AP_HAL: addex UART_test example sketch 2014-12-02 13:14:03 +11:00
Andrew Tridgell 9e0a7e6631 AP_HAL: fixed printf example build 2014-12-02 13:14:03 +11:00
Andrew Tridgell e89d380b73 AP_HAL: added set_esc_scaling() RCOutput function
this will be used to scale outputs for uavcan ESCs based on throttle
range
2014-11-26 11:14:44 +11:00
bugobliterator ad460659ad AP_HAL: make toneAlarm_init() return bool 2014-11-15 16:59:06 +11:00
Staroselskii Georgii bf860ee41f AP_HAL_Linux: Ublox SPI stub 2014-11-14 10:28:34 +11:00
Andrew Tridgell adcf994356 AP_HAL: added Zynq platform type 2014-11-14 10:21:04 +11:00
bugobliterator af203760bd HAL_Linux: change the return type of AP_HAL::Util::tonealarm_init() to signed int8_t.
This is a part of a set of fixes for the bugs and typos tridge discovered and shared inside earlier commits for setting up tonealarm.
2014-11-10 06:27:48 +11:00
bugobliterator fa6e83318d AP_HAL: Add virtual toneAlarm member functions to be declared under Linux_HAL 2014-11-10 06:27:48 +11:00