Skip to content

Commit f729267

Browse files
committed
upd
1 parent f742fcc commit f729267

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Foo](https://img.shields.io/badge/Version-1.19.4-brightgreen.svg?style=flat-square)](#versions)
1+
[![Foo](https://img.shields.io/badge/Version-1.20-brightgreen.svg?style=flat-square)](#versions)
22
[![Foo](https://img.shields.io/badge/Website-AlexGyver.ru-blue.svg?style=flat-square)](https://alexgyver.ru/)
33
[![Foo](https://img.shields.io/badge/%E2%82%BD$%E2%82%AC%20%D0%9D%D0%B0%20%D0%BF%D0%B8%D0%B2%D0%BE-%D1%81%20%D1%80%D1%8B%D0%B1%D0%BA%D0%BE%D0%B9-orange.svg?style=flat-square)](https://alexgyver.ru/support_alex/)
44

@@ -531,6 +531,7 @@ void loop() {
531531
- v1.19.2 - ещё немного увеличена производительность, спасибо XRay3D
532532
- v1.19.3 - сделал высокий уровень кнопки по умолчанию в виртуальном режиме
533533
- v1.19.4 - фикс EncButton2
534+
- v1.20 - исправлена критическая ошибка в EncButton2
534535

535536
<a id="feedback"></a>
536537
## Баги и обратная связь

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EncButton
2-
version=1.19.4
2+
version=1.20
33
author=AlexGyver <[email protected]>
44
maintainer=AlexGyver <[email protected]>
55
sentence=Light and fast library for button and encoder operation for Arduino

src/EncButton.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
v1.19.2 - ещё немного увеличена производительность, спасибо XRay3D
4646
v1.19.3 - сделал высокий уровень кнопки по умолчанию в виртуальном режиме
4747
v1.19.4 - фикс EncButton2
48+
v1.20 - исправлена критическая ошибка в EncButton2
4849
*/
4950

5051
#ifndef _EncButton_h

src/EncButton2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ static const int8_t _EB_DIR[] = {
6969
#define VIRT_ENCBTN 5
7070
#define VIRT_ENC 6
7171

72-
#define EB_PIN_AM (_EB_TYPE <= 3 ? _EB_TYPE : 0)
72+
#define EB_PIN_AM ((_EB_TYPE == EB_BTN) ? 1 : (_EB_TYPE == EB_ENCBTN ? 3 : 2))
7373

7474
// ===================================== CLASS =====================================
7575
template < uint8_t _EB_TYPE, uint8_t _EB_MODE = EB_TICK >
7676
class EncButton2 {
7777
public:
7878
// pinMode, pin1, pin2, pin3
79-
EncButton2(uint8_t mode = INPUT, uint8_t P1 = 255, uint8_t P2 = 255, uint8_t P3 = 255) {
79+
EncButton2(uint8_t mode = INPUT_PULLUP, uint8_t P1 = 255, uint8_t P2 = 255, uint8_t P3 = 255) {
8080
setButtonLevel(_EB_TYPE <= 3 ? LOW : HIGH); // высокий уровень в виртуальном режиме
8181
setPins(mode, P1, P2, P3);
8282
}

0 commit comments

Comments
 (0)