Skip to content

Commit

Permalink
profile recall fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jan 28, 2020
1 parent c95e696 commit 9f66a16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/eez/modules/psu/persist_conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ profile::Parameters *loadProfile(int location) {
if (location != NUM_PROFILE_LOCATIONS - 1) { // last location is not stored in EEPROM
profile::Parameters profile;
if (confRead((uint8_t *)&profile, sizeof(profile::Parameters), getProfileAddress(location), profile::PROFILE_VERSION)) {
memcpy(&g_profilesCache[location].profile, &profile, sizeof(profile::Parameters));
memcpy(&g_profilesCache[location].profile, &profile, sizeof(profile::Parameters));
}
}
g_profilesCache[location].loaded = true;
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void recallChannelsFromProfile(Parameters &profile, int location) {

int j = channelsMap[i];

if (j != -1) {
if (profile.channels[j].flags.parameters_are_valid) {
channel.u.set = MIN(profile.channels[j].u_set, channel.u.max);
channel.u.step = profile.channels[j].u_step;
channel.u.limit = MIN(profile.channels[j].u_limit, channel.u.max);
Expand Down

0 comments on commit 9f66a16

Please sign in to comment.