mirror of
https://github.com/juribeparada/MMDVM_HS.git
synced 2025-12-06 07:12:08 +01:00
UDID is now optional (disabled in some boards to save flash memory)
This commit is contained in:
parent
146e6fb3e6
commit
1210748cdb
3
Config.h
3
Config.h
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,9 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
||||||
|
|
||||||
const uint8_t PROTOCOL_VERSION = 1U;
|
const uint8_t PROTOCOL_VERSION = 1U;
|
||||||
|
|
||||||
|
#if defined(ENABLE_UDID)
|
||||||
char UDID[] = "00000000000000000000000000000000";
|
char UDID[] = "00000000000000000000000000000000";
|
||||||
|
#endif
|
||||||
|
|
||||||
CSerialPort::CSerialPort() :
|
CSerialPort::CSerialPort() :
|
||||||
m_buffer(),
|
m_buffer(),
|
||||||
|
|
@ -211,9 +213,11 @@ void CSerialPort::getVersion()
|
||||||
for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++)
|
for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++)
|
||||||
reply[count] = HARDWARE[i];
|
reply[count] = HARDWARE[i];
|
||||||
|
|
||||||
|
#if defined(ENABLE_UDID)
|
||||||
reply[count++] = '\0';
|
reply[count++] = '\0';
|
||||||
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
|
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
|
||||||
reply[count] = UDID[i];
|
reply[count] = UDID[i];
|
||||||
|
#endif
|
||||||
|
|
||||||
reply[1U] = count;
|
reply[1U] = count;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -433,13 +433,16 @@ void WriteUSART2(const uint8_t* data, uint16_t length)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
#if defined(ENABLE_UDID)
|
||||||
extern char UDID[];
|
extern char UDID[];
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CSerialPort::beginInt(uint8_t n, int speed)
|
void CSerialPort::beginInt(uint8_t n, int speed)
|
||||||
{
|
{
|
||||||
|
#if defined(ENABLE_UDID)
|
||||||
#if defined(STM32F4XX)
|
#if defined(STM32F4XX)
|
||||||
uint32_t *id0 = (uint32_t *) (0x1FFF7A10);
|
uint32_t *id0 = (uint32_t *) (0x1FFF7A10);
|
||||||
uint32_t *id1 = (uint32_t *) (0x1FFF7A10 + 0x04);
|
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 *id1 = (uint32_t *) (0x1FFFF7E8 + 0x04);
|
||||||
uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08);
|
uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08);
|
||||||
::sprintf(UDID, "%04X%04X%08X%08X", *id00, *id01, *(unsigned int *)id1, *(unsigned int *)id2);
|
::sprintf(UDID, "%04X%04X%08X%08X", *id00, *id01, *(unsigned int *)id1, *(unsigned int *)id2);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (n) {
|
switch (n) {
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -107,4 +107,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -106,4 +106,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
// #define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,7 @@
|
||||||
// Disable frequency restrictions (satellite, ISS, etc)
|
// Disable frequency restrictions (satellite, ISS, etc)
|
||||||
// #define DISABLE_FREQ_BAN
|
// #define DISABLE_FREQ_BAN
|
||||||
|
|
||||||
|
// Enable UDID feature
|
||||||
|
#define ENABLE_UDID
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue