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

Create clock module #691

Merged
merged 7 commits into from
Oct 21, 2024
Merged

Create clock module #691

merged 7 commits into from
Oct 21, 2024

Conversation

vinc
Copy link
Owner

@vinc vinc commented Oct 20, 2024

Before:

  • src/sys/clock.rs
  • src/sys/cmos.rs
  • src/sys/time.rs

After:

  • src/sys/clk/mod.rs
  • src/sys/clk/boot.rs
  • src/sys/clk/epoch.rs
  • src/sys/clk/rtc.rs
  • src/sys/clk/cmos.rs
  • src/sys/clk/sync.rs
  • src/sys/clk/timer.rs

@vinc
Copy link
Owner Author

vinc commented Oct 20, 2024

This last commit is a breaking change for the API and the device files:

clk

  • The clock at /dev/clk/boot (previously at /dev/clk/uptime) returns the number of seconds since boot
  • The clock at /dev/clk/epoch (previously at /dev/clk/realtime) returns the number of seconds since epoch
  • The clock at /dev/clk/rtc (previously at /dev/rtc) returns the value of the RTC

@vinc
Copy link
Owner Author

vinc commented Oct 21, 2024

This last commit prevent panicking when writing to some device files where writing was not implemented like copy something /dev/clk/epoch, instead the operation will return an error.

@vinc vinc marked this pull request as ready for review October 21, 2024 13:20
@vinc vinc merged commit 4d7e2b0 into trunk Oct 21, 2024
1 check passed
@vinc vinc deleted the feature/clock branch October 21, 2024 14:20
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.

1 participant