Code Monkey home page Code Monkey logo

Comments (14)

GyverLibs avatar GyverLibs commented on July 18, 2024

Как получить столько варнингов? У меня ни одного

from encbutton.

demosspro avatar demosspro commented on July 18, 2024

https://pastebin.com/nhXGximF
Вот код пульта-передатчика.
После пары последних обновлений повылезала куча.
Может для простых кнопок все же вернуться к GyverButton?

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

Аналогичная история. Варнинги один в один с ТС-ом. Так понимаю, решения нет?

from encbutton.

GyverLibs avatar GyverLibs commented on July 18, 2024

Варнинг - не ошибка) если кто то поможет пофиксить непонятные варнинги от шаблона - их не будет

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

Варнинг - не ошибка) если кто то поможет пофиксить непонятные варнинги от шаблона - их не будет

В общем, разобрался. В либе EncButton.h в строке 384 нужно заменить это
if (debounce < (_holdT << 7))
на это
if (debounce < (uint32_t)(_holdT << 7))
Поправь приведение типов, а то платформио варнингами сыпет на весь экран. Ну и предыдущему товарищу решение.
Спасибо.

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

Ну и спасибо тебе за труд, дружище)

from encbutton.

GyverLibs avatar GyverLibs commented on July 18, 2024

Не, этот варнинг ерунда, с ним все понятно. Компилятору лень делать свою работу)

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

С ним и остальные пропадают.

from encbutton.

GyverLibs avatar GyverLibs commented on July 18, 2024

if (debounce < (uint8_t)(_holdT << 7))
Не, так всё сломается, там ведь uint16_t вычисления

from encbutton.

GyverLibs avatar GyverLibs commented on July 18, 2024

С ним и остальные пропадают.

Ну и бред) тогда поправлю и релизну сейчас

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

С ним и остальные пропадают.

Ну и бред) тогда поправлю и релизну сейчас

Опечатался. Там сравнивается с 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.

GyverLibs avatar GyverLibs commented on July 18, 2024

Самое смешное то в том, что _holdT - изначально unsigned. Непонятно как сдвиг заставляет компилятор решить, что число вдруг стало signed

from encbutton.

Seriyv0lk avatar Seriyv0lk commented on July 18, 2024

Меня тоже это сбило с толку сначала. Потом пошёл по цепочке и нашёл несовпадающие типы. Прописал и стало нормально компилиться. Что в ардуине, что в платформио.

from encbutton.

GyverLibs avatar GyverLibs commented on July 18, 2024

В общем залил

from encbutton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.