Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
892ba4f2
Commit
892ba4f2
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
DS1307: Change year bias to 1968 which is a leap year juse like 2000
parent
c34b5108
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/timers/ds3231.c
+6
-4
6 additions, 4 deletions
drivers/timers/ds3231.c
sched/clock/clock_initialize.c
+1
-1
1 addition, 1 deletion
sched/clock/clock_initialize.c
with
7 additions
and
5 deletions
drivers/timers/ds3231.c
+
6
−
4
View file @
892ba4f2
...
...
@@ -392,9 +392,11 @@ int up_rtc_getdatetime(FAR struct tm *tp)
tp
->
tm_year
=
tmp
+
100
;
}
#else
/* No century indicator. The RTC will hold years since 1970 */
/* No century indicator. The RTC will hold years since 1968 (a leap year like
* 2000)
*/
tp
->
tm_year
=
tmp
+
70
;
tp
->
tm_year
=
tmp
+
68
;
#endif
rtc_dumptime
(
tp
,
"Returning"
);
...
...
@@ -512,10 +514,10 @@ int up_rtc_settime(FAR const struct timespec *tp)
}
#else
/* Use years since 19
70
*/
/* Use years since 19
68 (a leap year like 2000)
*/
century
=
0
;
year
=
newtm
.
tm_year
-
70
;
year
=
newtm
.
tm_year
-
68
;
#endif
/* Save the month (1-12) with century */
...
...
This diff is collapsed.
Click to expand it.
sched/clock/clock_initialize.c
+
1
−
1
View file @
892ba4f2
...
...
@@ -201,11 +201,11 @@ static void clock_inittime(void)
void
clock_initialize
(
void
)
{
#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_EXTERNAL)
/* Initialize the internal RTC hardware. Initialization of external RTC
* must be deferred until the system has booted.
*/
#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_EXTERNAL)
up_rtcinitialize
();
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment