mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Classify other libraries' headers properly and fix committed formatting issues (#620)
This commit is contained in:
committed by
Peter Johnson
parent
a4e781a231
commit
6e4f66cc8b
@@ -176,16 +176,10 @@ void HAL_ObserveUserProgramTest(void) {
|
||||
static pthread_key_t lastCountKey;
|
||||
static pthread_once_t lastCountKeyOnce = PTHREAD_ONCE_INIT;
|
||||
|
||||
static void InitLastCountKey() {
|
||||
pthread_key_create(&lastCountKey, std::free);
|
||||
}
|
||||
static void InitLastCountKey() { pthread_key_create(&lastCountKey, std::free); }
|
||||
#endif
|
||||
|
||||
bool HAL_IsNewControlData(void) {
|
||||
// There is a rollover error condition here. At Packet# = n * (uintmax), this
|
||||
// will return false when instead it should return true. However, this at a
|
||||
// 20ms rate occurs once every 2.7 years of DS connected runtime, so not
|
||||
// worth the cycles to check.
|
||||
#ifdef __APPLE__
|
||||
pthread_once(&lastCountKeyOnce, InitLastCountKey);
|
||||
int* lastCountPtr = static_cast<int*>(pthread_getspecific(lastCountKey));
|
||||
@@ -198,6 +192,10 @@ bool HAL_IsNewControlData(void) {
|
||||
#else
|
||||
thread_local int lastCount{-1};
|
||||
#endif
|
||||
// There is a rollover error condition here. At Packet# = n * (uintmax), this
|
||||
// will return false when instead it should return true. However, this at a
|
||||
// 20ms rate occurs once every 2.7 years of DS connected runtime, so not
|
||||
// worth the cycles to check.
|
||||
int currentCount = 0;
|
||||
{
|
||||
std::unique_lock<hal::priority_mutex> lock(newDSDataAvailableMutex);
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
#include <cstdio>
|
||||
#include <thread>
|
||||
|
||||
#include <support/timestamp.h>
|
||||
|
||||
#include "MockHooksInternal.h"
|
||||
#include "support/timestamp.h"
|
||||
|
||||
static std::atomic<bool> programStarted{false};
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
#include <support/SafeThread.h>
|
||||
#include <support/timestamp.h>
|
||||
|
||||
#include "HAL/HAL.h"
|
||||
#include "HAL/cpp/fpga_clock.h"
|
||||
#include "HAL/cpp/make_unique.h"
|
||||
#include "HAL/handles/UnlimitedHandleResource.h"
|
||||
#include "support/SafeThread.h"
|
||||
#include "support/timestamp.h"
|
||||
|
||||
namespace {
|
||||
class NotifierThread : public wpi::SafeThread {
|
||||
|
||||
Reference in New Issue
Block a user