Skip to content

Commit 1ae4d99

Browse files
committed
Refactor to build library on esp8266
Seems like esp8266 uses a rather different g++ so some syntax was not compatible with it. Interesting to know that compiling in Arduino IDE for AVR seems to be use a more modern configuration... 😕
1 parent d7b47ab commit 1ae4d99

File tree

17 files changed

+29
-28
lines changed

17 files changed

+29
-28
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ script:
4545
- build_platform uno
4646
- build_platform mega2560
4747
- build_platform leonardo
48+
- build_platform esp8266
4849

4950
after_success:
5051
- bash run_coverage.sh

src/car/distance/DistanceCar.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ using namespace smartcarlib::utils;
1616

1717
DistanceCar::DistanceCar(Control& control, Odometer& odometer, Runtime& runtime)
1818
: SimpleCar(control)
19-
, mControl{ control }
20-
, mOdometerLeft{ odometer }
21-
, mOdometerRight{ odometer }
22-
, mRuntime{ runtime }
19+
, mControl(control)
20+
, mOdometerLeft(odometer)
21+
, mOdometerRight(odometer)
22+
, mRuntime(runtime)
2323
, mCruiseControlEnabled{ false }
2424
, mProportional{ 0 }
2525
, mIntegral{ 0 }
@@ -38,10 +38,10 @@ DistanceCar::DistanceCar(Control& control,
3838
Odometer& odometerRight,
3939
Runtime& runtime)
4040
: SimpleCar(control)
41-
, mControl{ control }
42-
, mOdometerLeft{ odometerLeft }
43-
, mOdometerRight{ odometerRight }
44-
, mRuntime{ runtime }
41+
, mControl(control)
42+
, mOdometerLeft(odometerLeft)
43+
, mOdometerRight(odometerRight)
44+
, mRuntime(runtime)
4545
, mCruiseControlEnabled{ false }
4646
, mProportional{ 0 }
4747
, mIntegral{ 0 }

src/car/heading/HeadingCar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
HeadingCar::HeadingCar(Control& control, HeadingSensor& headingSensor)
44
: SimpleCar(control)
5-
, mHeadingSensor{ headingSensor }
5+
, mHeadingSensor(headingSensor)
66
{
77
}
88

src/car/simple/SimpleCar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using namespace smartcarlib::constants::control;
55
using namespace smartcarlib::utils;
66

77
SimpleCar::SimpleCar(Control& control)
8-
: mControl{ control }
8+
: mControl(control)
99
{
1010
}
1111

src/control/ackerman/AckermanControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ using namespace smartcarlib::constants::control;
77
using namespace smartcarlib::constants::motor;
88

99
AckermanControl::AckermanControl(Motor& steering, Motor& throttling)
10-
: mSteering{ steering }
11-
, mThrottling{ throttling }
10+
: mSteering(steering)
11+
, mThrottling(throttling)
1212
{
1313
}
1414

src/control/differential/DifferentialControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ using namespace smartcarlib::constants::control;
77
using namespace smartcarlib::constants::motor;
88

99
DifferentialControl::DifferentialControl(Motor& leftMotor, Motor& rightMotor)
10-
: mLeftMotor{ leftMotor }
11-
, mRightMotor{ rightMotor }
10+
: mLeftMotor(leftMotor)
11+
, mRightMotor(rightMotor)
1212
, mAngle{ 0 }
1313
, mSpeed{ 0 }
1414
{

src/motor/analog/pwm/BrushedMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BrushedMotor::BrushedMotor(uint8_t forwardPin,
2020
: kForwardPin{ forwardPin }
2121
, kBackwardPin{ backwardPin }
2222
, kEnablePin{ enablePin }
23-
, mRuntime{ runtime }
23+
, mRuntime(runtime)
2424
, mAttached{ false }
2525
{
2626
}

src/motor/digital/servo/ServoMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ServoMotor::ServoMotor(uint8_t controlPin,
1313
, kMinPulseLength{ minPulseLength }
1414
, kIdlePulseLength{ idlePulseLength }
1515
, kMaxPulseLength{ maxPulseLength }
16-
, mRuntime{ runtime }
16+
, mRuntime(runtime)
1717
, mAttached{ false }
1818
{
1919
}

src/sensors/distance/infrared/analog/InfraredAnalogSensor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const unsigned long kMedianMeasurementDelay = 15;
99
using namespace smartcarlib::utils;
1010

1111
InfraredAnalogSensor::InfraredAnalogSensor(Runtime& runtime)
12-
: mRuntime{ runtime }
12+
: mRuntime(runtime)
1313
{
1414
}
1515

@@ -20,7 +20,7 @@ unsigned int InfraredAnalogSensor::getMedianDistance(uint8_t iterations)
2020
return -1; // Return a large number to indicate error
2121
}
2222

23-
unsigned int measurements[iterations] = { 0 };
23+
unsigned int measurements[iterations];
2424
for (auto i = 0; i < iterations; i++)
2525
{
2626
measurements[i] = getDistance();

src/sensors/distance/infrared/analog/sharp/GP2D120.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const auto kMaxDistance = 25; // GP2D120's maximum distance
99
GP2D120::GP2D120(uint8_t pin, Runtime& runtime)
1010
: InfraredAnalogSensor(runtime)
1111
, kPin{ pin }
12-
, mRuntime{ runtime }
12+
, mRuntime(runtime)
1313
{
1414
}
1515

0 commit comments

Comments
 (0)