Skip to content

Commit

Permalink
hwtest/main: Fix Power disable not working
Browse files Browse the repository at this point in the history
This commit fixes the issue where Power disable not working
because the KEY code was not written to the register.

Signed-off-by: Takuya Sasaki <takuya.sasaki@spacecubics.com>
  • Loading branch information
sasataku committed Feb 29, 2024
1 parent 4cc9ea2 commit f97719a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/hwtest/main/src/pwrctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ void sc_main_power_enable(uint8_t target_bit)

void sc_main_power_disable(uint8_t target_bit)
{
sys_clear_bits(SCMAIN_SYSREG_BASE_ADDR + SCMAIN_PCR_OFFSET,
SCMAIN_PCR_KEYCODE | target_bit);
uint32_t val = sys_read32(SCMAIN_SYSREG_BASE_ADDR + SCMAIN_PCR_OFFSET);

val = SCMAIN_PCR_KEYCODE | (val & ~target_bit);
sys_write32(val, SCMAIN_SYSREG_BASE_ADDR + SCMAIN_PCR_OFFSET);
}

0 comments on commit f97719a

Please sign in to comment.