mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-04-05 14:37:02 +00:00
Simplify the FM arguments.
This commit is contained in:
parent
d1c106b3b8
commit
8ca756ec22
3 changed files with 10 additions and 11 deletions
|
|
@ -101,7 +101,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
|||
#define HW_TYPE "MMDVM"
|
||||
#endif
|
||||
|
||||
#define DESCRIPTION "20200417 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)"
|
||||
#define DESCRIPTION "20200418 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)"
|
||||
|
||||
#if defined(GITVERSION)
|
||||
#define concat(h, a, b, c) h " " a " " b " GitID #" c ""
|
||||
|
|
@ -365,26 +365,25 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
|
||||
uint8_t CSerialPort::setFMParams1(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (length < 8U)
|
||||
if (length < 7U)
|
||||
return 4U;
|
||||
|
||||
uint8_t speed = data[0U];;
|
||||
uint16_t frequency = data[1U] * 10U;
|
||||
uint8_t time = data[2U];
|
||||
uint8_t holdoff = data[3U];
|
||||
uint8_t highLevel = data[4U];
|
||||
uint8_t lowLevel = data[5U];
|
||||
uint8_t level = data[4U];
|
||||
|
||||
bool callAtStart = (data[6U] & 0x01U) == 0x01U;
|
||||
bool callAtEnd = (data[6U] & 0x02U) == 0x02U;
|
||||
bool callAtStart = (data[5U] & 0x01U) == 0x01U;
|
||||
bool callAtEnd = (data[5U] & 0x02U) == 0x02U;
|
||||
|
||||
char callsign[50U];
|
||||
uint8_t n = 0U;
|
||||
for (uint8_t i = 7U; i < length; i++, n++)
|
||||
for (uint8_t i = 6U; i < length; i++, n++)
|
||||
callsign[n] = data[i];
|
||||
callsign[n] = '\0';
|
||||
|
||||
return fm.setCallsign(callsign, speed, frequency, time, holdoff, highLevel, lowLevel, callAtStart, callAtEnd);
|
||||
return fm.setCallsign(callsign, speed, frequency, time, holdoff, level, callAtStart, callAtEnd);
|
||||
}
|
||||
|
||||
uint8_t CSerialPort::setFMParams2(const uint8_t* data, uint8_t length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue