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

Errors in code within redraw() function seem to break other event loops in the system #952

Closed
dansimco opened this issue Nov 29, 2019 · 6 comments

Comments

@dansimco
Copy link

@dansimco dansimco commented Nov 29, 2019

I've been skirting around this bug for a while without being able to reliably replicate it outside of a much bigger codebase full of red herrings. I started a new sketch today and ran into it immediately so here it is! If I make a syntactical or logical error that is called within my redraw function, it seems to have side effects on other parts of the system. When the code below is run, it will fail at screen.aa(true) which expects a number. At this point all I can do is reset norns. If I was to load Awake without resetting, it would try to load it but the clock wouldn't run. If I fix the error and retry my script, nothing really happens.

This is true with as of norns 191126

My example code is

function init()
  redraw()
end

function redraw()
  screen.clear()
  screen.level(8)
  line_height = 8
  screen.aa(true) -- here is an error (it expects a number)
  screen.move(0, line_height)
  screen.font_face(1)
  screen.font_size(8)
  screen.text("the quick brown fox.wav")
  screen.update()
end
@tehn
Copy link
Member

@tehn tehn commented Nov 29, 2019

thanks for spotting this, will get on it!

@dansimco
Copy link
Author

@dansimco dansimco commented Dec 1, 2019

Not sure if there are other patches to apply, but I applied the changes from #956 to my menu.lua file and the crash above still happens. Though the menu re-render is better now :)

@dansimco
Copy link
Author

@dansimco dansimco commented Dec 1, 2019

To clarify, If I run the code above. Then switch to Awake, I can use the encoders and keys to modify the sequence, but the sequencer clock does not run.

@tehn
Copy link
Member

@tehn tehn commented Dec 1, 2019

looking into it!

@tehn tehn reopened this Dec 1, 2019
@tehn
Copy link
Member

@tehn tehn commented Dec 1, 2019

ok. yet another (different) problem.

errors in init are not being caught correctly. working on it.

@dansimco
Copy link
Author

@dansimco dansimco commented Dec 2, 2019

Thank you! I am going to be SO much more efficient now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants