Comments (14)
Как получить столько варнингов? У меня ни одного
from encbutton.
https://pastebin.com/nhXGximF
Вот код пульта-передатчика.
После пары последних обновлений повылезала куча.
Может для простых кнопок все же вернуться к GyverButton?
from encbutton.
Аналогичная история. Варнинги один в один с ТС-ом. Так понимаю, решения нет?
from encbutton.
Варнинг - не ошибка) если кто то поможет пофиксить непонятные варнинги от шаблона - их не будет
from encbutton.
Варнинг - не ошибка) если кто то поможет пофиксить непонятные варнинги от шаблона - их не будет
В общем, разобрался. В либе EncButton.h в строке 384 нужно заменить это
if (debounce < (_holdT << 7))
на это
if (debounce < (uint32_t)(_holdT << 7))
Поправь приведение типов, а то платформио варнингами сыпет на весь экран. Ну и предыдущему товарищу решение.
Спасибо.
from encbutton.
Ну и спасибо тебе за труд, дружище)
from encbutton.
Не, этот варнинг ерунда, с ним все понятно. Компилятору лень делать свою работу)
from encbutton.
С ним и остальные пропадают.
from encbutton.
if (debounce < (uint8_t)(_holdT << 7))
Не, так всё сломается, там ведь uint16_t вычисления
from encbutton.
С ним и остальные пропадают.
Ну и бред) тогда поправлю и релизну сейчас
from encbutton.
С ним и остальные пропадают.
Ну и бред) тогда поправлю и релизну сейчас
Опечатался. Там сравнивается с 32-разрядным. Компилер его и хочет.
А у меня было так до правки:
In file included from src\main.cpp:4:0: C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h: In instantiation of 'void EncButton<_EB_MODE, _S1, _S2, _KEY>::poolBtn() [with unsigned char _EB_MODE = 0; unsigned char _S1 = 1; unsigned char _S2 = 255; unsigned char _KEY = 255]': C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:193:24: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tickISR(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 1; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:166:16: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tick(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 1; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' src\main.cpp:35:14: required from here C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:384:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (debounce < ((uint8_t) _holdT << 7)) { // прошло меньше удержания ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h: In instantiation of 'void EncButton<_EB_MODE, _S1, _S2, _KEY>::poolBtn() [with unsigned char _EB_MODE = 0; unsigned char _S1 = 5; unsigned char _S2 = 255; unsigned char _KEY = 255]': C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:193:24: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tickISR(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 5; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:166:16: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tick(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 5; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' src\main.cpp:36:13: required from here C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:384:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h: In instantiation of 'void EncButton<_EB_MODE, _S1, _S2, _KEY>::poolBtn() [with unsigned char _EB_MODE = 0; unsigned char _S1 = 4; unsigned char _S2 = 255; unsigned char _KEY = 255]': C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:193:24: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tickISR(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 4; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:166:16: required from 'uint8_t EncButton<_EB_MODE, _S1, _S2, _KEY>::tick(uint8_t, uint8_t, uint8_t) [with unsigned char _EB_MODE = 0; unsigned char _S1 = 4; unsigned char _S2 = 255; unsigned char _KEY = 255; uint8_t = unsigned char]' src\main.cpp:37:14: required from here C:\Users\Sergey\Documents\Arduino\libraries\EncButton\src/EncButton.h:384:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
from encbutton.
Самое смешное то в том, что _holdT - изначально unsigned. Непонятно как сдвиг заставляет компилятор решить, что число вдруг стало signed
from encbutton.
Меня тоже это сбило с толку сначала. Потом пошёл по цепочке и нашёл несовпадающие типы. Прописал и стало нормально компилиться. Что в ардуине, что в платформио.
from encbutton.
В общем залил
from encbutton.
Related Issues (20)
- Нет реакции на поворот энкодера на LGT8F328p HOT 3
- Конфликтует с библиотекой ArduinoJson HOT 2
- Проблема с энкодерами HOT 2
- Не работают прерывания, как следует на stm32 HOT 1
- Добавить поддержку энкодера HOT 18
- Не работает на Arduino Nano 33 BLE HOT 36
- Опрос кнопок в момент перезагрузки устройства HOT 5
- Проект на wokwi с кнопками EncButton HOT 61
- Todo? HOT 8
- Migration from V2 to V3: tick() returns unreliable status HOT 5
- the 'eb.clear()' does not really set the encoder counter to 0 HOT 1
- Unusual step counting by rotary encoder HOT 5
- Многократное срабатывание виртуальной кнопки при однократном нажатии кнопки HOT 3
- fast() всегда false
- Ke-040 и 74hc165 HOT 9
- Совместимость с ESP8266 (Wemos D1 Mini) HOT 4
- Передать аргументы в событие. HOT 9
- 3.5.1 Won't compile HOT 1
- Описка в README HOT 1
- Внутрення подтяжка пинов INPUT_PULLUP HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from encbutton.