Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
b0ec3456
Commit
b0ec3456
authored
Dec 31, 2014
by
funshine
Browse files
align flash read/write addr
parent
35e89a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/platform/flash_api.c
View file @
b0ec3456
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
SPIFlashInfo
*
ICACHE_FLASH_ATTR
SPIFlashInfo
*
ICACHE_FLASH_ATTR
flash_get_info
(
void
)
flash_get_info
(
void
)
{
{
static
SPIFlashInfo
spi_flash_info
;
static
SPIFlashInfo
spi_flash_info
__attribute__
((
aligned
(
4
)))
;
static
bool
is_spi_flash_info_initialized
=
false
;
static
bool
is_spi_flash_info_initialized
=
false
;
// Make the code more fast
// Make the code more fast
if
(
!
is_spi_flash_info_initialized
)
if
(
!
is_spi_flash_info_initialized
)
...
@@ -76,7 +76,7 @@ flash_set_size(uint8_t size)
...
@@ -76,7 +76,7 @@ flash_set_size(uint8_t size)
// Reboot required!!!
// Reboot required!!!
// If you don't know what you're doing, your nodemcu may turn into stone ...
// If you don't know what you're doing, your nodemcu may turn into stone ...
c_printf
(
"
\n
Set size!!! %d
\n
"
,
size
);
c_printf
(
"
\n
Set size!!! %d
\n
"
,
size
);
uint8_t
data
[
SPI_FLASH_SEC_SIZE
];
uint8_t
data
[
SPI_FLASH_SEC_SIZE
]
__attribute__
((
aligned
(
4
)))
;
SPIRead
(
0
,
data
,
sizeof
(
data
));
SPIRead
(
0
,
data
,
sizeof
(
data
));
SPIFlashInfo
*
p_spi_flash_info
=
(
SPIFlashInfo
*
)(
data
);
SPIFlashInfo
*
p_spi_flash_info
=
(
SPIFlashInfo
*
)(
data
);
p_spi_flash_info
->
size
=
size
;
p_spi_flash_info
->
size
=
size
;
...
@@ -195,7 +195,7 @@ flash_init_data_default(void)
...
@@ -195,7 +195,7 @@ flash_init_data_default(void)
// Dangerous, here are dinosaur infested!!!!!
// Dangerous, here are dinosaur infested!!!!!
// Reboot required!!!
// Reboot required!!!
// It will init system data to default!
// It will init system data to default!
uint8_t
flash_init_data
[
128
]
=
uint8_t
flash_init_data
[
128
]
__attribute__
((
aligned
(
4
)))
=
{
{
0x05
,
0x00
,
0x04
,
0x02
,
0x05
,
0x05
,
0x05
,
0x02
,
0x05
,
0x00
,
0x04
,
0x05
,
0x05
,
0x04
,
0x05
,
0x05
,
0x05
,
0x00
,
0x04
,
0x02
,
0x05
,
0x05
,
0x05
,
0x02
,
0x05
,
0x00
,
0x04
,
0x05
,
0x05
,
0x04
,
0x05
,
0x05
,
0x04
,
0xFE
,
0xFD
,
0xFF
,
0xF0
,
0xF0
,
0xF0
,
0xE0
,
0xE0
,
0xE0
,
0xE1
,
0x0A
,
0xFF
,
0xFF
,
0xF8
,
0x00
,
0x04
,
0xFE
,
0xFD
,
0xFF
,
0xF0
,
0xF0
,
0xF0
,
0xE0
,
0xE0
,
0xE0
,
0xE1
,
0x0A
,
0xFF
,
0xFF
,
0xF8
,
0x00
,
...
...
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