Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
f6b1d3a3
Commit
f6b1d3a3
authored
Feb 15, 2015
by
HuangRui
Browse files
Test what caused flash AUTO_SIZE bug.
parent
7e524f7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/platform/flash_api.c
View file @
f6b1d3a3
...
@@ -24,6 +24,7 @@ SPIFlashInfo flash_get_info(void)
...
@@ -24,6 +24,7 @@ SPIFlashInfo flash_get_info(void)
{
{
volatile
SPIFlashInfo
spi_flash_info
ICACHE_STORE_ATTR
;
volatile
SPIFlashInfo
spi_flash_info
ICACHE_STORE_ATTR
;
spi_flash_info
=
*
((
SPIFlashInfo
*
)(
FLASH_MAP_START_ADDRESS
));
spi_flash_info
=
*
((
SPIFlashInfo
*
)(
FLASH_MAP_START_ADDRESS
));
// spi_flash_read(0, (uint32 *)(& spi_flash_info), sizeof(spi_flash_info));
return
spi_flash_info
;
return
spi_flash_info
;
}
}
...
@@ -232,13 +233,14 @@ bool flash_self_destruct(void)
...
@@ -232,13 +233,14 @@ bool flash_self_destruct(void)
return
true
;
return
true
;
}
}
uint8_t
byte_of_aligned_array
(
const
uint8_t
*
aligned_array
,
uint32_t
index
)
uint8_t
byte_of_aligned_array
(
const
uint8_t
*
aligned_array
,
uint32_t
index
)
{
{
if
(
(((
uint32_t
)
aligned_array
)
%
4
)
!=
0
){
if
(
(((
uint32_t
)
aligned_array
)
%
4
)
!=
0
)
{
NODE_DBG
(
"aligned_array is not 4-byte aligned.
\n
"
);
NODE_DBG
(
"aligned_array is not 4-byte aligned.
\n
"
);
return
0
;
return
0
;
}
}
uint32_t
v
=
((
uint32_t
*
)
aligned_array
)[
index
/
4
];
uint32_t
v
=
((
uint32_t
*
)
aligned_array
)[
index
/
4
];
uint8_t
*
p
=
(
uint8_t
*
)
(
&
v
);
uint8_t
*
p
=
(
uint8_t
*
)
(
&
v
);
return
p
[
(
index
%
4
)
];
return
p
[
(
index
%
4
)
];
}
}
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