mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Makes HALSetDataSem take a MULTIWAIT_ID rather then a NATIVE_MULTIWAIT_ID
Having the HAL take a NATIVE_MULTIWAIT_ID without any way to get that structure from extern "C" code is a problem. This makes it so it just takes a MULTIWAIT_ID, and then grabs the native handle inside the HAL. Change-Id: I06da18ba34adcea2f16e4e53da672f38be79e28e Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
This commit is contained in:
committed by
Peter Johnson (294)
parent
de39877efb
commit
2f2184e8ce
@@ -235,7 +235,7 @@ extern "C"
|
||||
int HALSetJoystickOutputs(uint8_t joystickNum, uint32_t outputs, uint16_t leftRumble, uint16_t rightRumble);
|
||||
int HALGetMatchTime(float *matchTime);
|
||||
|
||||
void HALSetNewDataSem(NATIVE_MULTIWAIT_ID sem);
|
||||
void HALSetNewDataSem(MULTIWAIT_ID sem);
|
||||
|
||||
bool HALGetSystemActive(int32_t *status);
|
||||
bool HALGetBrownedOut(int32_t *status);
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include "cpp/priority_condition_variable.h"
|
||||
#include "cpp/priority_mutex.h"
|
||||
|
||||
typedef std::mutex* MUTEX_ID;
|
||||
typedef std::condition_variable* MULTIWAIT_ID;
|
||||
typedef std::condition_variable::native_handle_type NATIVE_MULTIWAIT_ID;
|
||||
typedef priority_mutex* MUTEX_ID;
|
||||
typedef priority_condition_variable* MULTIWAIT_ID;
|
||||
typedef priority_condition_variable::native_handle_type NATIVE_MULTIWAIT_ID;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
MUTEX_ID initializeMutexNormal();
|
||||
void deleteMutex(MUTEX_ID sem);
|
||||
void takeMutex(MUTEX_ID sem);
|
||||
bool tryTakeMutex(MUTEX_ID sem);
|
||||
void giveMutex(MUTEX_ID sem);
|
||||
extern "C" {
|
||||
MUTEX_ID initializeMutexNormal();
|
||||
void deleteMutex(MUTEX_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);
|
||||
void takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m);
|
||||
void giveMultiWait(MULTIWAIT_ID sem);
|
||||
MULTIWAIT_ID initializeMultiWait();
|
||||
void deleteMultiWait(MULTIWAIT_ID sem);
|
||||
void takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m);
|
||||
void giveMultiWait(MULTIWAIT_ID sem);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
#include "priority_mutex.h"
|
||||
|
||||
class priority_condition_variable {
|
||||
typedef std::condition_variable::native_handle_type native_handle_type;
|
||||
typedef std::chrono::system_clock clock_t;
|
||||
|
||||
public:
|
||||
typedef std::condition_variable::native_handle_type native_handle_type;
|
||||
|
||||
priority_condition_variable() : m_mutex(std::make_shared<std::mutex>()) {}
|
||||
~priority_condition_variable() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user