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

[Question] Possible undefined timer behaviour #2582

Closed
vintagepc opened this issue Apr 6, 2020 · 2 comments
Closed

[Question] Possible undefined timer behaviour #2582

vintagepc opened this issue Apr 6, 2020 · 2 comments
Labels

Comments

@vintagepc
Copy link
Contributor

Found while investigating a bootloop with simulated timers. I'm not sure whether this is of concern since it clearly works in practice, but seems like it has the potential for odd problems:

In setup() in Marlin_main.cpp:
line 1010 of ultralcd_init() calls backlight_init() which requests _delay(10) after setting LCD_BL_PIN.

However, timer2 (whose TOIE is used for the delay) is not actually initialized until tp_init() (Line 1241) of the same function.

@leptun
Copy link
Collaborator

leptun commented Apr 9, 2020

Maybe the simulated timer has a different initial state than the actual hardware.

@vintagepc
Copy link
Contributor Author

Probably - though I searched and only found a blanket statement that they are disabled until set up by default.

Thoughts on where I might be able to find the initial state?

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

No branches or pull requests

2 participants