mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
AP_Common: use EXCLUDECORE macro to hack some debug messages away
This commit is contained in:
parent
7854c54880
commit
0d342a3293
@ -15,6 +15,10 @@
|
|||||||
#ifndef _AP_COMMON_H
|
#ifndef _AP_COMMON_H
|
||||||
#define _AP_COMMON_H
|
#define _AP_COMMON_H
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
#ifndef EXCLUDECORE
|
||||||
// Get the common arduino functions
|
// Get the common arduino functions
|
||||||
#if defined(ARDUINO) && ARDUINO >= 100
|
#if defined(ARDUINO) && ARDUINO >= 100
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
@ -24,6 +28,7 @@
|
|||||||
// ... and remove some of their stupid macros
|
// ... and remove some of their stupid macros
|
||||||
#undef round
|
#undef round
|
||||||
#undef abs
|
#undef abs
|
||||||
|
#endif
|
||||||
|
|
||||||
// prog_char_t is used as a wrapper type for prog_char, which is
|
// prog_char_t is used as a wrapper type for prog_char, which is
|
||||||
// a character stored in flash. By using this wrapper type we can
|
// a character stored in flash. By using this wrapper type we can
|
||||||
|
@ -8,12 +8,16 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "c++.h"
|
#include "c++.h"
|
||||||
|
|
||||||
|
#ifndef EXCLUDECORE
|
||||||
#if defined(ARDUINO) && ARDUINO >= 100
|
#if defined(ARDUINO) && ARDUINO >= 100
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#else
|
#else
|
||||||
#include "WProgram.h"
|
#include "WProgram.h"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
void * operator new(size_t size)
|
void * operator new(size_t size)
|
||||||
{
|
{
|
||||||
@ -32,8 +36,10 @@ extern "C" void __cxa_pure_virtual()
|
|||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
#ifndef EXCLUDECORE
|
||||||
Serial.println("Error: pure virtual call");
|
Serial.println("Error: pure virtual call");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,8 +80,10 @@ void displayMemory()
|
|||||||
static int minMemFree=0;
|
static int minMemFree=0;
|
||||||
if (minMemFree<=0 || freeMemory()<minMemFree) {
|
if (minMemFree<=0 || freeMemory()<minMemFree) {
|
||||||
minMemFree = freeMemory();
|
minMemFree = freeMemory();
|
||||||
|
#ifndef EXCLUDECORE
|
||||||
Serial.print("bytes free: ");
|
Serial.print("bytes free: ");
|
||||||
Serial.println(minMemFree);
|
Serial.println(minMemFree);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user