mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Renames all our .hpp HAL files to .h (#44)
Adds consistency, as the HAL was .hpp however all other code was .h.
This commit is contained in:
committed by
Peter Johnson
parent
248ca0c4a0
commit
8fc55c80a9
40
hal/include/HAL/Task.h
Normal file
40
hal/include/HAL/Task.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef _FUNCPTR_DEFINED
|
||||
#define _FUNCPTR_DEFINED
|
||||
#ifdef __cplusplus
|
||||
typedef int (*FUNCPTR)(...);
|
||||
/* ptr to function returning int */
|
||||
#else
|
||||
typedef int (*FUNCPTR)(); /* ptr to function returning int */
|
||||
#endif /* __cplusplus */
|
||||
#endif /* _FUNCPTR_DEFINED */
|
||||
|
||||
#ifndef _STATUS_DEFINED
|
||||
#define _STATUS_DEFINED
|
||||
typedef int STATUS;
|
||||
#endif /* _STATUS_DEFINED */
|
||||
|
||||
#ifndef OK
|
||||
#define OK 0
|
||||
#endif /* OK */
|
||||
#ifndef ERROR
|
||||
#define ERROR (-1)
|
||||
#endif /* ERROR */
|
||||
|
||||
#define NULL_TASK NULL
|
||||
typedef pthread_t* TASK;
|
||||
|
||||
extern "C" {
|
||||
// Note: These constants used to be declared extern and were defined in
|
||||
// Task.cpp. This caused issues with the JNI bindings for java, and so the
|
||||
// instantiations were moved here.
|
||||
const int32_t HAL_taskLib_ILLEGAL_PRIORITY = 22; // 22 is EINVAL
|
||||
|
||||
STATUS verifyTaskID(TASK task);
|
||||
STATUS setTaskPriority(TASK task, int priority); // valid priority [1..99]
|
||||
STATUS getTaskPriority(TASK task, int* priority);
|
||||
}
|
||||
Reference in New Issue
Block a user