addr check flag added

This commit is contained in:
2024-02-20 16:35:02 +03:00
parent 2afb7cff23
commit 024888e841
4 changed files with 105 additions and 74 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include <Arduino.h>
#define IRDEBUG_INFO
/*//////////////////////////////////////////////////////////////////////////////////////
Для работы в паре положить декодер в энкодер
@ -38,7 +40,7 @@ msg type:
                                        // | xxx..... | = тип сообщения
                                        // | ...xxxxx | = длина (максимум 31 бита)
                                        //  ---------- */
#define IR_MSG_BACK 0U // | 000..... | = Задний сигнал машинки
#define IR_MSG_BACK 0U // | 0000B.... | = Задний сигнал машинки
;// // | \\\x---- | = нужна ли адресация
;// // | \\\-xxxx | = длина данных (Равна нулю при отсутствии сквозных команд)
#define IR_MSG_ACCEPT 1U // | 001..... | = подтверждение
@ -173,8 +175,9 @@ public:
protected:
ErrorsStruct errors;
void checkaddressRuleApply(uint16_t &address, uint16_t &id, bool &flag) {
void checkaddressRuleApply(uint16_t address, uint16_t id, bool &flag) {
flag = false;
flag |= id == 0;
flag |= address == id;
flag |= address >= IR_Broadcast;
}