1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Merge branch 'amorale/OP-974_make_bl_info_available_to_fw' into next

This commit is contained in:
Alessio Morale 2014-03-09 16:17:34 +01:00
commit 0f2d65a8e4
6 changed files with 28 additions and 1 deletions

View File

@ -100,6 +100,7 @@ int32_t FirmwareIAPInitialize()
PIOS_BL_HELPER_FLASH_Read_Description(data.Description, FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
data.BoardRevision = bdinfo->board_rev;
data.BootloaderRevision = bdinfo->bl_rev;
data.ArmReset = 0;
data.crc = 0;
FirmwareIAPObjSet(&data);
@ -147,6 +148,7 @@ static void FirmwareIAPCallback(UAVObjEvent *ev)
PIOS_BL_HELPER_FLASH_Read_Description(data.Description, FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
data.BoardRevision = bdinfo->board_rev;
data.BootloaderRevision = bdinfo->bl_rev;
data.crc = PIOS_BL_HELPER_CRC_Memory_Calc();
FirmwareIAPObjSet(&data);
}

View File

@ -263,6 +263,15 @@ int UAVObjectUtilManager::getBoardModel()
return ret;
}
int UAVObjectUtilManager::getBootloaderRevision()
{
FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
int ret = firmwareIapData.BootloaderRevision;
return ret;
}
/**
* Get the UAV Board CPU Serial Number, for anyone interested. Return format is a byte array
*/

View File

@ -58,6 +58,7 @@ public:
int getGPSPositionSensor(double LLA[3]);
int getBoardModel();
int getBootloaderRevision();
QByteArray getBoardCPUSerial();
quint32 getFirmwareCRC();
QByteArray getBoardDescription();

View File

@ -99,8 +99,9 @@ void RunningDeviceWidget::populate()
QString serial = utilMngr->getBoardCPUSerial().toHex();
myDevice->CPUSerial->setText(serial);
myDevice->lblBLRev->setText(tr("BL version: ") + QString::number(utilMngr->getBootloaderRevision()));
QByteArray description = utilMngr->getBoardDescription();
deviceDescriptorStruct devDesc;
if (UAVObjectUtilManager::descriptionToStructure(description, devDesc)) {
if (devDesc.gitTag.startsWith("RELEASE", Qt::CaseSensitive)) {

View File

@ -95,6 +95,19 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblBLRev">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>BlRevision</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>

View File

@ -6,6 +6,7 @@
<field name="CPUSerial" units="" type="uint8" elements="12" />
<field name="BoardRevision" units="" type="uint16" elements="1"/>
<field name="BoardType" units="" type="uint8" elements="1"/>
<field name="BootloaderRevision" units="" type="uint8" elements="1"/>
<field name="ArmReset" units="" type="uint8" elements="1"/>
<field name="crc" units="" type="uint32" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>