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

Add RTC to firmware #318

Merged
merged 3 commits into from
Sep 12, 2024
Merged

Add RTC to firmware #318

merged 3 commits into from
Sep 12, 2024

Conversation

Kampi
Copy link
Collaborator

@Kampi Kampi commented Jul 18, 2024

Closes #309

@Kampi Kampi requested a review from jakkra July 18, 2024 13:56
@Kampi
Copy link
Collaborator Author

Kampi commented Jul 30, 2024

@jakkra we have to modify the RTC patch and replace

    if (regs[0] & RV8263_BM_OS) {
        return -ECANCELED;
    }

with

    /* Clear the oscillator stop flag and return an error when the oscillator is stopped. */
    /* The flag is set again if the error condition for the oscillator is still active. */
    if (regs[0] & RV8263_BM_OS) {
        regs[0] &= ~RV8263_BM_OS;
        i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_SECONDS,
                              regs[0]);
        return -ECANCELED;
    }

What´s the best way to do it? Can I simply copy+paste this code into the patch?

@jakkra
Copy link
Owner

jakkra commented Jul 30, 2024

@jakkra we have to modify the RTC patch and replace

    if (regs[0] & RV8263_BM_OS) {
        return -ECANCELED;
    }

with

    /* Clear the oscillator stop flag and return an error when the oscillator is stopped. */
    /* The flag is set again if the error condition for the oscillator is still active. */
    if (regs[0] & RV8263_BM_OS) {
        regs[0] &= ~RV8263_BM_OS;
        i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_SECONDS,
                              regs[0]);
        return -ECANCELED;
    }

What´s the best way to do it? Can I simply copy+paste this code into the patch?

Idk, try it, see if patch applies correctly otherwise can regenerate the patch

@Kampi Kampi force-pushed the RTC-Implementation branch 16 times, most recently from d1c2032 to 34e09c7 Compare August 1, 2024 21:14
@Kampi
Copy link
Collaborator Author

Kampi commented Aug 7, 2024

@jakkra I´ve updated the RTC patch to the latest version from Zephyr to handle the issue with the alarms.

@jakkra
Copy link
Owner

jakkra commented Aug 7, 2024

@jakkra I´ve updated the RTC patch to the latest version from Zephyr to handle the issue with the alarms.

OK great, will test it. Should everything work if I rebase on this branch or do I need to do something more?

@Kampi
Copy link
Collaborator Author

Kampi commented Aug 7, 2024

I´ve tested it before the new patch and time and update are working. The changes are related to alarms which wasn´t tested by me but I don´t expect any issues.

@Kampi Kampi force-pushed the RTC-Implementation branch 4 times, most recently from bdb74c3 to 3d7d1f8 Compare August 8, 2024 08:17
@Kampi Kampi force-pushed the RTC-Implementation branch 4 times, most recently from 82951a0 to 6686a8e Compare August 30, 2024 05:43
@Kampi Kampi marked this pull request as ready for review August 31, 2024 07:30
@jakkra jakkra force-pushed the RTC-Implementation branch 3 times, most recently from 56dc855 to 0f08fc2 Compare September 12, 2024 20:05
It complicates the code and really doesn't add a anything.
@jakkra jakkra merged commit b16b884 into jakkra:main Sep 12, 2024
13 checks passed
@Kampi Kampi deleted the RTC-Implementation branch September 13, 2024 04:29
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.

Using the RTC update for the 1s periodic event
2 participants