Skip to content

Commit

Permalink
Fix ICC build errors and update tool
Browse files Browse the repository at this point in the history
  • Loading branch information
sihyung-maxim committed May 28, 2024
1 parent c1aa8c5 commit 9ceb343
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Libraries/PeriphDrivers/Include/MAX32657/icc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ typedef enum {
* @param cid Enumeration type for Cache Id Register.
* @retval Returns the contents of Cache Id Register.
*/
int MXC_ICC_ID(mxc_icc_regs_t *icc, mxc_icc_info_t cid);
int MXC_ICC_ID(mxc_icc_info_t cid);

/**
* @brief Enable the instruction cache controller.
*/
void MXC_ICC_Enable(mxc_icc_regs_t *icc);
void MXC_ICC_Enable(void);

/**
* @brief Disable the instruction cache controller.
*/
void MXC_ICC_Disable(mxc_icc_regs_t *icc);
void MXC_ICC_Disable(void);

/**
* @brief Flush the instruction cache controller.
*/
void MXC_ICC_Flush(mxc_icc_regs_t *icc);
void MXC_ICC_Flush(void);

/**@} end of group icc */

Expand Down
17 changes: 8 additions & 9 deletions Libraries/PeriphDrivers/Source/ICC/icc_me30.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,22 @@
Maxim Internal Use
* ****************************************************************************** */

int MXC_ICC_ID(mxc_icc_regs_t *icc, mxc_icc_info_t cid)
int MXC_ICC_ID(mxc_icc_info_t cid)
{
return MXC_ICC_RevA_ID((mxc_icc_reva_regs_t *)icc, cid);
return MXC_ICC_RevA_ID((mxc_icc_reva_regs_t *)MXC_ICC, cid);
}

void MXC_ICC_Enable(mxc_icc_regs_t *icc)
void MXC_ICC_Enable(void)
{
MXC_ICC_RevA_Enable((mxc_icc_reva_regs_t *)icc);
MXC_ICC_RevA_Enable((mxc_icc_reva_regs_t *)MXC_ICC);
}

void MXC_ICC_Disable(mxc_icc_regs_t *icc)
void MXC_ICC_Disable(void)
{
MXC_ICC_RevA_Disable((mxc_icc_reva_regs_t *)icc);
MXC_ICC_RevA_Disable((mxc_icc_reva_regs_t *)MXC_ICC);
}

void MXC_ICC_Flush(mxc_icc_regs_t *icc)
void MXC_ICC_Flush(void)
{
MXC_ICC_Disable(icc);
MXC_ICC_Enable(icc);
MXC_ICC_Com_Flush();
}
1 change: 1 addition & 0 deletions Libraries/PeriphDrivers/max32657_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/GPIO/gpio_me30.c
PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/GPIO/gpio_reva.c

PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ICC
PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ICC/icc_common.c
PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ICC/icc_me30.c
PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ICC/icc_reva.c

Expand Down
18 changes: 13 additions & 5 deletions Tools/Scripts/fetch_specific_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,21 @@ def delete_lines(filename, start_line, end_line):
# Isolate revision version.
revision = src_file.split("_rev")[-1]
index_to_first_underscore = revision.find("_")
revision_id = "_rev" + revision[:index_to_first_underscore]
revision_id = "_rev" + revision[:index_to_first_underscore-1]

rev_files = [file for file in os.listdir(periphdrivers_source_src + "/" + parent_periph_dir) if revision_id in file and ".svd" not in file]

# Account fo rev revisions (_reva1 and _reva2 files share the same _reva register file)
# _revX is 5 characters long
if len(revision_id) > 5:
# Grab register file
rev_files.append(parent_periph_dir.lower() + revision_id[:-1] + "_regs.h")

rev_files = [f for f in os.listdir(periphdrivers_source_src + "/" + parent_periph_dir) if os.path.isfile(f) and (revision_id in f)]
for file in rev_files:
src_file = os.path.join(periphdrivers_source_src, "/" + parent_periph_dir + "/" + file)
dst_file = os.path.join(periphdrivers_source_dst, "/" + parent_periph_dir + "/" + file)
shutil.copy(src_file, dst_file)
src_file = periphdrivers_source_src + "/" + parent_periph_dir + "/" + file
dst_file = periphdrivers_source_dst + "/" + parent_periph_dir + "/" + file
if os.path.isfile(src_file):
shutil.copy(src_file, dst_file)


if "_common" in src_file:
Expand Down

0 comments on commit 9ceb343

Please sign in to comment.