Removes statics from hal sim (#825)

Based off of #824, the equivelent in sim.
This commit is contained in:
Thad House
2017-12-10 19:38:53 -08:00
committed by Peter Johnson
parent 8bd48d6c34
commit d2e7a90f41
78 changed files with 1008 additions and 576 deletions

View File

@@ -1,36 +1,36 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2017 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
#include <memory>
#include "HAL/Ports.h"
#include "HAL/handles/IndexedHandleResource.h"
#include "PortsInternal.h"
namespace hal {
constexpr int32_t kTimebase = 40000000; ///< 40 MHz clock
constexpr int32_t kDefaultOversampleBits = 0;
constexpr int32_t kDefaultAverageBits = 7;
constexpr double kDefaultSampleRate = 50000.0;
static const uint32_t kAccumulatorChannels[] = {0, 1};
struct AnalogPort {
uint8_t channel;
bool isAccumulator;
};
extern IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
analogInputHandles;
int32_t GetAnalogTriggerInputIndex(HAL_AnalogTriggerHandle handle,
int32_t* status);
} // namespace hal
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2017 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
#include <memory>
#include "HAL/Ports.h"
#include "HAL/handles/IndexedHandleResource.h"
#include "PortsInternal.h"
namespace hal {
constexpr int32_t kTimebase = 40000000; ///< 40 MHz clock
constexpr int32_t kDefaultOversampleBits = 0;
constexpr int32_t kDefaultAverageBits = 7;
constexpr double kDefaultSampleRate = 50000.0;
static constexpr uint32_t kAccumulatorChannels[] = {0, 1};
struct AnalogPort {
uint8_t channel;
bool isAccumulator;
};
extern IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
analogInputHandles;
int32_t GetAnalogTriggerInputIndex(HAL_AnalogTriggerHandle handle,
int32_t* status);
} // namespace hal