Skip to content

Commit b3fc28c

Browse files
committed
fixed up tabbing
1 parent c6e624a commit b3fc28c

37 files changed

+1191
-1191
lines changed

Diff for: ADC.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
#include "EZB.h"
33

44
ADCClass::ADCClass(EZB* ezb){
5-
m_ezb = ezb;
6-
MinPoolTimeMS=100;
5+
m_ezb = ezb;
6+
MinPoolTimeMS=100;
77
}
88

99
int ADCClass::GetADCValue(ADCPortEnum sendSensor){
1010

11-
struct timespec now;
12-
clock_gettime(1, &now);
13-
unsigned long nowms = (now.tv_sec * 1000) + (now.tv_nsec / 1000000);
11+
struct timespec now;
12+
clock_gettime(1, &now);
13+
unsigned long nowms = (now.tv_sec * 1000) + (now.tv_nsec / 1000000);
1414

15-
if(MinPoolTimeMS > 0 && m_last_request[sendSensor] + MinPoolTimeMS < nowms){
16-
unsigned char* retval = m_ezb->SendCommand(EZB::GetADCValue + sendSensor, 1);
15+
if(MinPoolTimeMS > 0 && m_last_request[sendSensor] + MinPoolTimeMS < nowms){
16+
unsigned char* retval = m_ezb->SendCommand(EZB::GetADCValue + sendSensor, 1);
1717

18-
m_last_value[sendSensor] = retval[0];
19-
delete [] retval;
18+
m_last_value[sendSensor] = retval[0];
19+
delete [] retval;
2020

21-
clock_gettime(1, &now);
22-
m_last_request[sendSensor] = (now.tv_sec * 1000) + (now.tv_nsec / 1000000);
23-
}
24-
return m_last_value[sendSensor];
21+
clock_gettime(1, &now);
22+
m_last_request[sendSensor] = (now.tv_sec * 1000) + (now.tv_nsec / 1000000);
23+
}
24+
return m_last_value[sendSensor];
2525

2626
}
2727

2828
float ADCClass::GetADCVoltage(ADCPortEnum sendSensor){
29-
return GetADCVoltageFromValue(GetADCValue(sendSensor));
29+
return GetADCVoltageFromValue(GetADCValue(sendSensor));
3030

3131
}
3232

3333
float ADCClass::GetADCVoltageFromValue(int adcValue){
3434

35-
return (float)((float)adcValue * 0.01960784f);
35+
return (float)((float)adcValue * 0.01960784f);
3636
}

Diff for: ADC.h

+29-29
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,38 @@
66
class EZB;
77
class ADCClass{
88
private:
9-
EZB* m_ezb;
10-
unsigned long m_last_request[8];
11-
unsigned char m_last_value[8];
9+
EZB* m_ezb;
10+
unsigned long m_last_request[8];
11+
unsigned char m_last_value[8];
1212
public:
13-
enum ADCPortEnum{
14-
ADC0 = 0,
15-
ADC1 = 1,
16-
ADC2 = 2,
17-
ADC3 = 3,
18-
ADC4 = 4,
19-
ADC5 = 5,
20-
ADC6 = 6,
21-
ADC7 = 7,
22-
};
13+
enum ADCPortEnum{
14+
ADC0 = 0,
15+
ADC1 = 1,
16+
ADC2 = 2,
17+
ADC3 = 3,
18+
ADC4 = 4,
19+
ADC5 = 5,
20+
ADC6 = 6,
21+
ADC7 = 7,
22+
};
2323

24-
int MinPoolTimeMS;
24+
int MinPoolTimeMS;
2525

26-
ADCClass(EZB* ezb);
27-
// Summary:
28-
// Get an integer from 0-255 representing the relative voltage of a specified
29-
// ADC port (Between 0 and 5 volts)
30-
int GetADCValue(ADCPortEnum sendSensor);
31-
//
32-
// Summary:
33-
// Get the voltage from 0-5v of a specified ADC port
34-
float GetADCVoltage(ADCPortEnum sendSensor);
35-
//
36-
// Summary:
37-
// Returns the voltage relative to the inputted value. If you want to display
38-
// the Value and Voltage, you can pass the value to this function rather then
39-
// executing a new command. This saves bandwidth over the line.
40-
float GetADCVoltageFromValue(int adcValue);
26+
ADCClass(EZB* ezb);
27+
// Summary:
28+
// Get an integer from 0-255 representing the relative voltage of a specified
29+
// ADC port (Between 0 and 5 volts)
30+
int GetADCValue(ADCPortEnum sendSensor);
31+
//
32+
// Summary:
33+
// Get the voltage from 0-5v of a specified ADC port
34+
float GetADCVoltage(ADCPortEnum sendSensor);
35+
//
36+
// Summary:
37+
// Returns the voltage relative to the inputted value. If you want to display
38+
// the Value and Voltage, you can pass the value to this function rather then
39+
// executing a new command. This saves bandwidth over the line.
40+
float GetADCVoltageFromValue(int adcValue);
4141
};
4242

4343
#endif

Diff for: BV4113.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
#include "EZB.h"
33

44
BV4113Class::BV4113Class(EZB* ezb){
5-
m_ezb = ezb;
6-
m_speed = MovementClass::MAX_SPEED;
5+
m_ezb = ezb;
6+
m_speed = MovementClass::MAX_SPEED;
77
}
88

99
void BV4113Class::Forward(){
10-
unsigned char dir[1];
11-
dir[0] = MovementClass::Forward;
12-
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
10+
unsigned char dir[1];
11+
dir[0] = MovementClass::Forward;
12+
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
1313
}
1414

1515
void BV4113Class::Left(){
16-
unsigned char dir[1];
17-
dir[0] = MovementClass::Left;
18-
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
16+
unsigned char dir[1];
17+
dir[0] = MovementClass::Left;
18+
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
1919
}
2020

2121
void BV4113Class::Reverse(){
22-
unsigned char dir[1];
23-
dir[0] = MovementClass::Reverse;
24-
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
22+
unsigned char dir[1];
23+
dir[0] = MovementClass::Reverse;
24+
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
2525
}
2626

2727
void BV4113Class::Right(){
28-
unsigned char dir[1];
29-
dir[0] = MovementClass::Right;
30-
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
28+
unsigned char dir[1];
29+
dir[0] = MovementClass::Right;
30+
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
3131
}
3232

3333
void BV4113Class::Stop(){
34-
unsigned char dir[1];
35-
dir[0] = MovementClass::Stop;
36-
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
34+
unsigned char dir[1];
35+
dir[0] = MovementClass::Stop;
36+
m_ezb->SendCommand(EZB::BV4113_Cmd, dir, 1);
3737
}

Diff for: BV4113.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
class EZB;
77
class BV4113Class{
88
private:
9-
EZB* m_ezb;
10-
unsigned char m_speed;
9+
EZB* m_ezb;
10+
unsigned char m_speed;
1111
public:
12-
BV4113Class(EZB* ezb);
13-
void Forward();
14-
void Left();
15-
void Reverse();
16-
void Right();
17-
void Stop();
12+
BV4113Class(EZB* ezb);
13+
void Forward();
14+
void Left();
15+
void Reverse();
16+
void Right();
17+
void Stop();
1818
};
1919

2020

Diff for: BV4615.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@
22
#include "EZB.h"
33

44
BV4615Response::BV4615Response(bool toggle, bool isValid, unsigned char byte1, unsigned char byte2){
5-
IsValid = isValid;
6-
Value = byte2;
7-
Toggle = toggle;
8-
Byte1 = byte1;
5+
IsValid = isValid;
6+
Value = byte2;
7+
Toggle = toggle;
8+
Byte1 = byte1;
99
}
1010

1111
BV4615Class::BV4615Class(EZB* ezb){
12-
m_ezb = ezb;
13-
ReadAddress = 37;
14-
WriteAddress = 36;
12+
m_ezb = ezb;
13+
ReadAddress = 37;
14+
WriteAddress = 36;
1515
}
1616

1717
BV4615Response BV4615Class::GetData(){
18-
m_ezb->I2C->Start();
19-
m_ezb->I2C->Write(ReadAddress);
20-
unsigned char* buffer = m_ezb->I2C->ReadAutoAck(2);
21-
m_ezb->I2C->Stop();
18+
m_ezb->I2C->Start();
19+
m_ezb->I2C->Write(ReadAddress);
20+
unsigned char* buffer = m_ezb->I2C->ReadAutoAck(2);
21+
m_ezb->I2C->Stop();
2222

23-
bool isValid = !((buffer[0] & (((int) 1) << 7))!=0?true:false && (buffer[0] & (((int) 1) << 0))!=0?true:false);
23+
bool isValid = !((buffer[0] & (((int) 1) << 7))!=0?true:false && (buffer[0] & (((int) 1) << 0))!=0?true:false);
2424

25-
BV4615Response res(false, isValid, buffer[0], buffer[1]);
26-
delete [] buffer;
27-
return res;
25+
BV4615Response res(false, isValid, buffer[0], buffer[1]);
26+
delete [] buffer;
27+
return res;
2828
}
2929

3030
unsigned char* BV4615Class::GetFirmware(){
31-
m_ezb->I2C->Start();
32-
unsigned char byteArray[8] = { 0, 0x27, 0x1b, 0x5b, 0x3f, 0x33, 0x30, 0x62 };
33-
byteArray[0] = WriteAddress;
34-
m_ezb->I2C->Write(byteArray, 8);
35-
m_ezb->I2C->Restart();
36-
m_ezb->I2C->Write(ReadAddress);
37-
unsigned char* buffer = m_ezb->I2C->ReadAutoAck(2);
38-
m_ezb->I2C->Stop();
31+
m_ezb->I2C->Start();
32+
unsigned char byteArray[8] = { 0, 0x27, 0x1b, 0x5b, 0x3f, 0x33, 0x30, 0x62 };
33+
byteArray[0] = WriteAddress;
34+
m_ezb->I2C->Write(byteArray, 8);
35+
m_ezb->I2C->Restart();
36+
m_ezb->I2C->Write(ReadAddress);
37+
unsigned char* buffer = m_ezb->I2C->ReadAutoAck(2);
38+
m_ezb->I2C->Stop();
3939

4040

41-
return buffer;
41+
return buffer;
4242
}

Diff for: BV4615.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ class EZB;
77

88
class BV4615Response{
99
public:
10-
unsigned char Byte1;
11-
bool IsValid;
12-
bool Toggle;
13-
unsigned char Value;
10+
unsigned char Byte1;
11+
bool IsValid;
12+
bool Toggle;
13+
unsigned char Value;
1414

15-
BV4615Response(bool toggle, bool isValid, unsigned char byte1, unsigned char byte2);
15+
BV4615Response(bool toggle, bool isValid, unsigned char byte1, unsigned char byte2);
1616
};
1717

1818
class BV4615Class{
1919
private:
20-
EZB* m_ezb;
21-
unsigned char m_speed;
20+
EZB* m_ezb;
21+
unsigned char m_speed;
2222
public:
23-
unsigned char ReadAddress;
24-
unsigned char WriteAddress;
23+
unsigned char ReadAddress;
24+
unsigned char WriteAddress;
2525

2626

27-
BV4615Class(EZB* ezb);
27+
BV4615Class(EZB* ezb);
2828

29-
BV4615Response GetData();
30-
unsigned char* GetFirmware();
29+
BV4615Response GetData();
30+
unsigned char* GetFirmware();
3131
};
3232

3333

0 commit comments

Comments
 (0)