Fix more warnings seen with "--warnings all"

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2023-06-01 00:39:56 +02:00
parent a1d4a36379
commit c5e254c9a9
3 changed files with 6 additions and 6 deletions

View file

@ -35,7 +35,7 @@ void MQTTClass::receive(const char *topic, byte*payload, uint32_t length) {
//Serial.println();
// We need to start at the last slash in the data
uint16_t ndx = strlen(topic) - 1;
int16_t ndx = strlen(topic) - 1;
// ------------------+
// shades/1/target/set
while(ndx >= 0 && topic[ndx] != '/') ndx--; // Back off the set command

View file

@ -1831,7 +1831,7 @@ static somfy_rx_queue_t rx_queue;
bool somfy_tx_queue_t::pop(somfy_tx_t *tx) {
// Read the oldest index.
for(uint8_t i = MAX_TX_BUFFER - 1; i >= 0; i--) {
for(int8_t i = MAX_TX_BUFFER - 1; i >= 0; i--) {
if(this->index[i] < MAX_TX_BUFFER) {
uint8_t ndx = this->index[i];
memcpy(tx, &this->items[ndx], sizeof(somfy_tx_t));
@ -1881,7 +1881,7 @@ void somfy_rx_queue_t::init() {
bool somfy_rx_queue_t::pop(somfy_rx_t *rx) {
// Read off the data from the oldest index.
//Serial.println("Popping RX Queue");
for(uint8_t i = MAX_RX_BUFFER - 1; i >= 0; i--) {
for(int8_t i = MAX_RX_BUFFER - 1; i >= 0; i--) {
if(this->index[i] < MAX_RX_BUFFER) {
uint8_t ndx = this->index[i];
memcpy(rx, &this->items[this->index[i]], sizeof(somfy_rx_t));

View file

@ -165,7 +165,7 @@ void Web::begin() {
Serial.print("Received:");
Serial.println(apiServer.arg("plain"));
// Send the command to the shade.
if(target >= 0 && target <= 100)
if(target <= 100)
shade->moveToTarget(target);
else
shade->sendCommand(command, repeat);
@ -686,7 +686,7 @@ void Web::begin() {
Serial.print("Received:");
Serial.println(server.arg("plain"));
// Send the command to the shade.
if(target >= 0 && target <= 100)
if(target <= 100)
shade->moveToTiltTarget(target);
else
shade->sendTiltCommand(command);
@ -753,7 +753,7 @@ void Web::begin() {
Serial.print("Received:");
Serial.println(server.arg("plain"));
// Send the command to the shade.
if(target >= 0 && target <= 100)
if(target <= 100)
shade->moveToTarget(target);
else
shade->sendCommand(command, repeat);