Skip to content

Commit e786e8b

Browse files
committed
increase clang column limit
1 parent 331f3a1 commit e786e8b

File tree

14 files changed

+39
-74
lines changed

14 files changed

+39
-74
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ BreakConstructorInitializersBeforeComma: false
5858
BreakConstructorInitializers: BeforeColon
5959
BreakAfterJavaFieldAnnotations: false
6060
BreakStringLiterals: true
61-
ColumnLimit: 80
61+
ColumnLimit: 100
6262
CommentPragmas: '^ IWYU pragma:'
6363
CompactNamespaces: false
6464
ConstructorInitializerAllOnOneLineOrOnePerLine: false

examples/MultipleScenes/MultipleScenes.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ void setup() {
3636
animation.onPositionChange(move);
3737

3838
// Add multiple scenes based on PROGMEM data
39-
animation.addScene(SceneA::ANIMATION_DATA, SceneA::LENGTH, SceneA::FPS,
40-
SceneA::FRAMES);
41-
animation.addScene(SceneB::ANIMATION_DATA, SceneB::LENGTH, SceneB::FPS,
42-
SceneB::FRAMES);
39+
animation.addScene(SceneA::ANIMATION_DATA, SceneA::LENGTH, SceneA::FPS, SceneA::FRAMES);
40+
animation.addScene(SceneB::ANIMATION_DATA, SceneB::LENGTH, SceneB::FPS, SceneB::FRAMES);
4341

4442
// Trigger the animation loop mode
4543
animation.loop();

examples/WebSocketLiveMode/WebSocketLiveMode.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void move(byte servoID, int position) {
3636
BlenderServoAnimation animation;
3737

3838
// Callback function writing live stream data to the animation
39-
void onWebSocketEvent(AsyncWebSocket *server, AsyncWebSocketClient *client,
40-
AwsEventType type, void *arg, uint8_t *data, size_t len) {
39+
void onWebSocketEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type,
40+
void *arg, uint8_t *data, size_t len) {
4141
if (type != WS_EVT_DATA) {
4242
return;
4343
}

src/BlenderServoAnimation.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ bool BlenderServoAnimation::hasScenes() {
2626
return this->addIndex > 0;
2727
}
2828

29-
void BlenderServoAnimation::addScene(const byte *data, int size, byte fps,
30-
int frames) {
29+
void BlenderServoAnimation::addScene(const byte *data, int size, byte fps, int frames) {
3130
AnimationData *animationData = new AnimationData(data, size);
3231
Scene *scene = new Scene(&this->servoManager, animationData, fps, frames);
3332
this->registerScene(scene);
@@ -174,8 +173,7 @@ void BlenderServoAnimation::loop() {
174173
}
175174

176175
void BlenderServoAnimation::pause() {
177-
if (!this->scene ||
178-
this->modeIsIn(4, MODE_DEFAULT, MODE_PAUSE, MODE_STOP, MODE_LIVE)) {
176+
if (!this->scene || this->modeIsIn(4, MODE_DEFAULT, MODE_PAUSE, MODE_STOP, MODE_LIVE)) {
179177
return;
180178
}
181179

src/Command.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ byte Command::getServoID() {
2626
}
2727

2828
int Command::getServoPosition() {
29-
return this->values[INDEX_POSITION_BYTE] |
30-
this->values[INDEX_POSITION_SIG_BYTE] << BITS;
29+
return this->values[INDEX_POSITION_BYTE] | this->values[INDEX_POSITION_SIG_BYTE] << BITS;
3130
}
3231

3332
void Command::reset() {

src/Scene.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
using BlenderServoAnimationLibrary::Scene;
77

8-
Scene::Scene(ServoManager *servoManager, AnimationData *data, byte fps,
9-
int frames) {
8+
Scene::Scene(ServoManager *servoManager, AnimationData *data, byte fps, int frames) {
109
this->servoManager = servoManager;
1110
this->data = data;
1211
this->fps = fps;
@@ -68,8 +67,7 @@ unsigned int Scene::getMicrosDiff(unsigned long currentMicros) {
6867
}
6968

7069
bool Scene::isNewFrame(unsigned long currentMicros) {
71-
return this->lastMicros == 0 ||
72-
this->getMicrosDiff(currentMicros) >= this->frameMicros;
70+
return this->lastMicros == 0 || this->getMicrosDiff(currentMicros) >= this->frameMicros;
7371
}
7472

7573
bool Scene::hasFinished() {

src/Servo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ void Servo::move(int position, bool useOffset) {
1515
position += this->offset;
1616
}
1717

18-
if (position == this->currentPosition ||
19-
this->positionExceedsThreshold(position)) {
18+
if (position == this->currentPosition || this->positionExceedsThreshold(position)) {
2019
return;
2120
}
2221

test/animation/test_live/test_live.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ void test_prevented(void) {
2626
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY, animation.getMode());
2727
animation.pause();
2828
animation.playSingle(0);
29-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
30-
animation.getMode());
29+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
3130
animation.live(mock);
32-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
33-
animation.getMode());
31+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
3432
animation.pause();
3533
animation.playRandom();
36-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
37-
animation.getMode());
34+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
3835
animation.live(mock);
39-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
40-
animation.getMode());
36+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
4137
animation.pause();
4238
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PAUSE, animation.getMode());
4339
animation.live(mock);

test/animation/test_loop/test_loop.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,14 @@ void test_prevented(void) {
6060
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY, animation.getMode());
6161
animation.pause();
6262
animation.playSingle(0);
63-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
64-
animation.getMode());
63+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
6564
animation.loop();
66-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
67-
animation.getMode());
65+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
6866
animation.pause();
6967
animation.playRandom();
70-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
71-
animation.getMode());
68+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
7269
animation.loop();
73-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
74-
animation.getMode());
70+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
7571
animation.stop();
7672
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
7773
animation.loop();

test/animation/test_play/test_play.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,14 @@ void test_prevented(void) {
5757
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_LOOP, animation.getMode());
5858
animation.pause();
5959
animation.playSingle(0);
60-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
61-
animation.getMode());
60+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
6261
animation.play();
63-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
64-
animation.getMode());
62+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
6563
animation.pause();
6664
animation.playRandom();
67-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
68-
animation.getMode());
65+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
6966
animation.play();
70-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
71-
animation.getMode());
67+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
7268
animation.stop();
7369
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
7470
animation.play();

test/animation/test_play_random/test_play_random.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ void test_play_random(void) {
2525

2626
animation.playRandom();
2727

28-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
29-
animation.getMode());
28+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
3029
TEST_ASSERT_NOT_EQUAL(nullptr, animation.getCurrentScene());
3130
TEST_ASSERT_EQUAL(1, animation.getPlayIndex());
3231
TEST_ASSERT_FALSE(animation.scenePlayed(0));
@@ -37,8 +36,7 @@ void test_play_random(void) {
3736
animation.run(i);
3837
}
3938

40-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
41-
animation.getMode());
39+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
4240
TEST_ASSERT_EQUAL(0, animation.getPlayIndex());
4341
TEST_ASSERT_TRUE(animation.scenePlayed(0));
4442
TEST_ASSERT_TRUE(animation.scenePlayed(1));
@@ -48,8 +46,7 @@ void test_play_random(void) {
4846
animation.run(i);
4947
}
5048

51-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
52-
animation.getMode());
49+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
5350
TEST_ASSERT_EQUAL(2, animation.getPlayIndex());
5451
TEST_ASSERT_EQUAL(20, logIndex);
5552
TEST_ASSERT_FALSE(animation.scenePlayed(0));
@@ -81,11 +78,9 @@ void test_prevented(void) {
8178
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY, animation.getMode());
8279
animation.pause();
8380
animation.playSingle(0);
84-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
85-
animation.getMode());
81+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
8682
animation.playRandom();
87-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
88-
animation.getMode());
83+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
8984
animation.stop();
9085
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
9186
animation.playRandom();
@@ -104,13 +99,11 @@ void test_allowed(void) {
10499

105100
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_DEFAULT, animation.getMode());
106101
animation.playRandom();
107-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
108-
animation.getMode());
102+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
109103
animation.pause();
110104
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PAUSE, animation.getMode());
111105
animation.playRandom();
112-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
113-
animation.getMode());
106+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
114107
}
115108

116109
int main(int argc, char **argv) {

test/animation/test_play_single/test_play_single.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ void test_play_single(void) {
2020

2121
animation.playSingle(2);
2222

23-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
24-
animation.getMode());
23+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
2524
TEST_ASSERT_EQUAL(2, animation.getPlayIndex());
2625

2726
for (long i = 0; i < ANIMATION_MICROS; i += FRAME_MICROS) {
@@ -58,11 +57,9 @@ void test_prevented(void) {
5857
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY, animation.getMode());
5958
animation.pause();
6059
animation.playRandom();
61-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
62-
animation.getMode());
60+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
6361
animation.playSingle(0);
64-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
65-
animation.getMode());
62+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
6663
animation.stop();
6764
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
6865
animation.playSingle(0);
@@ -81,13 +78,11 @@ void test_allowed(void) {
8178

8279
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_DEFAULT, animation.getMode());
8380
animation.playSingle(0);
84-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
85-
animation.getMode());
81+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
8682
animation.pause();
8783
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PAUSE, animation.getMode());
8884
animation.playSingle(0);
89-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
90-
animation.getMode());
85+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
9186
}
9287

9388
void test_prevent_sudden_index_change(void) {

test/animation/test_stop/test_stop.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ void test_allowed(void) {
101101
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
102102
animation.run(10000);
103103
animation.playSingle(0);
104-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE,
105-
animation.getMode());
104+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_SINGLE, animation.getMode());
106105
animation.stop();
107106
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
108107
animation.run(10000);
109108
animation.playRandom();
110-
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM,
111-
animation.getMode());
109+
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_PLAY_RANDOM, animation.getMode());
112110
animation.stop();
113111
TEST_ASSERT_EQUAL(BlenderServoAnimation::MODE_STOP, animation.getMode());
114112
animation.run(10000);

test/test_scene/test_scene.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ void test_stop(void) {
4242
Scene scene(&servoManager, data, FPS, FRAMES);
4343

4444
positionLog exp[15] = {
45-
{0, 375}, {1, 375}, {0, 376}, {1, 376}, {0, 377},
46-
{1, 379}, {0, 380}, {1, 383}, {0, 378}, {1, 381},
47-
{0, 376}, {1, 379}, {0, 375}, {1, 377}, {1, 375},
45+
{0, 375}, {1, 375}, {0, 376}, {1, 376}, {0, 377}, {1, 379}, {0, 380}, {1, 383},
46+
{0, 378}, {1, 381}, {0, 376}, {1, 379}, {0, 375}, {1, 377}, {1, 375},
4847
};
4948

5049
for (int i = 0; i < FRAME_MICROS * 4; i += FRAME_MICROS) {

0 commit comments

Comments
 (0)