mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 07:17:16 +00:00
Berry counter 0-base (#19561)
This commit is contained in:
parent
7de25acac0
commit
761ddaa57b
@ -249,7 +249,7 @@ extern "C" {
|
||||
#ifdef USE_COUNTER
|
||||
int32_t argc = be_top(vm); // Get the number of arguments
|
||||
if (argc >= 1 && be_isint(vm, 1)) {
|
||||
int32_t counter = be_toint(vm, 1);
|
||||
int32_t counter = be_toint(vm, 1) + 1; // counter are 0 based in Berry, 1 based in Tasmota
|
||||
|
||||
// is `index` refering to a counter?
|
||||
if (CounterPinConfigured(counter)) {
|
||||
@ -270,7 +270,7 @@ extern "C" {
|
||||
#ifdef USE_COUNTER
|
||||
int32_t argc = be_top(vm); // Get the number of arguments
|
||||
if (argc >= 2 && be_isint(vm, 1) && be_isint(vm, 2)) {
|
||||
int32_t counter = be_toint(vm, 1);
|
||||
int32_t counter = be_toint(vm, 1) + 1; // counter are 0 based in Berry, 1 based in Tasmota
|
||||
int32_t value = be_toint(vm, 2);
|
||||
|
||||
// is `index` refering to a counter?
|
||||
|
Loading…
x
Reference in New Issue
Block a user