HAL_AVR: use memcheck for available_memory()

This commit is contained in:
Andrew Tridgell 2013-12-28 14:51:15 +11:00
parent 172398a971
commit 75cb04dd8b
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "Scheduler.h" #include "Scheduler.h"
#include "utility/ISRRegistry.h" #include "utility/ISRRegistry.h"
#include "memcheck.h"
using namespace AP_HAL_AVR; using namespace AP_HAL_AVR;
extern const AP_HAL::HAL& hal; extern const AP_HAL::HAL& hal;
@ -53,6 +54,8 @@ void AVRScheduler::init(void* _isrregistry) {
/* Turn on global interrupt flag, AVR interupt system will start from this point */ /* Turn on global interrupt flag, AVR interupt system will start from this point */
sei(); sei();
memcheck_init();
} }
uint32_t AVRScheduler::micros() { uint32_t AVRScheduler::micros() {

View File

@ -4,10 +4,12 @@
#include <AP_HAL.h> #include <AP_HAL.h>
#include "AP_HAL_AVR_Namespace.h" #include "AP_HAL_AVR_Namespace.h"
#include "memcheck.h"
class AP_HAL_AVR::AVRUtil : public AP_HAL::Util { class AP_HAL_AVR::AVRUtil : public AP_HAL::Util {
public: public:
bool run_debug_shell(AP_HAL::BetterStream *stream) { return false; } bool run_debug_shell(AP_HAL::BetterStream *stream) { return false; }
uint16_t available_memory(void) { return memcheck_available_memory(); }
}; };
#endif // __AP_HAL_AVR_UTIL_H__ #endif // __AP_HAL_AVR_UTIL_H__