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

Clear Z flag before leaving sda_low #324

Closed
wants to merge 1 commit into from

Conversation

jburks
Copy link
Contributor

@jburks jburks commented May 22, 2022

This PR fixes #323 by ensuring Z flag is clear when returning from sda_low.

Tested on hardware where RTC could not have its time set on r41; RTC time changes (e.g. TI$="235959" from BASIC) correctly take effect after this change.

@jburks
Copy link
Contributor Author

jburks commented May 22, 2022

This also seems to fix #310 on my hardware.

@mist64 mist64 closed this in cff622e May 22, 2022
mist64 added a commit that referenced this pull request May 22, 2022
An earlier optimization used the `tsb` instruction, which activated
a sleeping bug, where writing to an I2C device evaluated the Z
flag after sending 8 bits and receiving the ACK instead of the C
flag.

With this fix, smc_set_activity_led can be turned on again.

Fixes #324
Fixes #310
@jburks jburks deleted the i2c_write_fix branch May 22, 2022 20:47
gaekwad pushed a commit to gaekwad/x16-rom that referenced this pull request Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set RTC due to Z flag semantics in i2c_write
1 participant