AP_Progmem: check for PX4FMU_BUILD explicitly

This commit is contained in:
Andrew Tridgell 2012-10-27 22:41:45 +11:00
parent 3a2e138994
commit 28353cd683
2 changed files with 7 additions and 4 deletions

View File

@ -6,8 +6,10 @@
#include "AP_Progmem_AVR.h" #include "AP_Progmem_AVR.h"
#elif defined(DESKTOP_BUILD) #elif defined(DESKTOP_BUILD)
#include "AP_Progmem_DesktopBuild.h" #include "AP_Progmem_DesktopBuild.h"
#else #elif defined(PX4FMU_BUILD)
#include "AP_Progmem_Identity.h" #include "AP_Progmem_Identity.h"
#else
#error "this build type is unknown"
#endif #endif
#define PROGMEM_STRING(_v, _s) static const char _v[] PROGMEM = _s #define PROGMEM_STRING(_v, _s) static const char _v[] PROGMEM = _s

View File

@ -6,9 +6,10 @@
#define SITL_debug(fmt, args ...) #define SITL_debug(fmt, args ...)
typedef prog_char_t char; typedef char prog_char_t;
typedef char prog_char;
#define PSTR(s) s; #define PSTR(s) s
static inline int strcasecmp_P(const char *str1, const prog_char_t *pstr) static inline int strcasecmp_P(const char *str1, const prog_char_t *pstr)
{ {
@ -40,7 +41,7 @@ static inline char *strncpy_P(char *buffer, const prog_char_t *pstr, size_t buff
// read something the size of a pointer. This makes the menu code more // read something the size of a pointer. This makes the menu code more
// portable // portable
static inline uintptr_t pgm_read_pointer(const void *s) { static inline uintptr_t pgm_read_pointer(const void *s) {
return &((uintptr_t*)s) return *(const uintptr_t *)s;
} }
#endif // __AP_PROGMEM_IDENTITY__ #endif // __AP_PROGMEM_IDENTITY__