mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
Add a new macro PROGMEM_STRING that can be used to define a constant string in program memory.
This is a partial workaround for not being able to use PSTR at global scope, e.g. in an argument to a constructor; it makes the intent of the otherwise somewhat bulky declaration of the string more obvious. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1464 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
afc68ba45c
commit
adb54428da
@ -68,9 +68,18 @@
|
||||
#endif
|
||||
//@}
|
||||
|
||||
|
||||
///
|
||||
/// @name Macros
|
||||
/// @{
|
||||
|
||||
/// Define a constant string in program memory. This is a little more obvious
|
||||
/// and less error-prone than typing the declaration out by hand. It's required
|
||||
/// when passing PROGMEM strings to static object constructors because the PSTR
|
||||
/// hack can't be used at global scope.
|
||||
///
|
||||
#define PROGMEM_STRING(_v, _s) static const char _v[] PROGMEM = _s
|
||||
|
||||
#define ToRad(x) (x*0.01745329252) // *pi/180
|
||||
#define ToDeg(x) (x*57.2957795131) // *180/pi
|
||||
// @}
|
||||
|
Loading…
Reference in New Issue
Block a user