Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
cf1509c9
Commit
cf1509c9
authored
6 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
esp32/fatfs_port: Implement get_fattime so FAT files have a timestamp.
Fixes issue #3859.
parent
d11fb093
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ports/esp32/fatfs_port.c
+4
-9
4 additions, 9 deletions
ports/esp32/fatfs_port.c
with
4 additions
and
9 deletions
ports/esp32/fatfs_port.c
+
4
−
9
View file @
cf1509c9
...
...
@@ -26,20 +26,15 @@
* THE SOFTWARE.
*/
#include
"py/obj
.h
"
#include
<sys/time
.h
>
#include
"lib/oofatfs/ff.h"
#include
"timeutils.h"
//#include "modmachine.h"
DWORD
get_fattime
(
void
)
{
// TODO: Optimize division (there's no HW division support on ESP8266,
// so it's expensive).
//uint32_t secs = (uint32_t)(pyb_rtc_get_us_since_2000() / 1000000);
uint32_t
secs
=
0
;
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
timeutils_struct_time_t
tm
;
timeutils_seconds_since_2000_to_struct_time
(
sec
s
,
&
tm
);
timeutils_seconds_since_2000_to_struct_time
(
tv
.
tv_
sec
,
&
tm
);
return
(((
DWORD
)(
tm
.
tm_year
-
1980
)
<<
25
)
|
((
DWORD
)
tm
.
tm_mon
<<
21
)
|
((
DWORD
)
tm
.
tm_mday
<<
16
)
|
((
DWORD
)
tm
.
tm_hour
<<
11
)
|
((
DWORD
)
tm
.
tm_min
<<
5
)
|
((
DWORD
)
tm
.
tm_sec
>>
1
));
...
...
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