Some modules are written such that they can be included
or excluded at runtime. These are added to the OPTMODULES
list in the makefile for a given board.
This change provides a mechanism to allow a build to force
a given module to be built-in (ie. always initialized)
regardless of the configuration in hwsettings.
The main use case for this is to handle a module being optional
on one platform but essential on another.
All modules added to the MODULES list in the Makefile will
automatically result in a matching #define in the form
MODULE_TheModuleName_BUILTIN
being defined in the CFLAGS for all compiled source.
Note that the capitalization of TheModuleName must match
exactly the capitalization used in the MODULES list.
TelemetrySettings object removed (saved 200+ bytes of RAM). Telemetry
port speed moved to the HwSettings object. Added GPS port speed setting.
GCS code updated to reflect changes and support both fields.
This allows the spektrum and sbus receiver drivers to bind
directly to the usart layer using a properly exported API
rather than overriding the interrupt handler.
Bytes are now pushed directly from the usart layer into the
com layer without any buffering. The com layer performs all
of the buffering.
A further benefit from this approach is that we can put all
blocking/non-blocking behaviour into the COM layer and not
in the underlying drivers.
Misc related changes:
- Remove obsolete .handler field from irq configs
- Adapt all users of PIOS_COM_* functions to new API
- Fixup callers of PIOS_USB_HID_Init()
Also implement some ordering (quite ugly still) in the module init and task creation order so we can decide which module to start/init first
and which module to start/init last.
This will be replaced/adapter with the uavobject list later (once it's implemented).
reserving some space for module init and task create parameters to customize module/task creation (this will be usefull once we get the list and customization from customer).
Changes have been made for OP and CC. Tested comped with CC,OP, sim_posix.
Only ran on bench with CC for couple of minutes (code increase expected but no dropping of stack which is good).
This gives task creation at the time wherethe all heap is available.
- create linker section for those <module>Initialize()
- later this list will incorporate parameters as well. (this probably will be more a OP feature to swap/remove/delete module on the fly.
- this is not done at compile time anymore by Makefile.
- this will allow us to have control on the module start at run-time (not implemented but build the ground for it).
- this simplify the startup (Part of code re-org).
- this change does not affect sim_posix and win32 (since they don't need that)
- ensure it's compiling for PiOS.posix
- port to PiOS.win32 but not tested (not compiled)
- tested on CC
- compile on OP.
- this free ~200 bytes.
- current avalable bytes (is we keep the same remaining bytes on the stack than before) is easily passed the 1.2Ko mark on CC with new gcc (4.5.2)
- this does not include init-reorg for each module (I still think more can be freed)
Sometimes corrupted NMEA messages can get passed the NMEA "CRC" check and this caused the NEMA parser to crash because it assumed that the correct amount of parameters are present.
Now the NMEA message is split into its different parameters before it is passed to the message-specific parser. Hence the function-signature of the parser functions has changed and the implementations of these functions has changed.
I also decided to no longer interpret the VTG and ZDA because they do not contain more data than the other messages that are being parsed.
Not tested in flight, and could not test the TOP message.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2904 ebee16cc-31ac-478f-84a7-5cbb03baadba