mirror of https://github.com/g4klx/MMDVM.git
Fix HWType string of RPT_HAT_TGO to work with MMDVMCal and add udid support to the firmware
This commit is contained in:
parent
7c863671c9
commit
d6d03158d0
|
@ -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,6 +109,7 @@ 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(),
|
||||||
|
@ -237,7 +238,7 @@ void CSerialPort::getStatus()
|
||||||
|
|
||||||
void CSerialPort::getVersion()
|
void CSerialPort::getVersion()
|
||||||
{
|
{
|
||||||
uint8_t reply[150U];
|
uint8_t reply[192U];
|
||||||
|
|
||||||
reply[0U] = MMDVM_FRAME_START;
|
reply[0U] = MMDVM_FRAME_START;
|
||||||
reply[1U] = 0U;
|
reply[1U] = 0U;
|
||||||
|
@ -249,6 +250,10 @@ 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);
|
||||||
|
|
|
@ -834,9 +834,25 @@ 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)
|
||||||
|
|
|
@ -106,9 +106,21 @@ 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);
|
||||||
|
|
Loading…
Reference in New Issue