mirror of https://github.com/g4klx/MMDVM.git
Simplify the pre-emphasis code for AX.25.
This commit is contained in:
parent
a73376671c
commit
43f84ae968
20
AX25TX.cpp
20
AX25TX.cpp
|
@ -49,7 +49,6 @@ const q15_t AUDIO_TABLE_DATA[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
CAX25TX::CAX25TX() :
|
CAX25TX::CAX25TX() :
|
||||||
m_twist(-6),
|
|
||||||
m_poBuffer(),
|
m_poBuffer(),
|
||||||
m_poLen(0U),
|
m_poLen(0U),
|
||||||
m_poPtr(0U),
|
m_poPtr(0U),
|
||||||
|
@ -138,22 +137,25 @@ uint8_t CAX25TX::writeData(const uint8_t* data, uint16_t length)
|
||||||
|
|
||||||
void CAX25TX::writeBit(bool b)
|
void CAX25TX::writeBit(bool b)
|
||||||
{
|
{
|
||||||
q15_t in[AX25_RADIO_SYMBOL_LENGTH];
|
q15_t buffer[AX25_RADIO_SYMBOL_LENGTH];
|
||||||
for (uint8_t i = 0U; i < AX25_RADIO_SYMBOL_LENGTH; i++) {
|
for (uint8_t i = 0U; i < AX25_RADIO_SYMBOL_LENGTH; i++) {
|
||||||
in[i] = AUDIO_TABLE_DATA[m_tablePtr];
|
q15_t value = AUDIO_TABLE_DATA[m_tablePtr];
|
||||||
if (b)
|
|
||||||
|
if (b) {
|
||||||
m_tablePtr += 11U;
|
m_tablePtr += 11U;
|
||||||
else
|
} else {
|
||||||
|
// De-emphasise the lower frequency by 6dB
|
||||||
|
value >>= 2;
|
||||||
m_tablePtr += 6U;
|
m_tablePtr += 6U;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer[i] = value;
|
||||||
|
|
||||||
if (m_tablePtr >= AUDIO_TABLE_LEN)
|
if (m_tablePtr >= AUDIO_TABLE_LEN)
|
||||||
m_tablePtr -= AUDIO_TABLE_LEN;
|
m_tablePtr -= AUDIO_TABLE_LEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
q15_t out[AX25_RADIO_SYMBOL_LENGTH];
|
io.write(STATE_AX25, buffer, AX25_RADIO_SYMBOL_LENGTH);
|
||||||
m_twist.process(in, out, AX25_RADIO_SYMBOL_LENGTH);
|
|
||||||
|
|
||||||
io.write(STATE_AX25, out, AX25_RADIO_SYMBOL_LENGTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAX25TX::setTXDelay(uint8_t delay)
|
void CAX25TX::setTXDelay(uint8_t delay)
|
||||||
|
|
3
AX25TX.h
3
AX25TX.h
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
#include "AX25Twist.h"
|
|
||||||
|
|
||||||
class CAX25TX {
|
class CAX25TX {
|
||||||
public:
|
public:
|
||||||
CAX25TX();
|
CAX25TX();
|
||||||
|
@ -36,7 +34,6 @@ public:
|
||||||
uint8_t getSpace() const;
|
uint8_t getSpace() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CAX25Twist m_twist;
|
|
||||||
uint8_t m_poBuffer[600U];
|
uint8_t m_poBuffer[600U];
|
||||||
uint16_t m_poLen;
|
uint16_t m_poLen;
|
||||||
uint16_t m_poPtr;
|
uint16_t m_poPtr;
|
||||||
|
|
|
@ -109,7 +109,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
||||||
#define HW_TYPE "MMDVM"
|
#define HW_TYPE "MMDVM"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DESCRIPTION "20200628 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM/AX.25)"
|
#define DESCRIPTION "20200629 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM/AX.25)"
|
||||||
|
|
||||||
#if defined(GITVERSION)
|
#if defined(GITVERSION)
|
||||||
#define concat(h, a, b, c) h " " a " " b " GitID #" c ""
|
#define concat(h, a, b, c) h " " a " " b " GitID #" c ""
|
||||||
|
|
Loading…
Reference in New Issue