Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 12, 2019
1 parent 29a269b commit 0ce9de5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/eez/apps/psu/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ static bool g_saveProfile = false;

////////////////////////////////////////////////////////////////////////////////

bool isAutoSaveAllowed() {
return persist_conf::devConf.flags.profileAutoRecallEnabled && persist_conf::devConf.profile_auto_recall_location == 0;
}

void tick(uint32_t tickCount) {
if (persist_conf::devConf.flags.profileAutoRecallEnabled && persist_conf::devConf.profile_auto_recall_location == 0) {
if (isAutoSaveAllowed()) {
if (g_saveProfile && !list::isActive() && !calibration::isEnabled() && idle::isIdle()) {
DebugTrace("Profile 0 saved!");
saveAtLocation(0);
Expand Down Expand Up @@ -289,7 +293,7 @@ void save() {
}

void saveImmediately() {
if (persist_conf::devConf.flags.profileAutoRecallEnabled) {
if (isAutoSaveAllowed()) {
DebugTrace("Profile 0 saved!");
saveAtLocation(0);
g_saveProfile = false;
Expand Down

0 comments on commit 0ce9de5

Please sign in to comment.