mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
AP_HAL_SITL: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
6899c0b5af
commit
dc6f5aec92
@ -73,7 +73,7 @@ bool Scheduler::in_main_thread() const
|
||||
* time (due to the logic in SITL_State::wait_clock) and thus taking
|
||||
* the semaphore never times out - meaning we essentially deadlock.
|
||||
*/
|
||||
bool Scheduler::semaphore_wait_hack_required()
|
||||
bool Scheduler::semaphore_wait_hack_required() const
|
||||
{
|
||||
if (pthread_self() != _main_ctx) {
|
||||
// only the main thread ever moves stuff forwards
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
void reboot(bool hold_in_bootloader) override;
|
||||
|
||||
bool interrupts_are_blocked(void) {
|
||||
bool interrupts_are_blocked(void) const {
|
||||
return _nested_atomic_ctr != 0;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public:
|
||||
* threads.
|
||||
*/
|
||||
// a couple of helper functions to cope with SITL's time stepping
|
||||
bool semaphore_wait_hack_required();
|
||||
bool semaphore_wait_hack_required() const;
|
||||
|
||||
private:
|
||||
SITL_State *_sitlState;
|
||||
|
@ -31,7 +31,7 @@ bool Semaphore::give()
|
||||
return true;
|
||||
}
|
||||
|
||||
void Semaphore::check_owner()
|
||||
void Semaphore::check_owner() const
|
||||
{
|
||||
// should probably make sure we're holding the semaphore here....
|
||||
if (owner != pthread_self()) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
bool take(uint32_t timeout_ms) override;
|
||||
bool take_nonblocking() override;
|
||||
|
||||
void check_owner(); // asserts that current thread owns semaphore
|
||||
void check_owner() const; // asserts that current thread owns semaphore
|
||||
|
||||
protected:
|
||||
pthread_mutex_t _lock;
|
||||
|
@ -117,7 +117,7 @@ private:
|
||||
void _check_connection(void);
|
||||
static bool _select_check(int );
|
||||
static void _set_nonblocking(int );
|
||||
bool set_speed(int speed);
|
||||
bool set_speed(int speed) const;
|
||||
|
||||
SITL_State *_sitlState;
|
||||
uint64_t _receive_timestamp;
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
bool HALSITL::UARTDriver::set_speed(int speed)
|
||||
bool HALSITL::UARTDriver::set_speed(int speed) const
|
||||
{
|
||||
if (_fd < 0) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user