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
2d82e622
Commit
2d82e622
authored
Jan 14, 2016
by
Johny Mattsson
Browse files
Merge pull request #890 from vowstar/dev-fix-flash-api
Update flash_api due to flash size map is redefined by espressif.
parents
9772e7cd
f2e6c936
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/platform/flash_api.c
View file @
2d82e622
...
@@ -132,13 +132,13 @@ uint32_t flash_rom_get_size_byte(void)
...
@@ -132,13 +132,13 @@ uint32_t flash_rom_get_size_byte(void)
// 32Mbit, 4MByte
// 32Mbit, 4MByte
flash_size
=
4
*
1024
*
1024
;
flash_size
=
4
*
1024
*
1024
;
break
;
break
;
case
SIZE_6
4
MBIT
:
case
SIZE_
1
6MBIT
_8M_8M
:
// 6
4
Mbit,
8
MByte
//
1
6Mbit,
2
MByte
flash_size
=
8
*
1024
*
1024
;
flash_size
=
2
*
1024
*
1024
;
break
;
break
;
case
SIZE_
128
MBIT
:
case
SIZE_
32
MBIT
_8M_8M
:
//
128
Mbit,
16
MByte
//
32
Mbit,
4
MByte
flash_size
=
16
*
1024
*
1024
;
flash_size
=
4
*
1024
*
1024
;
break
;
break
;
default:
default:
// Unknown flash size, fall back mode.
// Unknown flash size, fall back mode.
...
@@ -206,16 +206,18 @@ bool flash_rom_set_size_byte(uint32_t size)
...
@@ -206,16 +206,18 @@ bool flash_rom_set_size_byte(uint32_t size)
flash_size
=
SIZE_32MBIT
;
flash_size
=
SIZE_32MBIT
;
flash_rom_set_size_type
(
flash_size
);
flash_rom_set_size_type
(
flash_size
);
break
;
break
;
/*
case 8 * 1024 * 1024:
case 8 * 1024 * 1024:
// 64Mbit, 8MByte
// 64Mbit, 8MByte
flash_size
=
SIZE_6
4
MBIT
;
flash_size = SIZE_
1
6MBIT
_8M_8M
;
flash_rom_set_size_type(flash_size);
flash_rom_set_size_type(flash_size);
break;
break;
case 16 * 1024 * 1024:
case 16 * 1024 * 1024:
// 128Mbit, 16MByte
// 128Mbit, 16MByte
flash_size
=
SIZE_
128
MBIT
;
flash_size = SIZE_
32
MBIT
_8M_8M
;
flash_rom_set_size_type(flash_size);
flash_rom_set_size_type(flash_size);
break;
break;
*/
default:
default:
// Unknown flash size.
// Unknown flash size.
result
=
false
;
result
=
false
;
...
...
app/platform/flash_api.h
View file @
2d82e622
...
@@ -78,12 +78,12 @@ typedef struct
...
@@ -78,12 +78,12 @@ typedef struct
SIZE_8MBIT
=
2
,
SIZE_8MBIT
=
2
,
SIZE_16MBIT
=
3
,
SIZE_16MBIT
=
3
,
SIZE_32MBIT
=
4
,
SIZE_32MBIT
=
4
,
SIZE_6
4
MBIT
=
5
,
SIZE_
1
6MBIT
_8M_8M
=
5
,
SIZE_
128
MBIT
=
6
,
SIZE_
32
MBIT
_8M_8M
=
6
,
}
size
:
4
;
}
size
:
4
;
uint32_t
entry_point
;
uint32_t
entry_point
;
uint32_t
memory_offset
;
uint32_t
memory_offset
;
uint32_t
segment_size
;
uint32_t
segment_size
;
}
ICACHE_STORE_TYPEDEF_ATTR
SPIFlashInfo
;
}
ICACHE_STORE_TYPEDEF_ATTR
SPIFlashInfo
;
uint32_t
flash_detect_size_byte
(
void
);
uint32_t
flash_detect_size_byte
(
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