-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWPIObjMgr.cpp
More file actions
42 lines (37 loc) · 798 Bytes
/
WPIObjMgr.cpp
File metadata and controls
42 lines (37 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "WPIObjMgr.h"
#include "Config.h"
namespace Spyder
{
Joystick* GetJoystick(UINT32 port)
{
static Joystick* s_joysticks[] = {0, 0, 0, 0};
if(!s_joysticks[port])
{
s_joysticks[port] = new Joystick(port);
}
return s_joysticks[port];
}
Victor* GetVictor(UINT32 channel)
{
static std::map<UINT32, Victor*> s_victors;
if(!s_victors[channel])
{
s_victors[channel] = new Victor(1, channel);
}
return s_victors[channel];
}
double GetDeadzone()
{
static ConfigVar<double> deadzone("controller_deadzone", 0.15);
return deadzone.GetVal();
}
Solenoid* GetSolenoid(UINT32 channel)
{
static std::map<UINT32, Solenoid*> s_solenoids;
if(!s_solenoids[channel])
{
s_solenoids[channel] = new Solenoid(channel);
}
return s_solenoids[channel];
}
}