2016-02-17 21:25:28 -04:00
|
|
|
#pragma once
|
2012-12-18 21:13:01 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2015-05-04 03:15:12 -03:00
|
|
|
#include "AP_HAL_SITL_Namespace.h"
|
2018-08-07 03:39:42 -03:00
|
|
|
#include "AP_HAL_SITL.h"
|
2015-12-20 16:33:11 -04:00
|
|
|
#include "Semaphores.h"
|
2012-12-18 21:13:01 -04:00
|
|
|
|
2016-01-10 02:23:32 -04:00
|
|
|
class HALSITL::Util : public AP_HAL::Util {
|
2012-12-18 21:13:01 -04:00
|
|
|
public:
|
2016-01-10 02:23:32 -04:00
|
|
|
Util(SITL_State *_sitlState) :
|
2016-01-06 18:09:40 -04:00
|
|
|
sitlState(_sitlState) {}
|
|
|
|
|
2018-11-07 06:59:48 -04:00
|
|
|
bool run_debug_shell(AP_HAL::BetterStream *stream) override {
|
2015-05-04 21:59:07 -03:00
|
|
|
return false;
|
|
|
|
}
|
2015-11-05 00:41:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
how much free memory do we have in bytes.
|
|
|
|
*/
|
|
|
|
uint32_t available_memory(void) override {
|
|
|
|
// SITL is assumed to always have plenty of memory. Return 128k for now
|
|
|
|
return 0x20000;
|
|
|
|
}
|
2015-12-20 16:33:11 -04:00
|
|
|
|
2016-01-06 18:09:40 -04:00
|
|
|
// get path to custom defaults file for AP_Param
|
|
|
|
const char* get_custom_defaults_file() const override {
|
|
|
|
return sitlState->defaults_path;
|
|
|
|
}
|
2018-04-24 09:25:25 -03:00
|
|
|
|
|
|
|
uint64_t get_hw_rtc() const override;
|
|
|
|
|
2016-01-06 18:09:40 -04:00
|
|
|
private:
|
|
|
|
SITL_State *sitlState;
|
2012-12-18 21:13:01 -04:00
|
|
|
};
|