Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 committed Dec 20, 2023
1 parent 8ec71a3 commit db60f5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions firmware/src/apps/raesp/comps/RadioCommander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ namespace apps::raesp::comps
Topics like OOK/1234/16 will be handled by nexa protocol.
Topics like OOK/1 will be handled by ningbo protocol.
*/
auto delim_idx{topic.find('/', rfTopicPrefix.length() + 1)};

uint32_t address{0};
int16_t unit{RC_UNIT_NONE};

if (delim_idx != std::string_view::npos)
if (auto delim_idx{topic.find('/', rfTopicPrefix.length() + 1)}; delim_idx != std::string_view::npos)
{
auto address_sv{topic.substr(rfTopicPrefix.length(), delim_idx - rfTopicPrefix.length())};
if (!ksf::from_chars(address_sv, address))
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/apps/raesp/protocols/ningbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace apps::raesp::protocols
{
void tx_ningbo_bit(const proto_pins& pins, const char bitChar)
{
bool isBitCharOne = bitChar == '1';
if (bitChar == '0' || isBitCharOne)

if (bool isBitCharOne{bitChar == '1'}; bitChar == '0' || isBitCharOne)
{
proto_high_for(pins,PULSE_SHORT_A);
proto_low_for(pins, PULSE_LONG_B);
Expand Down

0 comments on commit db60f5d

Please sign in to comment.