Skip to content

Commit

Permalink
refactor frequency conv. and add img_freq
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Feb 14, 2024
1 parent 4b8be23 commit 991c5f7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,22 @@ def _get_board_memory_type(env):
)


def _get_board_f_flash(env):
frequency = env.subst("$BOARD_F_FLASH")
def _normalize_frequency(frequency):
frequency = str(frequency).replace("L", "")
return str(int(int(frequency) / 1000000)) + "m"


def _get_board_f_flash(env):
frequency = env.subst("$BOARD_F_FLASH")
return _normalize_frequency(frequency)


def _get_board_img_freq(env):
return env.BoardConfig().get("build.img_freq", _get_board_f_flash(env))
board_config = env.BoardConfig()
if "build.img_freq" in board_config:
return _normalize_frequency(board_config.get("build.img_freq"))

return _get_board_f_flash(env)


def _get_board_flash_mode(env):
Expand Down

0 comments on commit 991c5f7

Please sign in to comment.