forked from platformio/platformio-core
Fix bug with custom BOARD_F_CPU for Espressif platform
This commit is contained in:
@ -42,10 +42,17 @@ def _get_flash_size(env):
|
|||||||
else "%dM" % (board_max_size / 1048576))
|
else "%dM" % (board_max_size / 1048576))
|
||||||
|
|
||||||
|
|
||||||
|
def _get_board_f_cpu(env):
|
||||||
|
f_cpu = env.subst("$BOARD_F_CPU")
|
||||||
|
f_cpu = str(f_cpu).replace("L", "")
|
||||||
|
return int(int(f_cpu) / 1000000)
|
||||||
|
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
env = DefaultEnvironment()
|
||||||
|
|
||||||
env.Replace(
|
env.Replace(
|
||||||
__get_flash_size=_get_flash_size,
|
__get_flash_size=_get_flash_size,
|
||||||
|
__get_board_f_cpu=_get_board_f_cpu,
|
||||||
|
|
||||||
AR="xtensa-lx106-elf-ar",
|
AR="xtensa-lx106-elf-ar",
|
||||||
AS="xtensa-lx106-elf-as",
|
AS="xtensa-lx106-elf-as",
|
||||||
@ -143,7 +150,7 @@ env.Append(
|
|||||||
"eboot", "eboot.elf"),
|
"eboot", "eboot.elf"),
|
||||||
"-bo", "$TARGET",
|
"-bo", "$TARGET",
|
||||||
"-bm", "dio",
|
"-bm", "dio",
|
||||||
"-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}",
|
"-bf", "${__get_board_f_cpu(__env__)}",
|
||||||
"-bz", "${__get_flash_size(__env__)}",
|
"-bz", "${__get_flash_size(__env__)}",
|
||||||
"-bs", ".text",
|
"-bs", ".text",
|
||||||
"-bp", "4096",
|
"-bp", "4096",
|
||||||
|
Reference in New Issue
Block a user