diff --git a/Firmware/LICENSE b/Firmware/LICENSE
index 729c67c..a6d761d 100644
--- a/Firmware/LICENSE
+++ b/Firmware/LICENSE
@@ -1,4 +1,4 @@
-Copyright (C) 2021-2022 Filipe Carvalho
+Copyright (C) 2021-2023 Filipe Carvalho
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/Firmware/TimestampGeneratorGen3/TimestampGeneratorGen3.cppproj b/Firmware/TimestampGeneratorGen3/TimestampGeneratorGen3.cppproj
index 3aaed63..6c052cb 100644
--- a/Firmware/TimestampGeneratorGen3/TimestampGeneratorGen3.cppproj
+++ b/Firmware/TimestampGeneratorGen3/TimestampGeneratorGen3.cppproj
@@ -162,7 +162,7 @@
libm
- libATxmega16A4U_ClockSync-1.10.a
+ libATxmega16A4U_ClockSync-1.13.a
diff --git a/Firmware/TimestampGeneratorGen3/app.c b/Firmware/TimestampGeneratorGen3/app.c
index c228671..f79223a 100644
--- a/Firmware/TimestampGeneratorGen3/app.c
+++ b/Firmware/TimestampGeneratorGen3/app.c
@@ -44,7 +44,8 @@ void hwbp_app_initialize(void)
APP_REGS_ADD_MAX - APP_REGS_ADD_MIN + 1,
default_device_name,
true, // The device is able to repeat the harp timestamp clock
- true // The device is able to generate the harp timestamp clock
+ true, // The device is able to generate the harp timestamp clock
+ 3 // Default timestamp offset
);
}
diff --git a/Firmware/TimestampGeneratorGen3/hwbp_core.h b/Firmware/TimestampGeneratorGen3/hwbp_core.h
index 2f0ae01..06f5f91 100644
--- a/Firmware/TimestampGeneratorGen3/hwbp_core.h
+++ b/Firmware/TimestampGeneratorGen3/hwbp_core.h
@@ -68,11 +68,6 @@ bool hwbp_read_common_reg(uint8_t add, uint8_t type);
// Write to an common register.
bool hwbp_write_common_reg(uint8_t add, uint8_t type, uint8_t * content, uint16_t n_elements);
-/************************************************************************/
-/* Register OPERATION_CTRL */
-/************************************************************************/
-// Write to common register OPERATION_CTRL.
-bool hwbp_write_common_reg_OPERATION_CTRL(void *a);
/************************************************************************/
/* Register RESET_APP */
@@ -83,6 +78,7 @@ bool hwbp_write_common_reg_RESET_APP(void *a);
// Used to save all registers to non-volatile memory
bool core_save_all_registers_to_eeprom(void);
+
/************************************************************************/
/* Register CONFIG */
/************************************************************************/
@@ -130,7 +126,8 @@ void core_func_start_core (
const uint8_t num_of_app_registers,
const uint8_t *device_name,
const bool device_is_able_to_repeat_clock,
- const bool device_is_able_to_generate_clock
+ const bool device_is_able_to_generate_clock,
+ const uint8_t default_timestamp_offset
);
// Call this function in case of error
diff --git a/Firmware/TimestampGeneratorGen3/hwbp_core_regs.h b/Firmware/TimestampGeneratorGen3/hwbp_core_regs.h
index 06cdccb..1fd7b52 100644
--- a/Firmware/TimestampGeneratorGen3/hwbp_core_regs.h
+++ b/Firmware/TimestampGeneratorGen3/hwbp_core_regs.h
@@ -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
@@ -21,9 +21,10 @@
#define ADD_R_DEVICE_NAME 0x0C // U8
#define ADD_R_SERIAL_NUMBER 0x0D // U16
#define ADD_R_CONFIG 0x0E // U8
+#define ADD_R_TIMESTAMP_OFFSET 0x0F // U8
/* Memory limits */
-#define COMMON_BANK_ADD_MAX 0x0E
+#define COMMON_BANK_ADD_MAX 0x0F
#define COMMON_BANK_ABSOLUTE_ADD_MAX 0x1C
/* R_OPERATION_CTRL */
diff --git a/Firmware/TimestampGeneratorGen3/hwbp_core_types.h b/Firmware/TimestampGeneratorGen3/hwbp_core_types.h
index fc29bac..65892fe 100644
--- a/Firmware/TimestampGeneratorGen3/hwbp_core_types.h
+++ b/Firmware/TimestampGeneratorGen3/hwbp_core_types.h
@@ -26,9 +26,9 @@
#define MSK_TIMESTAMP_AT_PAYLOAD 0x10
/************************************************************************/
-/* Maximum size of an entire packet (header to chksum) */
+/* Maximum size of a received packet */
/************************************************************************/
-#define MAX_PACKET_SIZE 256
+#define MAX_PACKET_SIZE 255
#endif /* _HWBP_CORE_TYPES_H_ */
\ No newline at end of file
diff --git a/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.10.a b/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.10.a
deleted file mode 100644
index e437875..0000000
Binary files a/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.10.a and /dev/null differ
diff --git a/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.13.a b/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.13.a
new file mode 100644
index 0000000..db1b72f
Binary files /dev/null and b/Firmware/TimestampGeneratorGen3/libATxmega16A4U_ClockSync-1.13.a differ
diff --git a/device.yml b/device.yml
index 2512c1c..ad0f8f7 100644
--- a/device.yml
+++ b/device.yml
@@ -3,7 +3,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/harp-tech/reflex-generator/main/schema/device.json
device: TimestampGeneratorGen3
whoAmI: 1158
-firmwareVersion: "1.0"
+firmwareVersion: "1.1"
hardwareTargets: "1.2"
registers:
Config: