Skip to content

Commit 5675170

Browse files
author
Noah Andrews
authored
Merge pull request #21 from REVrobotics/cleanup
2 parents 1578e38 + 61fa8c8 commit 5675170

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/native/cpp/Drivers/CandleWinUSB/CandleWinUSBDevice.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ CandleWinUSBDevice::CandleWinUSBDevice(candle_handle hDev) :
5959
throw "Failed to open device!";
6060
}
6161

62-
// Set FRC capable settings, SPARK MAX is hard coded to this, but other devices (e.g. canable with
62+
// Set FRC capable settings, SPARK MAX is hard coded to this, but other devices (e.g. canable with
6363
// candlelight_fw) may need to be set to it explicitly. Note this only works for devices with 48MHz
64-
// clocks, and could be expanded in the future to work with any device that properly reports its
64+
// clocks, and could be expanded in the future to work with any device that properly reports its
6565
// own capabilities.
6666
if (!candle_channel_set_bitrate(hDev, CANDLE_DEFAULT_CHANNEL, 1000000)) {
6767
std::cout << "Unable to set bitrate! " << candle_error_text(candle_dev_last_error(hDev)) << std::endl;
@@ -73,7 +73,7 @@ CandleWinUSBDevice::CandleWinUSBDevice(candle_handle hDev) :
7373
close_candle_dev(hDev);
7474
throw "Failed to start device channel 0!";
7575
}
76-
76+
7777
m_descriptor = unicode_decode(candle_dev_get_path(m_handle));
7878
m_name = candle_dev_get_name(m_handle);
7979
m_thread.Start();
@@ -82,7 +82,7 @@ CandleWinUSBDevice::CandleWinUSBDevice(candle_handle hDev) :
8282
CandleWinUSBDevice::~CandleWinUSBDevice()
8383
{
8484
m_thread.Stop();
85-
85+
8686
candle_channel_stop(m_handle, CANDLE_DEFAULT_CHANNEL);
8787
close_candle_dev(m_handle);
8888
}
@@ -130,7 +130,7 @@ CANStatus CandleWinUSBDevice::ReceiveCANMessage(std::shared_ptr<CANMessage>& msg
130130
{
131131
// Assume timeout
132132
CANStatus status = CANStatus::kTimeout;
133-
133+
134134
// parse through the keys, find the messges the match, and return it
135135
// The first in the message id, then the messages
136136
std::map<uint32_t, std::shared_ptr<CANMessage>> messages;
@@ -139,13 +139,13 @@ CANStatus CandleWinUSBDevice::ReceiveCANMessage(std::shared_ptr<CANMessage>& msg
139139
for (auto& m : messages) {
140140
if (CANBridge_ProcessMask({m.second->GetMessageId(), 0}, m.first) && CANBridge_ProcessMask({messageID, messageMask}, m.first)) {
141141
mostRecent = m.second;
142-
status = CANStatus::kOk;
142+
status = CANStatus::kOk;
143143
}
144144
}
145-
145+
146146
if (status == CANStatus::kOk) {
147147
msg = mostRecent;
148-
status = m_thread.GetLastThreadError(); // check and see if something else went wrong
148+
status = m_thread.GetLastThreadError(); // check and see if something else went wrong
149149
}
150150

151151
return status;
@@ -156,7 +156,7 @@ CANStatus CandleWinUSBDevice::OpenStreamSession(uint32_t* sessionHandle, CANBrid
156156
CANStatus status;
157157
// Register the stream with the correct buffer size
158158
m_thread.OpenStream(sessionHandle, filter, maxSize, &status);
159-
159+
160160
return m_thread.GetLastThreadError();
161161
}
162162
CANStatus CandleWinUSBDevice::CloseStreamSession(uint32_t sessionHandle)
@@ -177,7 +177,7 @@ CANStatus CandleWinUSBDevice::GetCANDetailStatus(float* percentBusUtilization, u
177177
CANStatus CandleWinUSBDevice::GetCANDetailStatus(float* percentBusUtilization, uint32_t* busOff, uint32_t* txFull, uint32_t* receiveErr, uint32_t* transmitErr, uint32_t* lastErrorTime)
178178
{
179179
m_thread.GetCANStatusDetails(busOff, txFull, receiveErr, transmitErr, lastErrorTime);
180-
*percentBusUtilization = 0.0; // todo how to get this
180+
*percentBusUtilization = 0.0; // todo how to get this
181181

182182
return m_thread.GetLastThreadError();
183183
}

0 commit comments

Comments
 (0)