refactored HAL library

builds two libraries, Athena  and Desktop.
Simulation should use Desktop, Robots should use Athena

Also:
 - copied Driverstation and Joystick from Devices into Sim
 - Descreased dependency of pthreads in JNI.
 - removed Simulation ifdef from non simulation
 - added missing decprecated attribute for msvc
 - removed usage reporting from sim
 - removed unused pom.xml and constexpr

Change-Id: If8eb540f9434dce17c77a245fda6985713e80b2d
This commit is contained in:
peter mitrano
2015-08-19 11:12:54 -04:00
parent 43960b9bca
commit 4514e4489a
27 changed files with 1240 additions and 1041 deletions

View File

@@ -1,42 +1,24 @@
#pragma once
#include <stdint.h>
#include <pthread.h>
#include <semaphore.h>
#include <mutex>
#include <condition_variable>
typedef pthread_mutex_t* MUTEX_ID;
typedef sem_t* SEMAPHORE_ID;
typedef pthread_cond_t* MULTIWAIT_ID;
typedef std::mutex* MUTEX_ID;
typedef std::condition_variable* MULTIWAIT_ID;
typedef std::condition_variable::native_handle_type NATIVE_MULTIWAIT_ID;
extern "C"
{
extern const uint32_t SEMAPHORE_Q_FIFO;
extern const uint32_t SEMAPHORE_Q_PRIORITY;
extern const uint32_t SEMAPHORE_DELETE_SAFE;
extern const uint32_t SEMAPHORE_INVERSION_SAFE;
extern const int32_t SEMAPHORE_NO_WAIT;
extern const int32_t SEMAPHORE_WAIT_FOREVER;
extern const uint32_t SEMAPHORE_EMPTY;
extern const uint32_t SEMAPHORE_FULL;
MUTEX_ID initializeMutexRecursive();
MUTEX_ID initializeMutexNormal();
void deleteMutex(MUTEX_ID sem);
int8_t takeMutex(MUTEX_ID sem);
int8_t tryTakeMutex(MUTEX_ID sem);
int8_t giveMutex(MUTEX_ID sem);
SEMAPHORE_ID initializeSemaphore(uint32_t initial_value);
void deleteSemaphore(SEMAPHORE_ID sem);
int8_t takeSemaphore(SEMAPHORE_ID sem);
int8_t tryTakeSemaphore(SEMAPHORE_ID sem);
int8_t giveSemaphore(SEMAPHORE_ID sem);
void takeMutex(MUTEX_ID sem);
bool tryTakeMutex(MUTEX_ID sem);
void giveMutex(MUTEX_ID sem);
MULTIWAIT_ID initializeMultiWait();
void deleteMultiWait(MULTIWAIT_ID sem);
int8_t takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m, int32_t timeout);
int8_t giveMultiWait(MULTIWAIT_ID sem);
void takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m);
void giveMultiWait(MULTIWAIT_ID sem);
}