Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmr.create():alarm() Broken on New (dev d72ea91) #3261

Closed
chathurangawijetunge opened this issue Aug 30, 2020 · 5 comments · Fixed by #3263
Closed

tmr.create():alarm() Broken on New (dev d72ea91) #3261

chathurangawijetunge opened this issue Aug 30, 2020 · 5 comments · Fixed by #3263
Labels

Comments

@chathurangawijetunge
Copy link

chathurangawijetunge commented Aug 30, 2020

Device : ESP8266

NodeMCU 3.0.0.0 built on nodemcu-build.com provided by frightanic.com
	branch: dev
	commit: d72ea91ed01518ef0779d7aa998c5c3a9c269d71
	release: 
	release DTS: 202008291943
	SSL: false
	build type: integer
	LFS: 0x40000 bytes total capacity
	modules: file,gpio,mqtt,net,node,rtctime,sntp,tmr,uart,wifi
 build 2020-08-30 03:24 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)

Code:-

if not tmr.create():alarm(5000, tmr.ALARM_SINGLE, function()
  print("hey there")
end)
then
  print("whoopsie")
end

Error:-
Lua error: stdin:1: bad argument #1 to 'alarm' (boolean expected)
stack traceback:
[C]: in function 'alarm'
stdin:1: in main chunk
[C]: ?
[C]: ?

@chathurangawijetunge chathurangawijetunge changed the title tmr.create():alarm() Broken on New (dev) tmr.create():alarm() Broken on New (dev d72ea91ed01518ef0779d7aa998c5c3a9c269d71) Aug 30, 2020
@chathurangawijetunge chathurangawijetunge changed the title tmr.create():alarm() Broken on New (dev d72ea91ed01518ef0779d7aa998c5c3a9c269d71) tmr.create():alarm() Broken on New (dev d72ea91) Aug 30, 2020
@galjonsfigur
Copy link
Member

Can confirm - commit d72ea91 is causing this issue and it has to do with how alarm function is done in C code. It looks like becuse of tmr:start now accepts arguments, function tmr_alarm would have to manipulate the stack somehow before calling tmr_start - I could be wrong as I'm not an Lua C API expert. @vsky279 could you look at this issue?

@marcelstoer
Copy link
Member

marcelstoer commented Aug 30, 2020

We definitely need to fix this before the next master drop 😞 Sorry for not having tested this manually myself before merging @vsky279's PR.

@vsky279
Copy link
Contributor

vsky279 commented Aug 30, 2020

I'll have a look. Sorry about that.

The mentioned PR below is fixing the issue.

@vsky279 vsky279 mentioned this issue Aug 30, 2020
4 tasks
@mk-pmb
Copy link
Contributor

mk-pmb commented Aug 31, 2020

Let's discuss strategies for automated hardware testing on Gitter.

@vsky279
Copy link
Contributor

vsky279 commented Aug 31, 2020

I think the fix is ready to be merged.

@marcelstoer marcelstoer linked a pull request Sep 1, 2020 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants