Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython-simulator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython-simulator
Commits
f08164aa
Commit
f08164aa
authored
Aug 21, 2019
by
George Wort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set file system size.
parent
faf2f098
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
inc/microbit/memory.h
inc/microbit/memory.h
+14
-5
No files found.
inc/microbit/memory.h
View file @
f08164aa
...
...
@@ -28,7 +28,7 @@
#define __MICROPY_INCLUDED_MEMORY_H__
#include "microbit/filesystem.h"
#include "emscripten.h"
static
inline
char
*
rounddown
(
char
*
addr
,
uint32_t
align
)
{
return
(
char
*
)(((
uint32_t
)
addr
)
&
(
-
align
));
...
...
@@ -38,19 +38,28 @@ static inline char *roundup(char *addr, uint32_t align) {
return
(
char
*
)((((
uint32_t
)
addr
)
+
align
-
1
)
&
(
-
align
));
}
char
rom
[
0x6400
]
__attribute__
((
aligned
(
MBED_CONF_APP_MICROBIT_PAGE_SIZE
)));
static
uint32_t
end_of_code
=
0
;
#define ROM_SIZE ((CHUNK_SIZE * MAX_CHUNKS_IN_FILE_SYSTEM) + (2 * MBED_CONF_APP_MICROBIT_PAGE_SIZE))
static
char
rom
[
ROM_SIZE
]
__attribute__
((
aligned
(
MBED_CONF_APP_MICROBIT_PAGE_SIZE
)));
EMSCRIPTEN_KEEPALIVE
void
set_filesystem_size
(
uint32_t
size
)
{
int32_t
temp
=
ROM_SIZE
-
size
;
end_of_code
=
temp
<
0
?
0
:
temp
;
}
/** The end of the code area in flash ROM (text plus read-only copy of data area) */
static
inline
char
*
microbit_end_of_code
()
{
return
&
rom
[
0x0
];
// 0x39C00 - 0x39C00
return
&
rom
[
end_of_code
];
}
static
inline
char
*
microbit_end_of_rom
()
{
return
&
rom
[
0x6400
];
// 0x40000 - 0x39C00
return
&
rom
[
ROM_SIZE
];
}
static
inline
char
*
microbit_mp_appended_script
()
{
return
&
rom
[
0x4400
];
// 0x3e000 - 0x39C00
return
&
rom
[
ROM_SIZE
-
(
8
*
MBED_CONF_APP_MICROBIT_PAGE_SIZE
)];
}
static
inline
void
*
microbit_compass_calibration_page
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment