Skip to content
Permalink
Browse files

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

This reverts commit b94b8af, reversing
changes made to 7c86367.
  • Loading branch information...
Jonathan Naylor
Jonathan Naylor committed Jun 4, 2019
1 parent b94b8af commit dfad6d8409486148e48303051b3080eff5ab92b0
Showing with 2 additions and 56 deletions.
  1. +0 −21 SerialArduino.cpp
  2. +2 −7 SerialPort.cpp
  3. +0 −16 SerialSTM.cpp
  4. +0 −12 SerialSTM_CMSIS.cpp
@@ -26,29 +26,8 @@

#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)
{
#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) {
case 1U:
Serial.begin(speed);
@@ -92,7 +92,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
#endif

#if defined(STM32F4_RPT_HAT_TGO)
#define HW_TYPE "MMDVM RPT_HAT_TGO"
#define HW_TYPE "MMDVM_RPT_HAT_TGO"
#else
#define HW_TYPE "MMDVM"
#endif
@@ -109,7 +109,6 @@ const char HARDWARE[] = concat(HW_TYPE, DESCRIPTION, TCXO, __TIME__, __DATE__);

const uint8_t PROTOCOL_VERSION = 1U;

char UDID[] = "00000000000000000000000000000000";

CSerialPort::CSerialPort() :
m_buffer(),
@@ -238,7 +237,7 @@ void CSerialPort::getStatus()

void CSerialPort::getVersion()
{
uint8_t reply[192U];
uint8_t reply[150U];

reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U;
@@ -250,10 +249,6 @@ void CSerialPort::getVersion()
for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++)
reply[count] = HARDWARE[i];

reply[count++] = '\0';
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
reply[count] = UDID[i];

reply[1U] = count;

writeInt(1U, reply, count);
@@ -834,25 +834,9 @@ void WriteUART5(const uint8_t* data, uint16_t length)

#endif
/////////////////////////////////////////////////////////////////
extern char UDID[];
extern "C" {
#include <stdio.h>
}

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) {
case 1U:
#if defined(STM32F4_DISCOVERY) || defined(STM32F7_NUCLEO)
@@ -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)
{
#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) {
case 1U:
USART1Init(speed);

0 comments on commit dfad6d8

Please sign in to comment.
You can’t perform that action at this time.