Skip to content

Commit

Permalink
Merge pull request #1168 from bitcraze/tobba/uSD_startup_bug
Browse files Browse the repository at this point in the history
Added function to start battery autoupdate to avoid syslink queue overflow.
  • Loading branch information
victorhook authored Dec 8, 2022
2 parents 4f481ab + 52ebb41 commit 2b70b99
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/hal/src/pm_stm32f4.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ static void pmGracefulShutdown()
syslinkSendPacket(&slp);
}

static void pmEnableBatteryStatusAutoupdate()
{
SyslinkPacket slp = {
.type = SYSLINK_PM_BATTERY_AUTOUPDATE,
};

syslinkSendPacket(&slp);
}

void pmSyslinkUpdate(SyslinkPacket *slp)
{
if (slp->type == SYSLINK_PM_BATTERY_STATE) {
Expand Down Expand Up @@ -399,6 +408,10 @@ void pmTask(void *param)
pmSetChargeState(charge500mA);
systemWaitStart();

// Continuous battery voltage and status messages must be enabled
// after system startup to avoid syslink queue overflow.
pmEnableBatteryStatusAutoupdate();

while(1)
{
vTaskDelay(100);
Expand Down

0 comments on commit 2b70b99

Please sign in to comment.