Skip to content

Commit f1b7100

Browse files
committed
Clang format
1 parent cd0f3a7 commit f1b7100

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

lib/led_strip/animations/led_animations.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ inline void idleAnimation(LedStrip& strip, uint8_t r, uint8_t g, uint8_t b,
3333

3434
for (uint8_t i = 0; i < half; ++i) {
3535
for (uint8_t step = 1; step <= fade_steps; ++step) {
36-
uint8_t rf = prev_r + (static_cast<int16_t>(r) - prev_r) * step / fade_steps;
37-
uint8_t gf = prev_g + (static_cast<int16_t>(g) - prev_g) * step / fade_steps;
38-
uint8_t bf = prev_b + (static_cast<int16_t>(b) - prev_b) * step / fade_steps;
36+
uint8_t rf =
37+
prev_r + (static_cast<int16_t>(r) - prev_r) * step / fade_steps;
38+
uint8_t gf =
39+
prev_g + (static_cast<int16_t>(g) - prev_g) * step / fade_steps;
40+
uint8_t bf =
41+
prev_b + (static_cast<int16_t>(b) - prev_b) * step / fade_steps;
3942

4043
strip.setBuffer(half - 1 - i, rf, gf, bf);
4144
strip.setBuffer(half + i, rf, gf, bf);

lib/ros/ros/ros_node.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ void RosNode::destroyEntities() {
125125
}
126126

127127
void RosNode::loop() {
128-
const TickType_t now = xTaskGetTickCount();
128+
const TickType_t now = xTaskGetTickCount();
129129
if ((now - last_ping_) >= pdMS_TO_TICKS(cfg_.ping_watchdog_ms)) {
130-
last_ping_ = now;
131-
ping_ = pingAgent();
130+
last_ping_ = now;
131+
ping_ = pingAgent();
132132
}
133133

134134
switch (state_) {

lib/ros/ros/ros_node.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
#pragma once
1616

1717
#include <HardwareSerial.h>
18+
#include <STM32FreeRTOS.h>
1819
#include <micro_ros_arduino.h>
1920
#include <rcl/rcl.h>
2021
#include <rclc/executor.h>
2122
#include <rclc/rclc.h>
2223
#include <rmw_microros/rmw_microros.h>
23-
#include <STM32FreeRTOS.h>
2424

2525
#include "clients/client_interface.hpp"
2626
#include "communication_manager.hpp"

src/rosbot_xl/rtos.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,8 @@ void ledStripTask(void* p) {
176176
last_msg_time = now;
177177
idle_state = 0;
178178
reset = true;
179-
}
180-
else if (((now - last_msg_time) > timeout &&
181-
(now - last_idle_change) > idle_period)) {
179+
} else if (((now - last_msg_time) > timeout &&
180+
(now - last_idle_change) > idle_period)) {
182181
if (idle_state == 0) {
183182
idleAnimation(g_led_strip, 0xA0, 0xA0, 0xA0, interval, reset);
184183
idle_state = 1;

0 commit comments

Comments
 (0)