Skip to content

Commit 0041ed1

Browse files
committed
revert breaking PR arendst#24192
1 parent f2a3b4a commit 0041ed1

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

lib/libesp32/berry_tasmota/src/be_tasmota_lib.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ extern int l_publish_rule(bvm *vm);
2121
extern int l_cmd(bvm *vm);
2222
extern int l_getoption(bvm *vm);
2323
extern int l_millis(bvm *vm);
24-
extern int l_micros(bvm *vm);
2524
extern int l_timereached(bvm *vm);
2625
extern int l_rtc(bvm *vm);
2726
extern int l_rtc_utc(bvm *vm);
@@ -115,8 +114,7 @@ class be_class_tasmota (scope: global, name: Tasmota) {
115114
publish_rule, func(l_publish_rule)
116115
_cmd, func(l_cmd)
117116
get_option, func(l_getoption)
118-
millis, static_func(l_millis)
119-
micros, static_func(l_micros)
117+
millis, func(l_millis)
120118
time_reached, func(l_timereached)
121119
rtc, static_func(l_rtc)
122120
rtc_utc, func(l_rtc_utc)

tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ extern "C" {
119119
int32_t l_millis(struct bvm *vm);
120120
int32_t l_millis(struct bvm *vm) {
121121
int32_t top = be_top(vm); // Get the number of arguments
122-
if (top == 0 || (top == 1 && be_isint(vm, 1))) { // only 1 argument of type string accepted
122+
if (top == 1 || (top == 2 && be_isint(vm, 2))) { // only 1 argument of type string accepted
123123
uint32_t delay = 0;
124124
if (top == 2) {
125-
delay = be_toint(vm, 1);
125+
delay = be_toint(vm, 2);
126126
}
127127
uint32_t ret_millis = millis() + delay;
128128
be_pushint(vm, ret_millis);
@@ -131,14 +131,6 @@ extern "C" {
131131
be_raise(vm, kTypeError, nullptr);
132132
}
133133

134-
// Berry: tasmota.micros() -> int
135-
//
136-
int32_t l_micros(struct bvm *vm);
137-
int32_t l_micros(struct bvm *vm) {
138-
be_pushint(vm, micros());
139-
be_return(vm); // Return
140-
}
141-
142134
// Berry: tasmota.get_option(index:int) -> int
143135
//
144136
int32_t l_getoption(struct bvm *vm);

0 commit comments

Comments
 (0)