Skip to content

Commit

Permalink
all: remove extra whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Aug 9, 2024
1 parent 658286f commit 68892a0
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions code/espurna/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ template <typename Handler, typename Get, typename Put>
void add(StringView path, Get&& get, Put&& put) {
add<Handler, Get, Put>(
path.toString(),
std::forward<Get>(get),
std::forward<Get>(get),
std::forward<Put>(put));
}

Expand Down Expand Up @@ -764,7 +764,7 @@ void setup() {
}

} // namespace
} // namespace api
} // namespace api
} // namespace espurna

// -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/filters/MedianFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MedianFilter : public BaseFilter {
});
_values.insert(upper, pending);
}

double value() const override {
// Special case when early report triggers value read
if (_values.size() == 1) {
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/garland/animations/anim_glow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AnimGlow : public Anim {
prevColor = palette->getRndInterpColor();
curColor = palette->getRndInterpColor();
inc = secureRandom(2) * 2 - 1;

colorInterp = 0;
colorInterpSpeed = ((float)secureRandom(10, 20)) / 1000;
flashDeciPercent = fiftyFifty() ? 0 : secureRandom(5, 20);
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/garland/animations/anim_randrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AnimRandRun : public Anim {
pos += speed * dir;
if (pos >= numLeds) pos -= numLeds;
if (pos < 0) pos += numLeds;

for (auto i = 0; i < numLeds; ++i) {
int j = i + pos;
if (j >= numLeds) j -= numLeds;
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/garland/animations/anim_waves.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AnimWaves : public Anim {

// if first wave is comet - inverse second wave probability to be comer to 60%
if (wave1Type == WaveType::Comet) {
wave2Type = wave2Type == WaveType::Comet ? WaveType::Wave : WaveType::Comet;
wave2Type = wave2Type == WaveType::Comet ? WaveType::Wave : WaveType::Comet;
}

// we have only one pixel array for cache
Expand Down
4 changes: 2 additions & 2 deletions code/espurna/garland/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Color {
return Color();
}

//interpolates between this color and provided.
//interpolates between this color and provided.
//x is from 0 to 1, 0 gives this color, 1 gives provided color, values between give interpolation
Color interpolate(Color color, float x) const {
int r0 = x * (color.r - r) + r;
Expand Down Expand Up @@ -69,7 +69,7 @@ class Color {
if (g>=dg) { g=g-dg; } else { g=0; }
if (b>=db) { b=b-db; } else { b=0; }
return *this;
}
}

Color max_bright() {
if (r==255 || g==255 || b==255)
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/garland/palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Palette {
Color getCloseCleanColor(const Color& refColor) const {
int bestDiff = 0;
Color bestColor;

for (auto i = 0; i < _numColors; ++i) {
Color newColor = _colors[i];
int diff = refColor.howCloseTo(newColor);
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/garland/scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Scene {
float cycleFactor = getCycleFactor(GARLAND_SCENE_DEFAULT_SPEED);
// speed is reverse to cycleFactor. For forward direction control of animation speed.
// Recommended values: 30 < speed < 60.
// Correspondence:
// Correspondence:
// speed=60, cycleFactor=1
// speed=30, cycleFactor=4
byte speed = GARLAND_SCENE_DEFAULT_SPEED;
Expand Down
4 changes: 2 additions & 2 deletions code/espurna/ifan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void configure() {
.speed = settings::speed()};

internal::config = updated;
pin_update();
pin_update();
}

// Note that we use API speed endpoint strictly for the setting
Expand Down Expand Up @@ -477,7 +477,7 @@ RelayProviderBasePtr make_relay_provider(size_t index) {
RelayProviderBasePtr out;

if (setup()) {
out = std::make_unique<FanRelayProvider>();
out = std::make_unique<FanRelayProvider>();
internal::relay_id = index;
}

Expand Down
2 changes: 1 addition & 1 deletion code/espurna/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void setup() {
#if USE_EXTRA
extraSetup();
#endif

// Update `cfg` version
migrate();

Expand Down
2 changes: 1 addition & 1 deletion code/espurna/ota_httpupdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void run(WiFiClient* client, const String& url) {

void clientFromHttp(const String& url) {
auto client = std::make_unique<WiFiClient>();
run(client.get(), url);
run(client.get(), url);
}

#if SECURE_CLIENT == SECURE_CLIENT_BEARSSL
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/sensors/DallasSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ class Init : public sensor::PreInit {
if (!_port) {
_port = std::make_shared<Port>();
}

// TODO hybrid mode with an extra pull-up pin?
// TODO parasite *can* be detected for DS18X, see
// 'DS18B20 .pdf / ROM Commands / Read Power Supply (0xB4)'
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/sensors/DigitalSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class Sensor : public BaseSensor {
}

void pre() override {
_current = digitalRead(_pin);
_current = digitalRead(_pin);
}

// Current value for slot # index
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/sensors/INA219Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class INA219Sensor : public I2CSensor<BaseEmonSensor> {

enum AdcMode : uint8_t {
// raw readings, no sampling
// fastest conversion time (less than 1 ms)
// fastest conversion time (less than 1 ms)
// 84, 148, 276 and 532 μs respectively
BIT_MODE_9 = 0,
BIT_MODE_10 = 0b01,
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/sensors/MHZ19Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class MHZ19Sensor : public BaseSensor {
return;
}

uint16_t value =
uint16_t value =
uint16_t(response.data[2] << 8)
+ uint16_t(response.data[3]);
_co2 = value;
Expand Down
6 changes: 3 additions & 3 deletions code/espurna/sensors/PM1006Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class PM1006Sensor : public BaseSensor {
void _read() {

while(_serial->available()) {

unsigned char ch = _serial->read();
if ((_position > 0) || (ch == 0x16)) {
_buffer[_position] = ch;
Expand All @@ -115,7 +115,7 @@ class PM1006Sensor : public BaseSensor {
}
}
yield();

}

}
Expand All @@ -124,7 +124,7 @@ class PM1006Sensor : public BaseSensor {

unsigned char _buffer[20] = {0};
unsigned char _position = 0;

double _pm25 = 0;
Stream* _serial { nullptr };

Expand Down
6 changes: 3 additions & 3 deletions code/espurna/sensors/SM300D2Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class SM300D2Sensor : public BaseSensor {
void _read() {

while(_serial->available()) {

unsigned char ch = _serial->read();
if ((_position > 0) || (ch == 0x3C)) {
_buffer[_position] = ch;
Expand All @@ -148,7 +148,7 @@ class SM300D2Sensor : public BaseSensor {
}
}
yield();

}

}
Expand All @@ -157,7 +157,7 @@ class SM300D2Sensor : public BaseSensor {

unsigned char _buffer[17] = {0};
unsigned char _position = 0;

double _co2 = 0;
double _ch2o = 0;
double _tvoc = 0;
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/settings_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Result parse(StringView view, int num, int den) {

update_floating:
{
// only seconds and up, anything down of milli does not make sense here
// only seconds and up, anything down of milli does not make sense here
if (den > 1) {
goto reset;
}
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ bool forced_modem_sleep() {
});
}

// CPU + RF power saving mode.
// CPU + RF power saving mode.
// SDK enters IDLE task with minimal amount of operations.
// User code would not be executed while the device is asleep.
// On wakeup, execution resumes from this point.
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/terminal_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Commands {
const Command* end;
};

// store name<->func association at runtime
// store name<->func association at runtime
void add(Commands);

template <size_t Size>
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/terminal_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Result Parser::operator()(StringView line) {
}
break;

case State::Done:
case State::Done:
goto out;

case State::Text:
Expand Down
4 changes: 2 additions & 2 deletions code/espurna/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void commonSetup() {

_thermostat_mode_cooler = getSetting(NAME_THERMOSTAT_MODE, THERMOSTAT_MODE_COOLER_BY_DEFAULT);
DEBUG_MSG_P(PSTR("[THERMOSTAT] _thermostat_mode_cooler = %d\n"), _thermostat_mode_cooler);

_temp_range.min = getSetting(NAME_TEMP_RANGE_MIN, THERMOSTAT_TEMP_RANGE_MIN);
_temp_range.max = getSetting(NAME_TEMP_RANGE_MAX, THERMOSTAT_TEMP_RANGE_MAX);
DEBUG_MSG_P(PSTR("[THERMOSTAT] _temp_range.min = %d\n"), _temp_range.min);
Expand All @@ -286,7 +286,7 @@ void _thermostatReload() {
int prev_temp_range_max = _temp_range.max;

commonSetup();

if (_temp_range.min != prev_temp_range_min)
notifyRangeChanged(true);
if (_temp_range.max != prev_temp_range_max)
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/tuya.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ namespace tuya {
filter = getSetting("tuyaFilter", 1 == TUYA_FILTER_ENABLED);

// Install main loop method and WiFiStatus ping (only works with specific mode)

::espurnaRegisterLoop(loop);
::wifiRegister([](espurna::wifi::Event event) {
switch (event) {
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/tuya_dataframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DataFrameView {
uint8_t operator[](size_t i) const {
return *(_begin + i);
}

uint8_t version() const {
return _version;
}
Expand Down
4 changes: 2 additions & 2 deletions code/espurna/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct Callback {

// when T *can* be converted into Callback::Type
// usually, function pointer *or* lambda without capture list
template <typename T,
template <typename T,
typename = typename std::enable_if<
is_type<T>::value
|| type_convertible<T>::value>::type>
Expand All @@ -95,7 +95,7 @@ struct Callback {
{}

// anything else convertible into std function
template <typename T,
template <typename T,
typename = typename std::enable_if<
!is_callback<T>::value>::type,
typename = typename std::enable_if<
Expand Down
6 changes: 3 additions & 3 deletions code/espurna/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ BasePortPtr hardware_port(
(rx == GPIO_NONE)
? SERIAL_TX_ONLY :
((tx != GPIO_NONE) && (rx != GPIO_NONE))
? SERIAL_FULL
? SERIAL_FULL
: -1;
if (mode < 0) {
return nullptr;
Expand Down Expand Up @@ -347,7 +347,7 @@ constexpr types::SoftwareConfig from_config(Config config) {
software_serial_data_bits_from_config(config.data_bits)
| software_serial_parity_from_config(config.parity)
| software_serial_stop_bits_from_config(config.stop_bits));

}

BasePortPtr software_serial_port(
Expand Down Expand Up @@ -408,7 +408,7 @@ BasePortPtr make_port(size_t index) {
out = software_serial_port(baudrate, tx, rx, config, invert);
}
#endif

return out;
}

Expand Down
8 changes: 4 additions & 4 deletions code/espurna/uartmqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ String serialize(Bytes bytes, bool encode) {
} else {
const auto length = std::min(string.size(), bytes.size());
bytes = Bytes(bytes.begin(), length);

std::copy(bytes.begin(), bytes.end(),
string.begin());
out.concat(string.begin(), length);
Expand Down Expand Up @@ -139,7 +139,7 @@ void read(Stream& stream, uint8_t termination, bool encode) {
if (available && capacity) {
const auto length = std::min(capacity, available);
internal::cursor += stream.readBytes(internal::cursor, length);

if (!mqttConnected()) {
internal::cursor = internal::buffer.begin();
return;
Expand All @@ -159,7 +159,7 @@ void read(Stream& stream, uint8_t termination, bool encode) {
if (data.size()) {
send(data, encode);
}

++it;
internal::cursor = std::copy(it, cursor, begin);
} while (internal::cursor != begin);
Expand All @@ -178,7 +178,7 @@ void enqueue(String data) {

void write(Print& print, uint8_t termination, bool decode) {
using Clock = time::CoreClock;

const auto start = Clock::now();
while (!internal::queue.empty() && (Clock::now() - start < build::WriteWindow)) {
const auto& front = internal::queue.front();
Expand Down
2 changes: 1 addition & 1 deletion code/html/spec/template.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ beforeAll(async () => {
<template id="template-basic-cfg">
<fieldset>
<legend>Some input and text fields</legend>
<input name="foo" type="text"></input>
<input name="foo" type="text"></input>
<span data-key="bar"></span>
<span data-key="template-id" data-pre="#"></span>
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion code/html/src/light.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function onChannelSliderChange(event) {

const target = event.target;
textForNextSibling(target, target.value);

const id = target.dataset["id"];
if (!id) {
return;
Expand Down
Loading

0 comments on commit 68892a0

Please sign in to comment.