Skip to content

Commit

Permalink
Replaced HARP_VERSION by CORE_VERSION.
Browse files Browse the repository at this point in the history
  • Loading branch information
filcarv committed Mar 14, 2023
1 parent bb6e6a4 commit 1a1faef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions Firmware/Library/hwbp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ static struct CommonBank
uint8_t R_HW_VERSION_H;
uint8_t R_HW_VERSION_L;
uint8_t R_ASSEMBLY_VERSION;
uint8_t R_HARP_VERSION_H;
uint8_t R_HARP_VERSION_L;
uint8_t R_CORE_VERSION_H;
uint8_t R_CORE_VERSION_L;
uint8_t R_FW_VERSION_H;
uint8_t R_FW_VERSION_L;
uint32_t R_TIMESTAMP_SECOND;
Expand Down Expand Up @@ -150,8 +150,8 @@ static uint8_t *regs_pointer[] = {
(uint8_t*)(&commonbank.R_HW_VERSION_H),
(uint8_t*)(&commonbank.R_HW_VERSION_L),
(uint8_t*)(&commonbank.R_ASSEMBLY_VERSION),
(uint8_t*)(&commonbank.R_HARP_VERSION_H),
(uint8_t*)(&commonbank.R_HARP_VERSION_L),
(uint8_t*)(&commonbank.R_CORE_VERSION_H),
(uint8_t*)(&commonbank.R_CORE_VERSION_L),
(uint8_t*)(&commonbank.R_FW_VERSION_H),
(uint8_t*)(&commonbank.R_FW_VERSION_L),
(uint8_t*)(&commonbank.R_TIMESTAMP_SECOND),
Expand Down Expand Up @@ -214,7 +214,7 @@ static uint8_t _500us_cca_index = 0;
#define EEPROM_ADD_MEM_IN_USE 0
#define EEPROM_ADD_R_OPERATION_CTRL 1
#define EEPROM_ADD_R_FW_VERSION_H 2
#define EEPROM_ADD_R_HARP_VERSION_H 3
#define EEPROM_ADD_R_CORE_VERSION_H 3
#define EEPROM_ADD_SN_HIGH 4
#define EEPROM_ADD_SN_LOW 5
#define EEPROM_ADD_CLOCK_CONFIG 6
Expand Down Expand Up @@ -287,8 +287,8 @@ void core_func_start_core (
commonbank.R_HW_VERSION_H = hwH;
commonbank.R_HW_VERSION_L = hwL;
commonbank.R_ASSEMBLY_VERSION = assembly;
commonbank.R_HARP_VERSION_H = VH;
commonbank.R_HARP_VERSION_L = VL;
commonbank.R_CORE_VERSION_H = VH;
commonbank.R_CORE_VERSION_L = VL;
commonbank.R_FW_VERSION_H = fwH;
commonbank.R_FW_VERSION_L = fwL;
commonbank.R_TIMESTAMP_SECOND = 0; // Timestamps starts from 0 (ZERO)
Expand All @@ -297,16 +297,16 @@ void core_func_start_core (

/* Read versions from EEPROM */
uint8_t previousFwH = eeprom_rd_byte(EEPROM_ADD_R_FW_VERSION_H);
uint8_t previousHarpH = eeprom_rd_byte(EEPROM_ADD_R_HARP_VERSION_H);
uint8_t previousHarpH = eeprom_rd_byte(EEPROM_ADD_R_CORE_VERSION_H);

/* Check if the versions on EEPROM were never updated */
if (previousHarpH == 0xFF)
{
eeprom_wr_byte(EEPROM_ADD_R_FW_VERSION_H, fwH);
eeprom_wr_byte(EEPROM_ADD_R_HARP_VERSION_H, VH);
eeprom_wr_byte(EEPROM_ADD_R_CORE_VERSION_H, VH);

previousFwH = eeprom_rd_byte(EEPROM_ADD_R_FW_VERSION_H);
previousHarpH = eeprom_rd_byte(EEPROM_ADD_R_HARP_VERSION_H);
previousHarpH = eeprom_rd_byte(EEPROM_ADD_R_CORE_VERSION_H);

/* Write the device name for the first time */
write_device_name_to_eeprom(device_name);
Expand All @@ -324,7 +324,7 @@ void core_func_start_core (

/* Update EERPOM */
eeprom_wr_byte(EEPROM_ADD_R_FW_VERSION_H, fwH);
eeprom_wr_byte(EEPROM_ADD_R_HARP_VERSION_H, VH);
eeprom_wr_byte(EEPROM_ADD_R_CORE_VERSION_H, VH);
}

/* Callback to start the device */
Expand Down
4 changes: 2 additions & 2 deletions Firmware/Library/hwbp_core_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#define ADD_R_HW_VERSION_H 0x01 // U8
#define ADD_R_HW_VERSION_L 0x02 // U8
#define ADD_R_ASSEMBLY_VERSION 0x03 // U8
#define ADD_R_HARP_VERSION_H 0x04 // U8
#define ADD_R_HARP_VERSION_L 0x05 // U8
#define ADD_R_CORE_VERSION_H 0x04 // U8
#define ADD_R_CORE_VERSION_L 0x05 // U8
#define ADD_R_FW_VERSION_H 0x06 // U8
#define ADD_R_FW_VERSION_L 0x07 // U8
#define ADD_R_TIMESTAMP_SECOND 0x08 // U32
Expand Down

0 comments on commit 1a1faef

Please sign in to comment.