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
GitLab 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
48ef64a7
Commit
48ef64a7
authored
Mar 4, 2015
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stmhal: Make os.sync use disk_ioctl exclusively; reuse os.sync in pyb.
parent
4f94d90d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
stmhal/modpyb.c
+1
-10
1 addition, 10 deletions
stmhal/modpyb.c
stmhal/moduos.c
+4
-4
4 additions, 4 deletions
stmhal/moduos.c
stmhal/portmodules.h
+2
-0
2 additions, 0 deletions
stmhal/portmodules.h
with
7 additions
and
14 deletions
stmhal/modpyb.c
+
1
−
10
View file @
48ef64a7
...
@@ -339,15 +339,6 @@ STATIC mp_obj_t pyb_freq(mp_uint_t n_args, const mp_obj_t *args) {
...
@@ -339,15 +339,6 @@ STATIC mp_obj_t pyb_freq(mp_uint_t n_args, const mp_obj_t *args) {
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
pyb_freq_obj
,
0
,
4
,
pyb_freq
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
pyb_freq_obj
,
0
,
4
,
pyb_freq
);
/// \function sync()
/// Sync all file systems.
STATIC
mp_obj_t
pyb_sync
(
void
)
{
storage_flush
();
disk_ioctl
(
2
,
CTRL_SYNC
,
NULL
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
pyb_sync_obj
,
pyb_sync
);
/// \function millis()
/// \function millis()
/// Returns the number of milliseconds since the board was last reset.
/// Returns the number of milliseconds since the board was last reset.
///
///
...
@@ -522,7 +513,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
...
@@ -522,7 +513,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_elapsed_micros
),
(
mp_obj_t
)
&
pyb_elapsed_micros_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_elapsed_micros
),
(
mp_obj_t
)
&
pyb_elapsed_micros_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_delay
),
(
mp_obj_t
)
&
pyb_delay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_delay
),
(
mp_obj_t
)
&
pyb_delay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_udelay
),
(
mp_obj_t
)
&
pyb_udelay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_udelay
),
(
mp_obj_t
)
&
pyb_udelay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sync
),
(
mp_obj_t
)
&
pyb
_sync_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sync
),
(
mp_obj_t
)
&
mod_os
_sync_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_mount
),
(
mp_obj_t
)
&
pyb_mount_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_mount
),
(
mp_obj_t
)
&
pyb_mount_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Timer
),
(
mp_obj_t
)
&
pyb_timer_type
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_Timer
),
(
mp_obj_t
)
&
pyb_timer_type
},
...
...
This diff is collapsed.
Click to expand it.
stmhal/moduos.c
+
4
−
4
View file @
48ef64a7
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
#include
"lib/fatfs/ff.h"
#include
"lib/fatfs/ff.h"
#include
"lib/fatfs/diskio.h"
#include
"lib/fatfs/diskio.h"
#include
"rng.h"
#include
"rng.h"
#include
"storage.h"
#include
"file.h"
#include
"file.h"
#include
"sdcard.h"
#include
"sdcard.h"
#include
"fsusermount.h"
#include
"fsusermount.h"
...
@@ -309,11 +308,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat);
...
@@ -309,11 +308,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat);
/// \function sync()
/// \function sync()
/// Sync all filesystems.
/// Sync all filesystems.
STATIC
mp_obj_t
os_sync
(
void
)
{
STATIC
mp_obj_t
os_sync
(
void
)
{
storage_flush
();
disk_ioctl
(
0
,
CTRL_SYNC
,
NULL
);
disk_ioctl
(
1
,
CTRL_SYNC
,
NULL
);
disk_ioctl
(
2
,
CTRL_SYNC
,
NULL
);
disk_ioctl
(
2
,
CTRL_SYNC
,
NULL
);
return
mp_const_none
;
return
mp_const_none
;
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
os_sync_obj
,
os_sync
);
MP_DEFINE_CONST_FUN_OBJ_0
(
mod_
os_sync_obj
,
os_sync
);
#if MICROPY_HW_ENABLE_RNG
#if MICROPY_HW_ENABLE_RNG
/// \function urandom(n)
/// \function urandom(n)
...
@@ -343,7 +343,7 @@ STATIC const mp_map_elem_t os_module_globals_table[] = {
...
@@ -343,7 +343,7 @@ STATIC const mp_map_elem_t os_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_stat
),
(
mp_obj_t
)
&
os_stat_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_stat
),
(
mp_obj_t
)
&
os_stat_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_unlink
),
(
mp_obj_t
)
&
os_remove_obj
},
// unlink aliases to remove
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_unlink
),
(
mp_obj_t
)
&
os_remove_obj
},
// unlink aliases to remove
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sync
),
(
mp_obj_t
)
&
os_sync_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sync
),
(
mp_obj_t
)
&
mod_
os_sync_obj
},
/// \constant sep - separation character used in paths
/// \constant sep - separation character used in paths
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sep
),
MP_OBJ_NEW_QSTR
(
MP_QSTR__slash_
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sep
),
MP_OBJ_NEW_QSTR
(
MP_QSTR__slash_
)
},
...
...
This diff is collapsed.
Click to expand it.
stmhal/portmodules.h
+
2
−
0
View file @
48ef64a7
...
@@ -33,4 +33,6 @@ extern const mp_obj_module_t mp_module_usocket;
...
@@ -33,4 +33,6 @@ extern const mp_obj_module_t mp_module_usocket;
// additional helper functions exported by the modules
// additional helper functions exported by the modules
MP_DECLARE_CONST_FUN_OBJ
(
mod_os_sync_obj
);
mp_uint_t
mod_time_seconds_since_2000
(
mp_uint_t
year
,
mp_uint_t
month
,
mp_uint_t
date
,
mp_uint_t
hour
,
mp_uint_t
minute
,
mp_uint_t
second
);
mp_uint_t
mod_time_seconds_since_2000
(
mp_uint_t
year
,
mp_uint_t
month
,
mp_uint_t
date
,
mp_uint_t
hour
,
mp_uint_t
minute
,
mp_uint_t
second
);
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