diff --git a/Config.h b/Config.h index 2f41693..842d5df 100644 --- a/Config.h +++ b/Config.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/SerialPort.cpp b/SerialPort.cpp index e155220..1d5ff50 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -78,7 +78,9 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U; const uint8_t PROTOCOL_VERSION = 1U; +#if defined(ENABLE_UDID) char UDID[] = "00000000000000000000000000000000"; +#endif CSerialPort::CSerialPort() : m_buffer(), @@ -211,9 +213,11 @@ void CSerialPort::getVersion() for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++) reply[count] = HARDWARE[i]; +#if defined(ENABLE_UDID) reply[count++] = '\0'; for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++) reply[count] = UDID[i]; +#endif reply[1U] = count; diff --git a/SerialSTM.cpp b/SerialSTM.cpp index 3977878..61c20d3 100644 --- a/SerialSTM.cpp +++ b/SerialSTM.cpp @@ -433,13 +433,16 @@ void WriteUSART2(const uint8_t* data, uint16_t length) #endif ///////////////////////////////////////////////////////////////// +#if defined(ENABLE_UDID) extern char UDID[]; extern "C" { #include } +#endif void CSerialPort::beginInt(uint8_t n, int speed) { +#if defined(ENABLE_UDID) #if defined(STM32F4XX) uint32_t *id0 = (uint32_t *) (0x1FFF7A10); uint32_t *id1 = (uint32_t *) (0x1FFF7A10 + 0x04); @@ -458,6 +461,7 @@ void CSerialPort::beginInt(uint8_t n, int speed) uint32_t *id1 = (uint32_t *) (0x1FFFF7E8 + 0x04); uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08); ::sprintf(UDID, "%04X%04X%08X%08X", *id00, *id01, *(unsigned int *)id1, *(unsigned int *)id2); +#endif #endif switch (n) { diff --git a/configs/D2RG_MMDVM_HS.h b/configs/D2RG_MMDVM_HS.h index abde186..9c55cf2 100644 --- a/configs/D2RG_MMDVM_HS.h +++ b/configs/D2RG_MMDVM_HS.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/MMDVM_HS_Dual_Hat-12mhz.h b/configs/MMDVM_HS_Dual_Hat-12mhz.h index df6d0d9..88779ef 100644 --- a/configs/MMDVM_HS_Dual_Hat-12mhz.h +++ b/configs/MMDVM_HS_Dual_Hat-12mhz.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/MMDVM_HS_Dual_Hat.h b/configs/MMDVM_HS_Dual_Hat.h index 64e600d..ace2477 100644 --- a/configs/MMDVM_HS_Dual_Hat.h +++ b/configs/MMDVM_HS_Dual_Hat.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/MMDVM_HS_Hat-12mhz.h b/configs/MMDVM_HS_Hat-12mhz.h index 56ad528..34d38f2 100644 --- a/configs/MMDVM_HS_Hat-12mhz.h +++ b/configs/MMDVM_HS_Hat-12mhz.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/MMDVM_HS_Hat.h b/configs/MMDVM_HS_Hat.h index a847690..643a817 100644 --- a/configs/MMDVM_HS_Hat.h +++ b/configs/MMDVM_HS_Hat.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/NanoDV_NPI.h b/configs/NanoDV_NPI.h index 50bb008..8f987d7 100644 --- a/configs/NanoDV_NPI.h +++ b/configs/NanoDV_NPI.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/NanoDV_USB.h b/configs/NanoDV_USB.h index eab6287..ce20034 100644 --- a/configs/NanoDV_USB.h +++ b/configs/NanoDV_USB.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/Nano_hotSPOT.h b/configs/Nano_hotSPOT.h index 55d93e2..187cab6 100644 --- a/configs/Nano_hotSPOT.h +++ b/configs/Nano_hotSPOT.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/ZUMspot_Libre.h b/configs/ZUMspot_Libre.h index 2f41693..842d5df 100644 --- a/configs/ZUMspot_Libre.h +++ b/configs/ZUMspot_Libre.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/ZUMspot_RPi.h b/configs/ZUMspot_RPi.h index 653a0e5..f7cd5f6 100644 --- a/configs/ZUMspot_RPi.h +++ b/configs/ZUMspot_RPi.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/ZUMspot_USB.h b/configs/ZUMspot_USB.h index 59b926c..b055bfb 100644 --- a/configs/ZUMspot_USB.h +++ b/configs/ZUMspot_USB.h @@ -107,4 +107,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/ZUMspot_dualband.h b/configs/ZUMspot_dualband.h index f21c673..d974f08 100644 --- a/configs/ZUMspot_dualband.h +++ b/configs/ZUMspot_dualband.h @@ -106,4 +106,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/ZUMspot_duplex.h b/configs/ZUMspot_duplex.h index e90676f..80da2c5 100644 --- a/configs/ZUMspot_duplex.h +++ b/configs/ZUMspot_duplex.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/generic_duplex_gpio.h b/configs/generic_duplex_gpio.h index 172ec76..96428b9 100644 --- a/configs/generic_duplex_gpio.h +++ b/configs/generic_duplex_gpio.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif diff --git a/configs/generic_duplex_usb.h b/configs/generic_duplex_usb.h index 1a5a05d..b1e7b74 100644 --- a/configs/generic_duplex_usb.h +++ b/configs/generic_duplex_usb.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +// #define ENABLE_UDID + #endif diff --git a/configs/generic_gpio.h b/configs/generic_gpio.h index 9d95d06..e946f12 100644 --- a/configs/generic_gpio.h +++ b/configs/generic_gpio.h @@ -108,4 +108,7 @@ // Disable frequency restrictions (satellite, ISS, etc) // #define DISABLE_FREQ_BAN +// Enable UDID feature +#define ENABLE_UDID + #endif