mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Merge branch 'next' into corvuscorax/OP-946_refaktor_sensor_and_state
This commit is contained in:
commit
49b8e0d699
@ -224,7 +224,9 @@ int32_t AttitudeStart(void)
|
|||||||
// Start main task
|
// Start main task
|
||||||
xTaskCreate(AttitudeTask, (signed char *)"Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &attitudeTaskHandle);
|
xTaskCreate(AttitudeTask, (signed char *)"Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &attitudeTaskHandle);
|
||||||
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, attitudeTaskHandle);
|
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, attitudeTaskHandle);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
|
|
||||||
GyroSensorConnectQueue(gyroQueue);
|
GyroSensorConnectQueue(gyroQueue);
|
||||||
AccelSensorConnectQueue(accelQueue);
|
AccelSensorConnectQueue(accelQueue);
|
||||||
@ -282,7 +284,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
|
|||||||
initialization_required = true;
|
initialization_required = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,9 @@ int32_t SensorsStart(void)
|
|||||||
// Start main task
|
// Start main task
|
||||||
xTaskCreate(SensorsTask, (signed char *)"Sensors", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &sensorsTaskHandle);
|
xTaskCreate(SensorsTask, (signed char *)"Sensors", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &sensorsTaskHandle);
|
||||||
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_SENSORS, sensorsTaskHandle);
|
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_SENSORS, sensorsTaskHandle);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_RegisterFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_RegisterFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -201,7 +203,9 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
if (accel_test < 0 || gyro_test < 0 || mag_test < 0) {
|
if (accel_test < 0 || gyro_test < 0 || mag_test < 0) {
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
while (1) {
|
while (1) {
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
vTaskDelay(10);
|
vTaskDelay(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,7 +220,9 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
timeval = PIOS_DELAY_GetRaw();
|
timeval = PIOS_DELAY_GetRaw();
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS);
|
vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS);
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
@ -401,7 +407,9 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
}
|
}
|
||||||
#endif /* if defined(PIOS_INCLUDE_HMC5883) */
|
#endif /* if defined(PIOS_INCLUDE_HMC5883) */
|
||||||
|
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
|
|
||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,9 @@ void PIOS_Board_Init(void)
|
|||||||
PIOS_IAP_WriteBootCmd(1, 0);
|
PIOS_IAP_WriteBootCmd(1, 0);
|
||||||
PIOS_IAP_WriteBootCmd(2, 0);
|
PIOS_IAP_WriteBootCmd(2, 0);
|
||||||
}
|
}
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_Init();
|
PIOS_WDG_Init();
|
||||||
|
#endif
|
||||||
/* Initialize UAVObject libraries */
|
/* Initialize UAVObject libraries */
|
||||||
EventDispatcherInitialize();
|
EventDispatcherInitialize();
|
||||||
UAVObjInitialize();
|
UAVObjInitialize();
|
||||||
|
@ -44,15 +44,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct __attribute__((packed)) fw_version_info {
|
struct __attribute__((packed)) fw_version_info {
|
||||||
uint8_t magic[4];
|
uint8_t magic[4];
|
||||||
uint32_t commit_hash_prefix;
|
uint32_t commit_hash_prefix;
|
||||||
uint32_t timestamp;
|
uint32_t timestamp;
|
||||||
uint8_t board_type;
|
uint8_t board_type;
|
||||||
uint8_t board_revision;
|
uint8_t board_revision;
|
||||||
uint8_t commit_tag_name[26];
|
uint8_t commit_tag_name[26];
|
||||||
uint8_t sha1sum[20];
|
uint8_t sha1sum[20];
|
||||||
uint8_t uavosha1[20];
|
uint8_t uavosha1[20];
|
||||||
uint8_t pad[20];
|
uint8_t pad[20];
|
||||||
};
|
};
|
||||||
|
|
||||||
#if (defined(__MACH__) && defined(__APPLE__))
|
#if (defined(__MACH__) && defined(__APPLE__))
|
||||||
@ -60,16 +60,12 @@ const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__
|
|||||||
#else
|
#else
|
||||||
const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__((__section__(".fw_version_blob"))) = {
|
const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__((__section__(".fw_version_blob"))) = {
|
||||||
#endif
|
#endif
|
||||||
.magic = { 'O','p','F','w' },
|
.magic = { 'O','p','F','w' },
|
||||||
.commit_hash_prefix = 0x${HASH8},
|
.commit_hash_prefix = 0x${HASH8},
|
||||||
.timestamp = ${UNIXTIME},
|
.timestamp = ${UNIXTIME},
|
||||||
.board_type = ${BOARD_TYPE},
|
.board_type = ${BOARD_TYPE},
|
||||||
.board_revision = ${BOARD_REVISION},
|
.board_revision = ${BOARD_REVISION},
|
||||||
.commit_tag_name = "${FWTAG}",
|
.commit_tag_name = "${FWTAG}",
|
||||||
.sha1sum = { ${SHA1} },
|
.sha1sum = { ${SHA1} },
|
||||||
.uavosha1 = { ${UAVOSHA1} },
|
.uavosha1 = { ${UAVOSHA1} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
@ -77,7 +77,7 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu
|
|||||||
getWizard()->setWindowIcon(qApp->windowIcon());
|
getWizard()->setWindowIcon(qApp->windowIcon());
|
||||||
enableButtons(true);
|
enableButtons(true);
|
||||||
getWizard()->show();
|
getWizard()->show();
|
||||||
ui->statusLabel->setText("Something went wrong, you will have to manualy upgrade the board using the uploader plugin");
|
ui->statusLabel->setText("Something went wrong, you will have to manually upgrade the board using the uploader plugin");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>822</width>
|
<width>822</width>
|
||||||
<height>350</height>
|
<height>523</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -15,215 +15,316 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<item>
|
<property name="frameShape">
|
||||||
<widget class="QPushButton" name="haltButton">
|
<enum>QFrame::NoFrame</enum>
|
||||||
<property name="enabled">
|
</property>
|
||||||
<bool>false</bool>
|
<property name="widgetResizable">
|
||||||
</property>
|
<bool>true</bool>
|
||||||
<property name="toolTip">
|
</property>
|
||||||
<string>Tells the mainboard to go down
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>804</width>
|
||||||
|
<height>505</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="buttonFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="autoUpdateButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Start a guided procedure to manually
|
||||||
|
recover a system which does not boot.
|
||||||
|
|
||||||
|
Rescue is possible in USB mode only.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto Update</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="haltButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Tells the mainboard to go down
|
||||||
to bootloader mode.
|
to bootloader mode.
|
||||||
(Only enabled if telemetry link is established, either
|
(Only enabled if telemetry link is established, either
|
||||||
through serial or USB)</string>
|
through serial or USB)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Halt</string>
|
<string>Halt</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="bootButton">
|
<widget class="QPushButton" name="resetButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Boots the system.
|
<string>Reset the system.
|
||||||
|
(Only enabled if telemetry link is established, either
|
||||||
|
through serial or USB)</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="bootButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Boots the system.
|
||||||
Only useful if the system is halted
|
Only useful if the system is halted
|
||||||
(mainboard blue LED blinking slowly, green LED on)
|
(mainboard blue LED blinking slowly, green LED on)
|
||||||
|
|
||||||
If telemetry is not running, select the link using the dropdown
|
If telemetry is not running, select the link using the dropdown
|
||||||
menu on the right.</string>
|
menu on the right.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Boot</string>
|
<string>Boot</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="safeBootButton">
|
<widget class="QPushButton" name="safeBootButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Boots the system into safe mode (ie. default HwSettings).
|
<string>Boots the system into safe mode (ie. default HwSettings).
|
||||||
Only useful if the system is halted
|
Only useful if the system is halted
|
||||||
(mainboard blue LED blinking slowly, orange LED off)
|
(mainboard blue LED blinking slowly, orange LED off)
|
||||||
|
|
||||||
If telemetry is not running, select the link using the dropdown
|
If telemetry is not running, select the link using the dropdown
|
||||||
menu on the right.</string>
|
menu on the right.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Safe Boot</string>
|
<string>Safe Boot</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="eraseBootButton">
|
<widget class="QPushButton" name="rescueButton">
|
||||||
<property name="enabled">
|
<property name="toolTip">
|
||||||
<bool>true</bool>
|
<string>Start a guided procedure to manually
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Reboot the board and clear its settings memory.</p><p> Useful if the board cannot boot properly.</p><p> Blue led starts blinking quick for 20-30 seconds than the board will start normally</p><p><br/></p><p>If telemetry is not running, select the link using the dropdown</p><p>menu on the right.</p><p>PLEASE NOTE: Supported with bootloader versions 4.0 and earlier</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Erase settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="resetButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Reset the system.
|
|
||||||
(Only enabled if telemetry link is established, either
|
|
||||||
through serial or USB)</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="rescueButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Start a guided procedure to manually
|
|
||||||
recover a system which does not boot.
|
recover a system which does not boot.
|
||||||
|
|
||||||
Rescue is possible in USB mode only.</string>
|
Rescue is possible in USB mode only.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Rescue</string>
|
<string>Rescue</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<widget class="QPushButton" name="eraseBootButton">
|
||||||
<property name="orientation">
|
<property name="enabled">
|
||||||
<enum>Qt::Horizontal</enum>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="toolTip">
|
||||||
<size>
|
<string><html><head/><body><p>Reboot the board and clear its settings memory.</p><p> Useful if the board cannot boot properly.</p><p> Blue led starts blinking quick for 20-30 seconds than the board will start normally</p><p><br/></p><p>If telemetry is not running, select the link using the dropdown</p><p>menu on the right.</p><p>PLEASE NOTE: Supported with bootloader versions 4.0 and earlier</p></body></html></string>
|
||||||
<width>40</width>
|
</property>
|
||||||
<height>20</height>
|
<property name="text">
|
||||||
</size>
|
<string>Erase settings</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="telemetryLink">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="toolTip">
|
<property name="orientation">
|
||||||
<string>When telemetry is not connected, select the communication
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="telemetryLink">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>When telemetry is not connected, select the communication
|
||||||
method using this combo box.
|
method using this combo box.
|
||||||
|
|
||||||
You can use this to force a communication channel when doing
|
You can use this to force a communication channel when doing
|
||||||
a "Boot" (button on the left). It is updated automatically when
|
a "Boot" (button on the left). It is updated automatically when
|
||||||
halting a running board.</string>
|
halting a running board.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="refreshPorts">
|
<widget class="QToolButton" name="refreshPorts">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Refresh the list of serial ports</string>
|
<string>Refresh the list of serial ports</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="boardStatus">
|
<widget class="QLabel" name="boardStatus">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Running</string>
|
<string>Running</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pbHelp">
|
<widget class="QPushButton" name="pbHelp">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../coreplugin/core.qrc">
|
<iconset resource="../coreplugin/core.qrc">
|
||||||
<normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset>
|
<normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
<width>30</width>
|
<width>30</width>
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
</layout>
|
||||||
<widget class="QSplitter" name="splitter">
|
</widget>
|
||||||
<property name="orientation">
|
</item>
|
||||||
<enum>Qt::Vertical</enum>
|
<item>
|
||||||
</property>
|
<widget class="QGroupBox" name="autoUpdateGroupBox">
|
||||||
<widget class="QTabWidget" name="systemElements">
|
<property name="title">
|
||||||
<property name="currentIndex">
|
<string>Auto update</string>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<widget class="QWidget" name="defaultTab">
|
<item row="1" column="1">
|
||||||
<attribute name="title">
|
<widget class="QPushButton" name="autoUpdateOkButton">
|
||||||
<string>Mainboard</string>
|
<property name="text">
|
||||||
</attribute>
|
<string>OK</string>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<widget class="QTextEdit" name="textEdit">
|
</item>
|
||||||
<property name="html">
|
<item row="1" column="0">
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<widget class="QProgressBar" name="autoUpdateProgressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="textVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="autoUpdateLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Progress</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSplitter" name="splitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QTabWidget" name="systemElements">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="defaultTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Mainboard</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="textEdit">
|
||||||
|
<property name="html">
|
||||||
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">To upgrade the firmware in your boards, proceed as follows:</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">To upgrade the firmware in your boards,</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">press Auto Update and follow instructions</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">or</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">proceed as follows:</span></p>
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Connect telemetry</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Connect telemetry</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Once telemetry is running, press &quot;Halt&quot; above</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Once telemetry is running, press &quot;Halt&quot; above</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You will get a list of devices.</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You will get a list of devices.</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You can then upload/download to/from each board as you wish</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You can then upload/download to/from each board as you wish</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You can resume operations by pressing &quot;Boot&quot;</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- You can resume operations by pressing &quot;Boot&quot;</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QTextBrowser" name="textBrowser">
|
||||||
</layout>
|
<property name="horizontalScrollBarPolicy">
|
||||||
</widget>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QTextBrowser" name="textBrowser">
|
<property name="html">
|
||||||
<property name="horizontalScrollBarPolicy">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="html">
|
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -60,6 +60,11 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
|||||||
connect(cm, SIGNAL(deviceConnected(QIODevice *)), this, SLOT(onPhisicalHWConnect()));
|
connect(cm, SIGNAL(deviceConnected(QIODevice *)), this, SLOT(onPhisicalHWConnect()));
|
||||||
getSerialPorts();
|
getSerialPorts();
|
||||||
|
|
||||||
|
m_config->autoUpdateButton->setEnabled(autoUpdateCapable());
|
||||||
|
connect(m_config->autoUpdateButton, SIGNAL(clicked()), this, SLOT(startAutoUpdate()));
|
||||||
|
connect(m_config->autoUpdateOkButton, SIGNAL(clicked()), this, SLOT(closeAutoUpdate()));
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(false);
|
||||||
|
|
||||||
QIcon rbi;
|
QIcon rbi;
|
||||||
rbi.addFile(QString(":uploader/images/view-refresh.svg"));
|
rbi.addFile(QString(":uploader/images/view-refresh.svg"));
|
||||||
m_config->refreshPorts->setIcon(rbi);
|
m_config->refreshPorts->setIcon(rbi);
|
||||||
@ -816,6 +821,67 @@ void UploaderGadgetWidget::downloadEnded(bool succeed)
|
|||||||
m_config->rescueButton->setEnabled(true);
|
m_config->rescueButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::startAutoUpdate()
|
||||||
|
{
|
||||||
|
m_config->buttonFrame->setEnabled(false);
|
||||||
|
m_config->splitter->setEnabled(false);
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(true);
|
||||||
|
m_config->autoUpdateOkButton->setEnabled(false);
|
||||||
|
connect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||||
|
autoUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::finishAutoUpdate()
|
||||||
|
{
|
||||||
|
disconnect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||||
|
m_config->autoUpdateOkButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::closeAutoUpdate()
|
||||||
|
{
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(false);
|
||||||
|
m_config->buttonFrame->setEnabled(true);
|
||||||
|
m_config->splitter->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value)
|
||||||
|
{
|
||||||
|
switch (status) {
|
||||||
|
case uploader::WAITING_DISCONNECT:
|
||||||
|
m_config->autoUpdateLabel->setText("Waiting for all OpenPilot boards to be disconnected from USB.");
|
||||||
|
break;
|
||||||
|
case uploader::WAITING_CONNECT:
|
||||||
|
m_config->autoUpdateLabel->setText("Please connect the OpenPilot board to the USB port.");
|
||||||
|
m_config->autoUpdateProgressBar->setValue(value.toInt());
|
||||||
|
break;
|
||||||
|
case uploader::JUMP_TO_BL:
|
||||||
|
m_config->autoUpdateProgressBar->setValue(0);
|
||||||
|
m_config->autoUpdateLabel->setText("Bringing the board into boot loader mode.");
|
||||||
|
break;
|
||||||
|
case uploader::LOADING_FW:
|
||||||
|
m_config->autoUpdateLabel->setText("Preparing to upload firmware to the board.");
|
||||||
|
break;
|
||||||
|
case uploader::UPLOADING_FW:
|
||||||
|
m_config->autoUpdateLabel->setText("Uploading firmware to the board.");
|
||||||
|
m_config->autoUpdateProgressBar->setValue(value.toInt());
|
||||||
|
break;
|
||||||
|
case uploader::UPLOADING_DESC:
|
||||||
|
m_config->autoUpdateLabel->setText("Uploading description of the new firmware to the board.");
|
||||||
|
break;
|
||||||
|
case uploader::BOOTING:
|
||||||
|
m_config->autoUpdateLabel->setText("Rebooting the board.");
|
||||||
|
break;
|
||||||
|
case uploader::SUCCESS:
|
||||||
|
m_config->autoUpdateLabel->setText("<font color='green'>Board was updated successfully, press OK to finish.</font>");
|
||||||
|
finishAutoUpdate();
|
||||||
|
break;
|
||||||
|
case uploader::FAILURE:
|
||||||
|
m_config->autoUpdateLabel->setText("<font color='red'>Something went wrong, you will have to manually upgrade the board. Press OK to continue.</font>");
|
||||||
|
finishAutoUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Update log entry
|
Update log entry
|
||||||
*/
|
*/
|
||||||
|
@ -118,6 +118,10 @@ private slots:
|
|||||||
void uploadEnded(bool succeed);
|
void uploadEnded(bool succeed);
|
||||||
void downloadStarted();
|
void downloadStarted();
|
||||||
void downloadEnded(bool succeed);
|
void downloadEnded(bool succeed);
|
||||||
|
void startAutoUpdate();
|
||||||
|
void finishAutoUpdate();
|
||||||
|
void closeAutoUpdate();
|
||||||
|
void autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UPLOADERGADGETWIDGET_H
|
#endif // UPLOADERGADGETWIDGET_H
|
||||||
|
4
make/.gitattributes
vendored
4
make/.gitattributes
vendored
@ -6,8 +6,6 @@
|
|||||||
*.py text eol=lf
|
*.py text eol=lf
|
||||||
*.sh text eol=lf
|
*.sh text eol=lf
|
||||||
|
|
||||||
/doxygen/*.cfg text eol=lf
|
/doxygen/* text eol=lf
|
||||||
/templates/firmware_info.c.template text eol=lf
|
|
||||||
/templates/gcs_version_info.h.template text eol=crlf
|
|
||||||
/templates/*.txt text eol=crlf
|
/templates/*.txt text eol=crlf
|
||||||
/uncrustify/*.cfg text eol=lf
|
/uncrustify/*.cfg text eol=lf
|
||||||
|
@ -133,10 +133,10 @@ endef
|
|||||||
define OPFW_TEMPLATE
|
define OPFW_TEMPLATE
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
$(1).firmware_info.c: $(1) $(ROOT_DIR)/make/templates/firmware_info.c.template FORCE
|
$(1).firmware_info.c: $(1) $(ROOT_DIR)/flight/templates/firmware_info.c.template FORCE
|
||||||
@$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@)
|
@$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@)
|
||||||
$(V1) $(VERSION_INFO) \
|
$(V1) $(VERSION_INFO) \
|
||||||
--template=$(ROOT_DIR)/make/templates/firmware_info.c.template \
|
--template=$(ROOT_DIR)/flight/templates/firmware_info.c.template \
|
||||||
--outfile=$$@ \
|
--outfile=$$@ \
|
||||||
--image=$(1) \
|
--image=$(1) \
|
||||||
--type=$(2) \
|
--type=$(2) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user