mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Run wpiformat on merged repo (#1021)
This commit is contained in:
committed by
Peter Johnson
parent
0babbf317c
commit
6729a7d6b1
@@ -1,18 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_ThreadsJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Threads.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_ThreadsJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -21,18 +21,20 @@ TLogLevel threadsJNILogLevel = logWARNING;
|
||||
|
||||
#define THREADSJNI_LOG(level) \
|
||||
if (level > threadsJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: GetCurrentThreadPriority
|
||||
* Method: getCurrentThreadPriority
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadPriority
|
||||
(JNIEnv *env, jclass) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadPriority
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadPriority";
|
||||
int32_t status = 0;
|
||||
HAL_Bool isRT = false;
|
||||
@@ -43,11 +45,13 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThrea
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: GetCurrentThreadIsRealTime
|
||||
* Method: getCurrentThreadIsRealTime
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadIsRealTime
|
||||
(JNIEnv *env, jclass) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadIsRealTime
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadIsRealTime";
|
||||
int32_t status = 0;
|
||||
HAL_Bool isRT = false;
|
||||
@@ -58,16 +62,19 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentT
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: SetCurrentThreadPriority
|
||||
* Method: setCurrentThreadPriority
|
||||
* Signature: (ZI)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_setCurrentThreadPriority
|
||||
(JNIEnv *env, jclass, jboolean realTime, jint priority) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_setCurrentThreadPriority
|
||||
(JNIEnv* env, jclass, jboolean realTime, jint priority)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling SetCurrentThreadPriority";
|
||||
int32_t status = 0;
|
||||
auto ret = HAL_SetCurrentThreadPriority((HAL_Bool)realTime, (int32_t)priority, &status);
|
||||
auto ret = HAL_SetCurrentThreadPriority(
|
||||
(HAL_Bool)realTime, static_cast<int32_t>(priority), &status);
|
||||
CheckStatus(env, status);
|
||||
return (jboolean)ret;
|
||||
}
|
||||
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user