Revert "Merge pull request #204 from shawnchain/support_udid"

This reverts commit b94b8afb77, reversing
changes made to 7c863671c9.
This commit is contained in:
Jonathan Naylor 2019-06-04 10:12:53 +01:00
parent b94b8afb77
commit dfad6d8409
4 changed files with 2 additions and 56 deletions

View File

@ -26,29 +26,8 @@
#elif defined(__SAM3X8E__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) #elif defined(__SAM3X8E__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
#if defined(__SAM3X8E__)
extern "C" {
#include <stdio.h>
}
extern char UDID[];
#define FLASH_ACCESS_MODE_128 0
#define EFC0 (0x400E0A00U)
#define EFC ((Efc*)EFC0)
#endif
void CSerialPort::beginInt(uint8_t n, int speed) void CSerialPort::beginInt(uint8_t n, int speed)
{ {
#if defined(__SAM3X8E__)
uint32_t _id[4];
if (0 == efc_init(EFC, FLASH_ACCESS_MODE_128, 4))
if (0 == efc_perform_read_sequence(EFC, EFC_FCMD_STUI, EFC_FCMD_SPUI, _id, 4))
::sprintf(UDID,"%08X%08X%08X%08X",_id[0],_id[1],_id[2],_id[3]);
#endif
switch (n) { switch (n) {
case 1U: case 1U:
Serial.begin(speed); Serial.begin(speed);

View File

@ -92,7 +92,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
#endif #endif
#if defined(STM32F4_RPT_HAT_TGO) #if defined(STM32F4_RPT_HAT_TGO)
#define HW_TYPE "MMDVM RPT_HAT_TGO" #define HW_TYPE "MMDVM_RPT_HAT_TGO"
#else #else
#define HW_TYPE "MMDVM" #define HW_TYPE "MMDVM"
#endif #endif
@ -109,7 +109,6 @@ const char HARDWARE[] = concat(HW_TYPE, DESCRIPTION, TCXO, __TIME__, __DATE__);
const uint8_t PROTOCOL_VERSION = 1U; const uint8_t PROTOCOL_VERSION = 1U;
char UDID[] = "00000000000000000000000000000000";
CSerialPort::CSerialPort() : CSerialPort::CSerialPort() :
m_buffer(), m_buffer(),
@ -238,7 +237,7 @@ void CSerialPort::getStatus()
void CSerialPort::getVersion() void CSerialPort::getVersion()
{ {
uint8_t reply[192U]; uint8_t reply[150U];
reply[0U] = MMDVM_FRAME_START; reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U; reply[1U] = 0U;
@ -250,10 +249,6 @@ 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];
reply[count++] = '\0';
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
reply[count] = UDID[i];
reply[1U] = count; reply[1U] = count;
writeInt(1U, reply, count); writeInt(1U, reply, count);

View File

@ -834,25 +834,9 @@ void WriteUART5(const uint8_t* data, uint16_t length)
#endif #endif
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
extern char UDID[];
extern "C" {
#include <stdio.h>
}
void CSerialPort::beginInt(uint8_t n, int speed) void CSerialPort::beginInt(uint8_t n, int speed)
{ {
#if defined(STM32F4XX)
uint32_t *id0 = (uint32_t *) (0x1FFF7A10);
uint32_t *id1 = (uint32_t *) (0x1FFF7A10 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FFF7A10 + 0x08);
::sprintf(UDID, "%08X%08X%08X", *id0,*id1,*id2);
#elif defined(STM32F7XX)
uint32_t *id0 = (uint32_t *) (0x1FF0F420);
uint32_t *id1 = (uint32_t *) (0x1FF0F420 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FF0F420 + 0x08);
::sprintf(UDID, "%08X%08X%08X", *id0,*id1,*id2);
#endif
switch (n) { switch (n) {
case 1U: case 1U:
#if defined(STM32F4_DISCOVERY) || defined(STM32F7_NUCLEO) #if defined(STM32F4_DISCOVERY) || defined(STM32F7_NUCLEO)

View File

@ -106,21 +106,9 @@ RAMFUNC void USART1TxData(const uint8_t* data, uint16_t length)
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
extern char UDID[];
extern "C" {
#include <stdio.h>
}
void CSerialPort::beginInt(uint8_t n, int speed) void CSerialPort::beginInt(uint8_t n, int speed)
{ {
#if defined(STM32F105xC)
uint16_t *id00 = (uint16_t *) (0x1FFFF7E8);
uint16_t *id01 = (uint16_t *) (0x1FFFF7E8 + 0x02);
uint32_t *id1 = (uint32_t *) (0x1FFFF7E8 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08);
::sprintf(UDID, "%04X%04X%08X%08X", *id00,*id01,*id1,*id2);
#endif
switch (n) { switch (n) {
case 1U: case 1U:
USART1Init(speed); USART1Init(speed);