Skip to content

Commit

Permalink
Changing version to 1.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vysocan committed Dec 6, 2024
1 parent 2fde76d commit 2259898
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 2 additions & 22 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,10 @@ int main(void) {
readFromBkpSRAM((uint8_t*)&conf, sizeof(config_t), 0);
chprintf(console, "Size of conf: %u, group: %u\r\n", sizeof(conf), sizeof(group));

// Check if we have 1.4 -> 1.5 version update
if ((conf.versionMajor == 1) && (conf.versionMinor == 4) && (OHS_MINOR == 5)) {
// Check if we have 1.5.0 -> 1.5.x version update
if ((conf.versionMajor == 1) && (conf.versionMinor == 5)) {
// Set new version conf struct changes

// Copy alerts to new location
conf.alert[0] = conf.dummy[0];
conf.alert[1] = conf.dummy[1];
conf.alert[2] = conf.dummy[2];
conf.alert[3] = 0;
// Save the changes
conf.versionMajor = OHS_MAJOR;
conf.versionMinor = OHS_MINOR;
writeToBkpSRAM((uint8_t*)&conf, sizeof(config_t), 0);
} else if ((conf.versionMajor == 1) && (conf.versionMinor == 5) && (OHS_MOD == 0)) {
// Copy alerts to new location
conf.alert[0] = conf.dummy[0];
conf.alert[1] = conf.dummy[1];
conf.alert[2] = conf.dummy[2];
conf.alert[3] = 0;

// Save the changes
conf.versionMajor = OHS_MAJOR;
conf.versionMinor = OHS_MINOR;
writeToBkpSRAM((uint8_t*)&conf, sizeof(config_t), 0);
} else if (OHS_MINOR != conf.versionMinor) {
// Unknown version change, clear all
setConfDefault();
Expand Down
2 changes: 1 addition & 1 deletion ohs_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define OHS_NAME "OHS"
#define OHS_MAJOR 1
#define OHS_MINOR 5
#define OHS_MOD 3
#define OHS_MOD 4

#define BACKUP_SRAM_SIZE 0x1000 // 4kB SRAM size

Expand Down

0 comments on commit 2259898

Please sign in to comment.