AP_HAL_Linux: fixed APM2 build

This commit is contained in:
Andrew Tridgell 2013-09-29 14:24:55 +10:00
parent 1698e1800c
commit 53f66b23f4
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,6 @@
#include <AP_HAL.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
#include "Semaphores.h"
@ -26,3 +29,5 @@ bool LinuxSemaphore::take_nonblocking()
{
return pthread_mutex_trylock(&_lock) == 0;
}
#endif // CONFIG_HAL_BOARD

View File

@ -2,6 +2,9 @@
#ifndef __AP_HAL_LINUX_SEMAPHORE_H__
#define __AP_HAL_LINUX_SEMAPHORE_H__
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
#include <AP_HAL_Linux.h>
#include <pthread.h>
@ -16,5 +19,6 @@ public:
private:
pthread_mutex_t _lock;
};
#endif // CONFIG_HAL_BOARD
#endif // __AP_HAL_LINUX_SEMAPHORE_H__