Extended 'mode' field in CPS data structure to 8 bits, to align its size to the one contained in rtxStatus_t. Modified code for channel data loading in NVM drivers to align it to the new opMode enum values.

replace/13440fe9857741afafc9764d3fe8922686b23a05
Silvano Seva 2021-06-05 21:21:12 +02:00
rodzic 57b66652b7
commit 6995230d8f
5 zmienionych plików z 15 dodań i 11 usunięć

Wyświetl plik

@ -77,12 +77,14 @@ __attribute__((packed)) dmrInfo_t;
*/
typedef struct
{
uint8_t mode : 1, /**< Operating mode */
bandwidth : 2, /**< Bandwidth */
uint8_t mode; /**< Operating mode */
uint8_t bandwidth : 2, /**< Bandwidth */
admit_criteria : 2, /**< Admit criterion */
squelch : 1, /**< Squelch type: 0 = tight, 1 = normal */
rx_only : 1, /**< 1 means RX-only channel */
vox : 1; /**< VOX enable */
vox : 1, /**< VOX enable */
_padding : 1; /**< Padding to 8 bits */
float power; /**< Transmission power, in watt */

Wyświetl plik

@ -187,7 +187,7 @@ int nvm_readVFOChannelData(channel_t *channel)
AT24Cx_readData(vfoChannelBaseAddr, ((uint8_t *) &chData), sizeof(gdxChannel_t));
// Copy data to OpenRTX channel_t
channel->mode = chData.channel_mode;
channel->mode = chData.channel_mode + 1;
channel->bandwidth = chData.bandwidth;
channel->admit_criteria = chData.admit_criteria;
channel->squelch = chData.squelch;

Wyświetl plik

@ -153,9 +153,9 @@ void nvm_loadHwInfo(hwInfo_t *info)
info->lcd_type = lcdInfo & 0x03;
}
/**
/**
* The MD380 stock CPS does not have a VFO channel slot
* because the stock firmware does not have a VFO
* because the stock firmware does not have a VFO
* To enable this functionality reserve a Flash portion for saving the VFO
*/
int nvm_readVFOChannelData(channel_t *channel)
@ -177,7 +177,7 @@ int nvm_readChannelData(channel_t *channel, uint16_t pos)
W25Qx_readData(readAddr, ((uint8_t *) &chData), sizeof(md3x0Channel_t));
W25Qx_sleep();
channel->mode = chData.channel_mode - 1;
channel->mode = chData.channel_mode;
channel->bandwidth = chData.bandwidth;
channel->admit_criteria = chData.admit_criteria;
channel->squelch = chData.squelch;
@ -263,6 +263,7 @@ int nvm_readZoneData(zone_t *zone, uint16_t pos)
W25Qx_sleep();
// Check if zone is empty
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
if(wcslen((wchar_t *) zoneData.name) == 0) return -1;
/*
* Brutally convert channel name from unicode to char by truncating the most
@ -295,6 +296,7 @@ int nvm_readContactData(contact_t *contact, uint16_t pos)
W25Qx_sleep();
// Check if contact is empty
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
if(wcslen((wchar_t *) contactData.name) == 0) return -1;
/*
* Brutally convert channel name from unicode to char by truncating the most
@ -316,12 +318,12 @@ int nvm_readContactData(contact_t *contact, uint16_t pos)
int nvm_readSettings(settings_t *settings)
{
(void) settings;
return -1;
return -1;
}
int nvm_writeSettings(settings_t *settings)
{
(void) settings;
return -1;
return -1;
}

Wyświetl plik

@ -69,7 +69,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
if(wcslen((wchar_t *) chData.name) == 0) return -1;
channel->mode = chData.channel_mode - 1;
channel->mode = chData.channel_mode;
channel->bandwidth = chData.bandwidth;
channel->admit_criteria = chData.admit_criteria;
channel->squelch = chData.squelch;

Wyświetl plik

@ -69,7 +69,7 @@ int _nvm_readChannelAtAddress(channel_t *channel, uint32_t addr)
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
if(wcslen((wchar_t *) chData.name) == 0) return -1;
channel->mode = chData.channel_mode - 1;
channel->mode = chData.channel_mode;
channel->bandwidth = chData.bandwidth;
channel->admit_criteria = chData.admit_criteria;
channel->squelch = chData.squelch;