Skip to content

Commit

Permalink
Changing startup code for nRF9151
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwolff committed Feb 5, 2025
1 parent 06491b3 commit 2ba4aa5
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions boards/circuitdojo/feather_nrf9151/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,8 @@ static int sysreg_setup(void)
return -ENODEV;
}

uint8_t data = 0;
int ret = mfd_npm1300_reg_read_burst(pmic, SYSREG_VBUSIN_BASE, SYSREG_VBUSINILIM0, &data, 1);
if (ret < 0)
{
printk("Failed to read VBUSINLIM. Err: %d", ret);
return ret;
}
else
{
if (data == 0)
{
data = 5;

printk("*** Vsys Current Limit: %d mA ***\n", data * 100);

return 0;
}
}

/* Write to MFD to set SYSREG current to 500mA */
ret = mfd_npm1300_reg_write(pmic, SYSREG_VBUSIN_BASE, SYSREG_VBUSINILIM0, 0);
/* Write to MFD to set SYSREG current to 1000mA */
int ret = mfd_npm1300_reg_write(pmic, SYSREG_VBUSIN_BASE, SYSREG_VBUSINILIM0, SYSREG_VBUSINILIM_1000MA);
if (ret < 0)
{
printk("Failed to set VBUSINLIM. Err: %d\n", ret);
Expand All @@ -56,6 +37,8 @@ static int sysreg_setup(void)
return ret;
}

printk("*** Vsys Current Limit: %d mA ***\n", SYSREG_VBUSINILIM_1000MA * 100);

/* Delay boot for programmer */
k_sleep(K_SECONDS(2));

Expand Down

0 comments on commit 2ba4aa5

Please sign in to comment.