mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -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
|
||||
#define _AP_COMMON_H
|
||||
|
||||
#include <string.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#ifndef EXCLUDECORE
|
||||
// Get the common arduino functions
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
@ -24,6 +28,7 @@
|
||||
// ... and remove some of their stupid macros
|
||||
#undef round
|
||||
#undef abs
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
@ -8,12 +8,16 @@
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "c++.h"
|
||||
|
||||
#ifndef EXCLUDECORE
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void * operator new(size_t size)
|
||||
{
|
||||
@ -32,8 +36,10 @@ extern "C" void __cxa_pure_virtual()
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
#ifndef EXCLUDECORE
|
||||
Serial.println("Error: pure virtual call");
|
||||
delay(1000);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,8 +80,10 @@ void displayMemory()
|
||||
static int minMemFree=0;
|
||||
if (minMemFree<=0 || freeMemory()<minMemFree) {
|
||||
minMemFree = freeMemory();
|
||||
#ifndef EXCLUDECORE
|
||||
Serial.print("bytes free: ");
|
||||
Serial.println(minMemFree);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user