mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
Merge branch 'revo' into rm2
This commit is contained in:
commit
61f1140645
@ -434,7 +434,7 @@ int32_t PIOS_BMA180_Test()
|
|||||||
* @brief IRQ Handler. Read data from the BMA180 FIFO and push onto a local fifo.
|
* @brief IRQ Handler. Read data from the BMA180 FIFO and push onto a local fifo.
|
||||||
*/
|
*/
|
||||||
int32_t bma180_irqs = 0;
|
int32_t bma180_irqs = 0;
|
||||||
void PIOS_BMA180_IRQHandler(void)
|
bool PIOS_BMA180_IRQHandler(void)
|
||||||
{
|
{
|
||||||
bma180_irqs++;
|
bma180_irqs++;
|
||||||
|
|
||||||
@ -470,7 +470,8 @@ void PIOS_BMA180_IRQHandler(void)
|
|||||||
data.temperature = pios_bma180_dmabuf[7];
|
data.temperature = pios_bma180_dmabuf[7];
|
||||||
|
|
||||||
fifoBuf_putData(&dev->fifo, (uint8_t *) &data, sizeof(data));
|
fifoBuf_putData(&dev->fifo, (uint8_t *) &data, sizeof(data));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PIOS_INCLUDE_BMA180 */
|
#endif /* PIOS_INCLUDE_BMA180 */
|
||||||
|
@ -391,9 +391,11 @@ int32_t PIOS_HMC5883_Test(void)
|
|||||||
/**
|
/**
|
||||||
* @brief IRQ Handler
|
* @brief IRQ Handler
|
||||||
*/
|
*/
|
||||||
void PIOS_HMC5883_IRQHandler(void)
|
bool PIOS_HMC5883_IRQHandler(void)
|
||||||
{
|
{
|
||||||
pios_hmc5883_data_ready = true;
|
pios_hmc5883_data_ready = true
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PIOS_INCLUDE_HMC5883 */
|
#endif /* PIOS_INCLUDE_HMC5883 */
|
||||||
|
@ -353,7 +353,7 @@ uint8_t PIOS_L3GD20_Test(void)
|
|||||||
/**
|
/**
|
||||||
* @brief IRQ Handler. Read all the data from onboard buffer
|
* @brief IRQ Handler. Read all the data from onboard buffer
|
||||||
*/
|
*/
|
||||||
void PIOS_L3GD20_IRQHandler(void)
|
bool PIOS_L3GD20_IRQHandler(void)
|
||||||
{
|
{
|
||||||
l3gd20_irq++;
|
l3gd20_irq++;
|
||||||
|
|
||||||
@ -375,7 +375,10 @@ void PIOS_L3GD20_IRQHandler(void)
|
|||||||
memcpy((uint8_t *) &(data.gyro_x), &rec[1], 6);
|
memcpy((uint8_t *) &(data.gyro_x), &rec[1], 6);
|
||||||
data.temperature = PIOS_L3GD20_GetReg(PIOS_L3GD20_OUT_TEMP);
|
data.temperature = PIOS_L3GD20_GetReg(PIOS_L3GD20_OUT_TEMP);
|
||||||
|
|
||||||
xQueueSend(dev->queue, (void *) &data, 0);
|
portBASE_TYPE xHigherPriorityTaskWoken;
|
||||||
|
xQueueSendToBackFromISR(dev->queue, (void *) &data, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
|
return xHigherPriorityTaskWoken == pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* L3GD20 */
|
#endif /* L3GD20 */
|
||||||
|
@ -405,21 +405,21 @@ uint32_t mpu6000_interval_us;
|
|||||||
uint32_t mpu6000_time_us;
|
uint32_t mpu6000_time_us;
|
||||||
uint32_t mpu6000_transfer_size;
|
uint32_t mpu6000_transfer_size;
|
||||||
|
|
||||||
void PIOS_MPU6000_IRQHandler(void)
|
bool PIOS_MPU6000_IRQHandler(void)
|
||||||
{
|
{
|
||||||
static uint32_t timeval;
|
static uint32_t timeval;
|
||||||
mpu6000_interval_us = PIOS_DELAY_DiffuS(timeval);
|
mpu6000_interval_us = PIOS_DELAY_DiffuS(timeval);
|
||||||
timeval = PIOS_DELAY_GetRaw();
|
timeval = PIOS_DELAY_GetRaw();
|
||||||
|
|
||||||
if(!mpu6000_configured)
|
if(!mpu6000_configured)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
mpu6000_count = PIOS_MPU6000_FifoDepth();
|
mpu6000_count = PIOS_MPU6000_FifoDepth();
|
||||||
if(mpu6000_count < sizeof(struct pios_mpu6000_data))
|
if(mpu6000_count < sizeof(struct pios_mpu6000_data))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
if(PIOS_MPU6000_ClaimBus() != 0)
|
if(PIOS_MPU6000_ClaimBus() != 0)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
uint8_t mpu6000_send_buf[1+sizeof(struct pios_mpu6000_data)] = {PIOS_MPU6000_FIFO_REG | 0x80, 0, 0, 0, 0, 0, 0, 0, 0};
|
uint8_t mpu6000_send_buf[1+sizeof(struct pios_mpu6000_data)] = {PIOS_MPU6000_FIFO_REG | 0x80, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
uint8_t mpu6000_rec_buf[1+sizeof(struct pios_mpu6000_data)];
|
uint8_t mpu6000_rec_buf[1+sizeof(struct pios_mpu6000_data)];
|
||||||
@ -427,7 +427,7 @@ void PIOS_MPU6000_IRQHandler(void)
|
|||||||
if(PIOS_SPI_TransferBlock(dev->spi_id, &mpu6000_send_buf[0], &mpu6000_rec_buf[0], sizeof(mpu6000_send_buf), NULL) < 0) {
|
if(PIOS_SPI_TransferBlock(dev->spi_id, &mpu6000_send_buf[0], &mpu6000_rec_buf[0], sizeof(mpu6000_send_buf), NULL) < 0) {
|
||||||
PIOS_MPU6000_ReleaseBus();
|
PIOS_MPU6000_ReleaseBus();
|
||||||
mpu6000_fails++;
|
mpu6000_fails++;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIOS_MPU6000_ReleaseBus();
|
PIOS_MPU6000_ReleaseBus();
|
||||||
@ -438,15 +438,12 @@ void PIOS_MPU6000_IRQHandler(void)
|
|||||||
if (mpu6000_count >= (sizeof(data) * 2)) {
|
if (mpu6000_count >= (sizeof(data) * 2)) {
|
||||||
mpu6000_fifo_backup++;
|
mpu6000_fifo_backup++;
|
||||||
if(PIOS_MPU6000_ClaimBus() != 0)
|
if(PIOS_MPU6000_ClaimBus() != 0)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
uint8_t mpu6000_send_buf[1+sizeof(struct pios_mpu6000_data)] = {PIOS_MPU6000_FIFO_REG | 0x80, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
||||||
uint8_t mpu6000_rec_buf[1+sizeof(struct pios_mpu6000_data)];
|
|
||||||
|
|
||||||
if(PIOS_SPI_TransferBlock(dev->spi_id, &mpu6000_send_buf[0], &mpu6000_rec_buf[0], sizeof(mpu6000_send_buf), NULL) < 0) {
|
if(PIOS_SPI_TransferBlock(dev->spi_id, &mpu6000_send_buf[0], &mpu6000_rec_buf[0], sizeof(mpu6000_send_buf), NULL) < 0) {
|
||||||
PIOS_MPU6000_ReleaseBus();
|
PIOS_MPU6000_ReleaseBus();
|
||||||
mpu6000_fails++;
|
mpu6000_fails++;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIOS_MPU6000_ReleaseBus();
|
PIOS_MPU6000_ReleaseBus();
|
||||||
@ -510,12 +507,15 @@ void PIOS_MPU6000_IRQHandler(void)
|
|||||||
data.gyro_z = -(mpu6000_rec_buf[7] << 8 | mpu6000_rec_buf[8]);
|
data.gyro_z = -(mpu6000_rec_buf[7] << 8 | mpu6000_rec_buf[8]);
|
||||||
data.temperature = mpu6000_rec_buf[1] << 8 | mpu6000_rec_buf[2];
|
data.temperature = mpu6000_rec_buf[1] << 8 | mpu6000_rec_buf[2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xQueueSend(dev->queue, (void *) &data, 0);
|
portBASE_TYPE xHigherPriorityTaskWoken;
|
||||||
|
xQueueSendToBackFromISR(dev->queue, (void *) &data, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
mpu6000_irq++;
|
mpu6000_irq++;
|
||||||
|
|
||||||
mpu6000_time_us = PIOS_DELAY_DiffuS(timeval);
|
mpu6000_time_us = PIOS_DELAY_DiffuS(timeval);
|
||||||
|
|
||||||
|
return xHigherPriorityTaskWoken == pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,7 +149,7 @@ out_fail:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
static bool PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
||||||
{
|
{
|
||||||
uint8_t cfg_index = pios_exti_line_to_cfg_map[line_index];
|
uint8_t cfg_index = pios_exti_line_to_cfg_map[line_index];
|
||||||
|
|
||||||
@ -158,69 +158,133 @@ static void PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
|||||||
if (cfg_index > NELEMENTS(pios_exti_line_to_cfg_map) ||
|
if (cfg_index > NELEMENTS(pios_exti_line_to_cfg_map) ||
|
||||||
cfg_index == PIOS_EXTI_INVALID) {
|
cfg_index == PIOS_EXTI_INVALID) {
|
||||||
/* Unconfigured interrupt just fired! */
|
/* Unconfigured interrupt just fired! */
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pios_exti_cfg * cfg = &__start__exti + cfg_index;
|
struct pios_exti_cfg * cfg = &__start__exti + cfg_index;
|
||||||
cfg->vector();
|
return cfg->vector();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bind Interrupt Handlers */
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
#define PIOS_EXTI_HANDLE_LINE(line, woken) \
|
||||||
#define PIOS_EXTI_HANDLE_LINE(line) \
|
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
||||||
|
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
||||||
|
woken = PIOS_EXTI_generic_irq_handler(line) ? pdTRUE : woken; \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define PIOS_EXTI_HANDLE_LINE(line, woken) \
|
||||||
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
||||||
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
||||||
PIOS_EXTI_generic_irq_handler(line); \
|
PIOS_EXTI_generic_irq_handler(line); \
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Bind Interrupt Handlers */
|
||||||
|
|
||||||
static void PIOS_EXTI_0_irq_handler (void)
|
static void PIOS_EXTI_0_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(0);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(0, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI0_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_0_irq_handler")));
|
void EXTI0_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_0_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_1_irq_handler (void)
|
static void PIOS_EXTI_1_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(1);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(1, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI1_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_1_irq_handler")));
|
void EXTI1_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_1_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_2_irq_handler (void)
|
static void PIOS_EXTI_2_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(2);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(2, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI2_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_2_irq_handler")));
|
void EXTI2_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_2_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_3_irq_handler (void)
|
static void PIOS_EXTI_3_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(3);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(3, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI3_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_3_irq_handler")));
|
void EXTI3_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_3_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_4_irq_handler (void)
|
static void PIOS_EXTI_4_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(4);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(4, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI4_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_4_irq_handler")));
|
void EXTI4_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_4_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_9_5_irq_handler (void)
|
static void PIOS_EXTI_9_5_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(5);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
PIOS_EXTI_HANDLE_LINE(6);
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
PIOS_EXTI_HANDLE_LINE(7);
|
#else
|
||||||
PIOS_EXTI_HANDLE_LINE(8);
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
PIOS_EXTI_HANDLE_LINE(9);
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(5, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(6, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(7, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(8, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(9, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI9_5_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_9_5_irq_handler")));
|
void EXTI9_5_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_9_5_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_15_10_irq_handler (void)
|
static void PIOS_EXTI_15_10_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(10);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
PIOS_EXTI_HANDLE_LINE(11);
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
PIOS_EXTI_HANDLE_LINE(12);
|
#else
|
||||||
PIOS_EXTI_HANDLE_LINE(13);
|
bool xHigherPriorityTaskWoken; // dummy variable
|
||||||
PIOS_EXTI_HANDLE_LINE(14);
|
#endif
|
||||||
PIOS_EXTI_HANDLE_LINE(15);
|
PIOS_EXTI_HANDLE_LINE(10, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(11, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(12, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(13, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(14, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(15, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI15_10_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_15_10_irq_handler")));
|
void EXTI15_10_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_15_10_irq_handler")));
|
||||||
|
|
||||||
|
@ -321,7 +321,10 @@ RESULT PIOS_USB_CDC_SetControlLineState(void)
|
|||||||
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
||||||
|
|
||||||
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
||||||
PIOS_Assert(valid);
|
if (!valid) {
|
||||||
|
/* No CDC interface is configured */
|
||||||
|
return USB_UNSUPPORT;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t wValue0 = pInformation->USBwValue0;
|
uint8_t wValue0 = pInformation->USBwValue0;
|
||||||
uint8_t wValue1 = pInformation->USBwValue1;
|
uint8_t wValue1 = pInformation->USBwValue1;
|
||||||
@ -338,14 +341,25 @@ static struct usb_cdc_line_coding line_coding = {
|
|||||||
.bDataBits = 8,
|
.bDataBits = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
RESULT PIOS_USB_CDC_SetLineCoding(void)
|
uint8_t *PIOS_USB_CDC_SetLineCoding(uint16_t Length)
|
||||||
{
|
{
|
||||||
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
||||||
|
|
||||||
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
||||||
PIOS_Assert(valid);
|
if (!valid) {
|
||||||
|
/* No CDC interface is configured */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return USB_SUCCESS;
|
if (Length == 0) {
|
||||||
|
/* Report the number of bytes we're prepared to consume */
|
||||||
|
pInformation->Ctrl_Info.Usb_wLength = sizeof(line_coding);
|
||||||
|
pInformation->Ctrl_Info.Usb_rLength = sizeof(line_coding);
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
/* Give out a pointer to the data struct */
|
||||||
|
return ((uint8_t *) &line_coding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length)
|
const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length)
|
||||||
@ -353,7 +367,10 @@ const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length)
|
|||||||
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
struct pios_usb_cdc_dev * usb_cdc_dev = (struct pios_usb_cdc_dev *)pios_usb_cdc_id;
|
||||||
|
|
||||||
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
bool valid = PIOS_USB_CDC_validate(usb_cdc_dev);
|
||||||
PIOS_Assert(valid);
|
if (!valid) {
|
||||||
|
/* No CDC interface is configured */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (Length == 0) {
|
if (Length == 0) {
|
||||||
pInformation->Ctrl_Info.Usb_wLength = sizeof(line_coding);
|
pInformation->Ctrl_Info.Usb_wLength = sizeof(line_coding);
|
||||||
|
@ -293,13 +293,16 @@ static void PIOS_USBHOOK_Status_Out(void)
|
|||||||
* Output : None.
|
* Output : None.
|
||||||
* Return : USB_UNSUPPORT or USB_SUCCESS.
|
* Return : USB_UNSUPPORT or USB_SUCCESS.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
extern uint8_t *PIOS_USB_CDC_SetLineCoding(uint16_t Length);
|
||||||
extern const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length);
|
extern const uint8_t *PIOS_USB_CDC_GetLineCoding(uint16_t Length);
|
||||||
|
|
||||||
static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
||||||
{
|
{
|
||||||
const uint8_t *(*CopyRoutine) (uint16_t);
|
uint8_t *(*CopyOutRoutine) (uint16_t);
|
||||||
|
const uint8_t *(*CopyInRoutine) (uint16_t);
|
||||||
|
|
||||||
CopyRoutine = NULL;
|
CopyInRoutine = NULL;
|
||||||
|
CopyOutRoutine = NULL;
|
||||||
|
|
||||||
switch (Type_Recipient) {
|
switch (Type_Recipient) {
|
||||||
case (STANDARD_REQUEST | INTERFACE_RECIPIENT):
|
case (STANDARD_REQUEST | INTERFACE_RECIPIENT):
|
||||||
@ -313,10 +316,10 @@ static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
|||||||
case GET_DESCRIPTOR:
|
case GET_DESCRIPTOR:
|
||||||
switch (pInformation->USBwValue1) {
|
switch (pInformation->USBwValue1) {
|
||||||
case USB_DESC_TYPE_REPORT:
|
case USB_DESC_TYPE_REPORT:
|
||||||
CopyRoutine = PIOS_USBHOOK_GetReportDescriptor;
|
CopyInRoutine = PIOS_USBHOOK_GetReportDescriptor;
|
||||||
break;
|
break;
|
||||||
case USB_DESC_TYPE_HID:
|
case USB_DESC_TYPE_HID:
|
||||||
CopyRoutine = PIOS_USBHOOK_GetHIDDescriptor;
|
CopyInRoutine = PIOS_USBHOOK_GetHIDDescriptor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -332,7 +335,7 @@ static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
|||||||
#endif
|
#endif
|
||||||
switch (RequestNo) {
|
switch (RequestNo) {
|
||||||
case USB_HID_REQ_GET_PROTOCOL:
|
case USB_HID_REQ_GET_PROTOCOL:
|
||||||
CopyRoutine = PIOS_USBHOOK_GetProtocolValue;
|
CopyInRoutine = PIOS_USBHOOK_GetProtocolValue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,8 +343,11 @@ static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
|||||||
#if defined(PIOS_INCLUDE_USB_CDC)
|
#if defined(PIOS_INCLUDE_USB_CDC)
|
||||||
case 0: /* CDC Call Control Interface */
|
case 0: /* CDC Call Control Interface */
|
||||||
switch (RequestNo) {
|
switch (RequestNo) {
|
||||||
|
case USB_CDC_REQ_SET_LINE_CODING:
|
||||||
|
CopyOutRoutine = PIOS_USB_CDC_SetLineCoding;
|
||||||
|
break;
|
||||||
case USB_CDC_REQ_GET_LINE_CODING:
|
case USB_CDC_REQ_GET_LINE_CODING:
|
||||||
//CopyRoutine = PIOS_USB_CDC_GetLineCoding;
|
CopyInRoutine = PIOS_USB_CDC_GetLineCoding;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,13 +365,27 @@ static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CopyRoutine == NULL) {
|
/* No registered copy routine */
|
||||||
|
if ((CopyInRoutine == NULL) && (CopyOutRoutine == NULL)) {
|
||||||
return USB_UNSUPPORT;
|
return USB_UNSUPPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
pInformation->Ctrl_Info.CopyDataIn = CopyRoutine;
|
/* Registered copy in AND copy out routine */
|
||||||
pInformation->Ctrl_Info.Usb_wOffset = 0;
|
if ((CopyInRoutine != NULL) && (CopyOutRoutine != NULL)) {
|
||||||
(*CopyRoutine) (0);
|
/* This should never happen */
|
||||||
|
return USB_UNSUPPORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CopyInRoutine != NULL) {
|
||||||
|
pInformation->Ctrl_Info.CopyDataIn = CopyInRoutine;
|
||||||
|
pInformation->Ctrl_Info.Usb_wOffset = 0;
|
||||||
|
(*CopyInRoutine) (0);
|
||||||
|
} else if (CopyOutRoutine != NULL) {
|
||||||
|
pInformation->Ctrl_Info.CopyDataOut = CopyOutRoutine;
|
||||||
|
pInformation->Ctrl_Info.Usb_rOffset = 0;
|
||||||
|
(*CopyOutRoutine) (0);
|
||||||
|
}
|
||||||
|
|
||||||
return USB_SUCCESS;
|
return USB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +397,6 @@ static RESULT PIOS_USBHOOK_Data_Setup(uint8_t RequestNo)
|
|||||||
* Return : USB_UNSUPPORT or USB_SUCCESS.
|
* Return : USB_UNSUPPORT or USB_SUCCESS.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern RESULT PIOS_USB_CDC_SetControlLineState(void);
|
extern RESULT PIOS_USB_CDC_SetControlLineState(void);
|
||||||
extern RESULT PIOS_USB_CDC_SetLineCoding(void);
|
|
||||||
|
|
||||||
static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo)
|
static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo)
|
||||||
{
|
{
|
||||||
@ -400,9 +419,6 @@ static RESULT PIOS_USBHOOK_NoData_Setup(uint8_t RequestNo)
|
|||||||
#if defined(PIOS_INCLUDE_USB_CDC)
|
#if defined(PIOS_INCLUDE_USB_CDC)
|
||||||
case 0: /* CDC Call Control Interface */
|
case 0: /* CDC Call Control Interface */
|
||||||
switch (RequestNo) {
|
switch (RequestNo) {
|
||||||
case USB_CDC_REQ_SET_LINE_CODING:
|
|
||||||
return PIOS_USB_CDC_SetLineCoding();
|
|
||||||
break;
|
|
||||||
case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
|
case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
|
||||||
return PIOS_USB_CDC_SetControlLineState();
|
return PIOS_USB_CDC_SetControlLineState();
|
||||||
break;
|
break;
|
||||||
|
@ -149,7 +149,7 @@ out_fail:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
static bool PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
||||||
{
|
{
|
||||||
uint8_t cfg_index = pios_exti_line_to_cfg_map[line_index];
|
uint8_t cfg_index = pios_exti_line_to_cfg_map[line_index];
|
||||||
|
|
||||||
@ -158,69 +158,133 @@ static void PIOS_EXTI_generic_irq_handler(uint8_t line_index)
|
|||||||
if (cfg_index > NELEMENTS(pios_exti_line_to_cfg_map) ||
|
if (cfg_index > NELEMENTS(pios_exti_line_to_cfg_map) ||
|
||||||
cfg_index == PIOS_EXTI_INVALID) {
|
cfg_index == PIOS_EXTI_INVALID) {
|
||||||
/* Unconfigured interrupt just fired! */
|
/* Unconfigured interrupt just fired! */
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pios_exti_cfg * cfg = &__start__exti + cfg_index;
|
struct pios_exti_cfg * cfg = &__start__exti + cfg_index;
|
||||||
cfg->vector();
|
return cfg->vector();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bind Interrupt Handlers */
|
/* Bind Interrupt Handlers */
|
||||||
|
|
||||||
#define PIOS_EXTI_HANDLE_LINE(line) \
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
#define PIOS_EXTI_HANDLE_LINE(line, woken) \
|
||||||
|
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
||||||
|
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
||||||
|
woken = PIOS_EXTI_generic_irq_handler(line) ? pdTRUE : woken; \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define PIOS_EXTI_HANDLE_LINE(line, woken) \
|
||||||
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
if (EXTI_GetITStatus(EXTI_Line##line) != RESET) { \
|
||||||
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
EXTI_ClearITPendingBit(EXTI_Line##line); \
|
||||||
PIOS_EXTI_generic_irq_handler(line); \
|
PIOS_EXTI_generic_irq_handler(line); \
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void PIOS_EXTI_0_irq_handler (void)
|
static void PIOS_EXTI_0_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(0);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken;
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(0, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI0_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_0_irq_handler")));
|
void EXTI0_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_0_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_1_irq_handler (void)
|
static void PIOS_EXTI_1_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(1);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken;
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(1, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI1_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_1_irq_handler")));
|
void EXTI1_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_1_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_2_irq_handler (void)
|
static void PIOS_EXTI_2_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(2);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken;
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(2, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI2_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_2_irq_handler")));
|
void EXTI2_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_2_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_3_irq_handler (void)
|
static void PIOS_EXTI_3_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(3);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken;
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(3, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI3_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_3_irq_handler")));
|
void EXTI3_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_3_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_4_irq_handler (void)
|
static void PIOS_EXTI_4_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(4);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
#else
|
||||||
|
bool xHigherPriorityTaskWoken;
|
||||||
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(4, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI4_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_4_irq_handler")));
|
void EXTI4_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_4_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_9_5_irq_handler (void)
|
static void PIOS_EXTI_9_5_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(5);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
PIOS_EXTI_HANDLE_LINE(6);
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
PIOS_EXTI_HANDLE_LINE(7);
|
#else
|
||||||
PIOS_EXTI_HANDLE_LINE(8);
|
bool xHigherPriorityTaskWoken;
|
||||||
PIOS_EXTI_HANDLE_LINE(9);
|
#endif
|
||||||
|
PIOS_EXTI_HANDLE_LINE(5, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(6, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(7, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(8, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(9, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI9_5_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_9_5_irq_handler")));
|
void EXTI9_5_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_9_5_irq_handler")));
|
||||||
|
|
||||||
static void PIOS_EXTI_15_10_irq_handler (void)
|
static void PIOS_EXTI_15_10_irq_handler (void)
|
||||||
{
|
{
|
||||||
PIOS_EXTI_HANDLE_LINE(10);
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
PIOS_EXTI_HANDLE_LINE(11);
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
PIOS_EXTI_HANDLE_LINE(12);
|
#else
|
||||||
PIOS_EXTI_HANDLE_LINE(13);
|
bool xHigherPriorityTaskWoken;
|
||||||
PIOS_EXTI_HANDLE_LINE(14);
|
#endif
|
||||||
PIOS_EXTI_HANDLE_LINE(15);
|
PIOS_EXTI_HANDLE_LINE(10, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(11, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(12, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(13, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(14, xHigherPriorityTaskWoken);
|
||||||
|
PIOS_EXTI_HANDLE_LINE(15, xHigherPriorityTaskWoken);
|
||||||
|
#ifdef PIOS_INCLUDE_FREERTOS
|
||||||
|
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void EXTI15_10_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_15_10_irq_handler")));
|
void EXTI15_10_IRQHandler(void) __attribute__ ((alias ("PIOS_EXTI_15_10_irq_handler")));
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ extern float PIOS_BMA180_GetScale();
|
|||||||
extern int32_t PIOS_BMA180_ReadFifo(struct pios_bma180_data * buffer);
|
extern int32_t PIOS_BMA180_ReadFifo(struct pios_bma180_data * buffer);
|
||||||
extern int32_t PIOS_BMA180_ReadAccels(struct pios_bma180_data * data);
|
extern int32_t PIOS_BMA180_ReadAccels(struct pios_bma180_data * data);
|
||||||
extern int32_t PIOS_BMA180_Test();
|
extern int32_t PIOS_BMA180_Test();
|
||||||
extern void PIOS_BMA180_IRQHandler();
|
extern bool PIOS_BMA180_IRQHandler();
|
||||||
|
|
||||||
#endif /* PIOS_BMA180_H */
|
#endif /* PIOS_BMA180_H */
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include <pios_stm32.h>
|
#include <pios_stm32.h>
|
||||||
|
|
||||||
struct pios_exti_cfg {
|
struct pios_exti_cfg {
|
||||||
void (* vector)(void);
|
bool (* vector)(void);
|
||||||
uint32_t line; /* use EXTI_LineN macros */
|
uint32_t line; /* use EXTI_LineN macros */
|
||||||
struct stm32_gpio pin;
|
struct stm32_gpio pin;
|
||||||
struct stm32_irq irq;
|
struct stm32_irq irq;
|
||||||
|
@ -107,7 +107,7 @@ extern bool PIOS_HMC5883_NewDataAvailable(void);
|
|||||||
extern int32_t PIOS_HMC5883_ReadMag(int16_t out[3]);
|
extern int32_t PIOS_HMC5883_ReadMag(int16_t out[3]);
|
||||||
extern uint8_t PIOS_HMC5883_ReadID(uint8_t out[4]);
|
extern uint8_t PIOS_HMC5883_ReadID(uint8_t out[4]);
|
||||||
extern int32_t PIOS_HMC5883_Test(void);
|
extern int32_t PIOS_HMC5883_Test(void);
|
||||||
extern void PIOS_HMC5883_IRQHandler();
|
bool void PIOS_HMC5883_IRQHandler();
|
||||||
#endif /* PIOS_HMC5883_H */
|
#endif /* PIOS_HMC5883_H */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,7 +141,7 @@ extern int32_t PIOS_L3GD20_SetRange(enum pios_l3gd20_range range);
|
|||||||
extern float PIOS_L3GD20_GetScale();
|
extern float PIOS_L3GD20_GetScale();
|
||||||
extern int32_t PIOS_L3GD20_ReadID();
|
extern int32_t PIOS_L3GD20_ReadID();
|
||||||
extern uint8_t PIOS_L3GD20_Test();
|
extern uint8_t PIOS_L3GD20_Test();
|
||||||
extern void PIOS_L3GD20_IRQHandler();
|
bool void PIOS_L3GD20_IRQHandler();
|
||||||
|
|
||||||
#endif /* PIOS_L3GD20_H */
|
#endif /* PIOS_L3GD20_H */
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ extern int32_t PIOS_MPU6000_ReadID();
|
|||||||
extern int32_t PIOS_MPU6000_Test();
|
extern int32_t PIOS_MPU6000_Test();
|
||||||
extern float PIOS_MPU6000_GetScale();
|
extern float PIOS_MPU6000_GetScale();
|
||||||
extern float PIOS_MPU6000_GetAccelScale();
|
extern float PIOS_MPU6000_GetAccelScale();
|
||||||
extern void PIOS_MPU6000_IRQHandler(void);
|
extern bool PIOS_MPU6000_IRQHandler(void);
|
||||||
|
|
||||||
#endif /* PIOS_MPU6000_H */
|
#endif /* PIOS_MPU6000_H */
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ enum usb_cdc_requests {
|
|||||||
USB_CDC_REQ_SET_LINE_CODING = 0x20,
|
USB_CDC_REQ_SET_LINE_CODING = 0x20,
|
||||||
USB_CDC_REQ_GET_LINE_CODING = 0x21,
|
USB_CDC_REQ_GET_LINE_CODING = 0x21,
|
||||||
|
|
||||||
USB_CDC_REQ_SET_CONTROL_LINE_STATE = 0x23,
|
USB_CDC_REQ_SET_CONTROL_LINE_STATE = 0x22,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct usb_cdc_header_func_desc {
|
struct usb_cdc_header_func_desc {
|
||||||
|
@ -38,37 +38,40 @@
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
HomeLocationUtil::HomeLocationUtil()
|
HomeLocationUtil::HomeLocationUtil()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get local magnetic field
|
||||||
|
* @param[in] LLA The longitude-latitude-altitude coordinate to compute the magnetic field at
|
||||||
|
* @param[out] Be The resulting magnetic field at that location and time in [mGau](?)
|
||||||
|
* @returns 0 if successful, -1 otherwise.
|
||||||
|
*/
|
||||||
|
int HomeLocationUtil::getDetails(double LLA[3], double Be[3])
|
||||||
{
|
{
|
||||||
// Initialize();
|
// *************
|
||||||
}
|
// check input parms
|
||||||
|
|
||||||
// input params: LLA
|
double latitude = LLA[0];
|
||||||
//
|
double longitude = LLA[1];
|
||||||
// output params: ECEF, RNE and Be
|
double altitude = LLA[2];
|
||||||
int HomeLocationUtil::getDetails(double LLA[3], double Be[3])
|
|
||||||
{
|
|
||||||
// *************
|
|
||||||
// check input parms
|
|
||||||
|
|
||||||
double latitude = LLA[0];
|
if (latitude != latitude) return -1; // prevent nan error
|
||||||
double longitude = LLA[1];
|
if (longitude != longitude) return -2; // prevent nan error
|
||||||
double altitude = LLA[2];
|
if (altitude != altitude) return -3; // prevent nan error
|
||||||
|
|
||||||
if (latitude != latitude) return -1; // prevent nan error
|
if (latitude < -90 || latitude > 90) return -4; // range checking
|
||||||
if (longitude != longitude) return -2; // prevent nan error
|
if (longitude < -180 || longitude > 180) return -5; // range checking
|
||||||
if (altitude != altitude) return -3; // prevent nan error
|
|
||||||
|
|
||||||
if (latitude < -90 || latitude > 90) return -4; // range checking
|
// *************
|
||||||
if (longitude < -180 || longitude > 180) return -5; // range checking
|
|
||||||
|
|
||||||
// *************
|
QDateTime dt = QDateTime::currentDateTime().toUTC();
|
||||||
|
|
||||||
QDateTime dt = QDateTime::currentDateTime().toUTC();
|
//Fetch world magnetic model
|
||||||
|
Q_ASSERT(WorldMagModel().GetMagVector(LLA, dt.date().month(), dt.date().day(), dt.date().year(), Be) >= 0);
|
||||||
|
|
||||||
Q_ASSERT(WorldMagModel().GetMagVector(LLA, dt.date().month(), dt.date().day(), dt.date().year(), Be) >= 0);
|
return 0; // OK
|
||||||
|
|
||||||
return 0; // OK
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
#include "uavtalk/telemetrymanager.h"
|
#include "uavtalk/telemetrymanager.h"
|
||||||
#include "uavobject.h"
|
#include "uavobject.h"
|
||||||
#include "uavobjectmanager.h"
|
|
||||||
|
|
||||||
#include "positionactual.h"
|
#include "positionactual.h"
|
||||||
#include "homelocation.h"
|
#include "homelocation.h"
|
||||||
@ -568,6 +567,7 @@ void OPMapGadgetWidget::updatePosition()
|
|||||||
VelocityActual *velocityActualObj = VelocityActual::GetInstance(obm);
|
VelocityActual *velocityActualObj = VelocityActual::GetInstance(obm);
|
||||||
Gyros *gyrosObj = Gyros::GetInstance(obm);
|
Gyros *gyrosObj = Gyros::GetInstance(obm);
|
||||||
|
|
||||||
|
Q_ASSERT(attitudeActualObj);
|
||||||
Q_ASSERT(positionActualObj);
|
Q_ASSERT(positionActualObj);
|
||||||
Q_ASSERT(velocityActualObj);
|
Q_ASSERT(velocityActualObj);
|
||||||
Q_ASSERT(gyrosObj);
|
Q_ASSERT(gyrosObj);
|
||||||
@ -892,7 +892,7 @@ void OPMapGadgetWidget::setHome(QPointF pos)
|
|||||||
/**
|
/**
|
||||||
Sets the home position on the map widget
|
Sets the home position on the map widget
|
||||||
*/
|
*/
|
||||||
void OPMapGadgetWidget::setHome(internals::PointLatLng pos_lat_lon,double altitude)
|
void OPMapGadgetWidget::setHome(internals::PointLatLng pos_lat_lon, double altitude)
|
||||||
{
|
{
|
||||||
if (!m_widget || !m_map)
|
if (!m_widget || !m_map)
|
||||||
return;
|
return;
|
||||||
@ -914,13 +914,13 @@ void OPMapGadgetWidget::setHome(internals::PointLatLng pos_lat_lon,double altitu
|
|||||||
if (longitude > 180) longitude = 180;
|
if (longitude > 180) longitude = 180;
|
||||||
else
|
else
|
||||||
if (longitude < -180) longitude = -180;
|
if (longitude < -180) longitude = -180;
|
||||||
else if(altitude != altitude) altitude=0;
|
|
||||||
|
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
m_home_position.coord = internals::PointLatLng(latitude, longitude);
|
m_home_position.coord = internals::PointLatLng(latitude, longitude);
|
||||||
|
m_home_position.altitude = altitude;
|
||||||
|
|
||||||
m_map->Home->SetCoord(m_home_position.coord);
|
m_map->Home->SetCoord(m_home_position.coord);
|
||||||
m_map->Home->SetAltitude(altitude);
|
m_map->Home->SetAltitude(altitude);
|
||||||
m_map->Home->RefreshPos();
|
m_map->Home->RefreshPos();
|
||||||
|
|
||||||
@ -1602,7 +1602,15 @@ void OPMapGadgetWidget::onSetHomeAct_triggered()
|
|||||||
if (!m_widget || !m_map)
|
if (!m_widget || !m_map)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setHome(m_context_menu_lat_lon,0);
|
float altitude=0;
|
||||||
|
bool ok;
|
||||||
|
|
||||||
|
//Get desired HomeLocation altitude from dialog box.
|
||||||
|
//TODO: Populate box with altitude already in HomeLocation UAVO
|
||||||
|
altitude = QInputDialog::getDouble(this, tr("Set home altitude"),
|
||||||
|
tr("In [m], referenced to WGS84:"), altitude, -100, 100000, 2, &ok);
|
||||||
|
|
||||||
|
setHome(m_context_menu_lat_lon, altitude);
|
||||||
|
|
||||||
setHomeLocationObject(); // update the HomeLocation UAVObject
|
setHomeLocationObject(); // update the HomeLocation UAVObject
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,10 @@
|
|||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <objectpersistence.h>
|
#include <objectpersistence.h>
|
||||||
#include <firmwareiapobj.h>
|
|
||||||
|
#include "firmwareiapobj.h"
|
||||||
|
#include "homelocation.h"
|
||||||
|
#include "gpsposition.h"
|
||||||
|
|
||||||
// ******************************
|
// ******************************
|
||||||
// constructor/destructor
|
// constructor/destructor
|
||||||
@ -48,6 +51,18 @@ UAVObjectUtilManager::UAVObjectUtilManager()
|
|||||||
failureTimer.setSingleShot(true);
|
failureTimer.setSingleShot(true);
|
||||||
failureTimer.setInterval(1000);
|
failureTimer.setInterval(1000);
|
||||||
connect(&failureTimer, SIGNAL(timeout()),this,SLOT(objectPersistenceOperationFailed()));
|
connect(&failureTimer, SIGNAL(timeout()),this,SLOT(objectPersistenceOperationFailed()));
|
||||||
|
|
||||||
|
pm = NULL;
|
||||||
|
obm = NULL;
|
||||||
|
obum = NULL;
|
||||||
|
|
||||||
|
pm = ExtensionSystem::PluginManager::instance();
|
||||||
|
if (pm)
|
||||||
|
{
|
||||||
|
obm = pm->getObject<UAVObjectManager>();
|
||||||
|
obum = pm->getObject<UAVObjectUtilManager>();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UAVObjectUtilManager::~UAVObjectUtilManager()
|
UAVObjectUtilManager::~UAVObjectUtilManager()
|
||||||
@ -67,10 +82,8 @@ UAVObjectUtilManager::~UAVObjectUtilManager()
|
|||||||
|
|
||||||
|
|
||||||
UAVObjectManager* UAVObjectUtilManager::getObjectManager() {
|
UAVObjectManager* UAVObjectUtilManager::getObjectManager() {
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
Q_ASSERT(obm);
|
||||||
UAVObjectManager * objMngr = pm->getObject<UAVObjectManager>();
|
return obm;
|
||||||
Q_ASSERT(objMngr);
|
|
||||||
return objMngr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +120,7 @@ void UAVObjectUtilManager::saveNextObject()
|
|||||||
|
|
||||||
// Get next object from the queue
|
// Get next object from the queue
|
||||||
UAVObject* obj = queue.head();
|
UAVObject* obj = queue.head();
|
||||||
qDebug() << "Request board to save object " << obj->getName();
|
qDebug() << "Send save object request to board " << obj->getName();
|
||||||
|
|
||||||
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) );
|
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) );
|
||||||
connect(objper, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool)));
|
connect(objper, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool)));
|
||||||
@ -233,16 +246,7 @@ FirmwareIAPObj::DataFields UAVObjectUtilManager::getFirmwareIap()
|
|||||||
{
|
{
|
||||||
FirmwareIAPObj::DataFields dummy;
|
FirmwareIAPObj::DataFields dummy;
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
FirmwareIAPObj *firmwareIap = FirmwareIAPObj::GetInstance(obm);
|
||||||
Q_ASSERT(pm);
|
|
||||||
if (!pm)
|
|
||||||
return dummy;
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
Q_ASSERT(om);
|
|
||||||
if (!om)
|
|
||||||
return dummy;
|
|
||||||
|
|
||||||
FirmwareIAPObj *firmwareIap = FirmwareIAPObj::GetInstance(om);
|
|
||||||
Q_ASSERT(firmwareIap);
|
Q_ASSERT(firmwareIap);
|
||||||
if (!firmwareIap)
|
if (!firmwareIap)
|
||||||
return dummy;
|
return dummy;
|
||||||
@ -306,76 +310,47 @@ QByteArray UAVObjectUtilManager::getBoardDescription()
|
|||||||
|
|
||||||
int UAVObjectUtilManager::setHomeLocation(double LLA[3], bool save_to_sdcard)
|
int UAVObjectUtilManager::setHomeLocation(double LLA[3], bool save_to_sdcard)
|
||||||
{
|
{
|
||||||
double Be[3];
|
double Be[3];
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
Q_ASSERT (Utils::HomeLocationUtil().getDetails(LLA, Be) >= 0);
|
||||||
|
|
||||||
Q_ASSERT (Utils::HomeLocationUtil().getDetails(LLA, Be) >= 0);
|
// ******************
|
||||||
|
// save the new settings
|
||||||
|
|
||||||
// ******************
|
HomeLocation *homeLocation = HomeLocation::GetInstance(obm);
|
||||||
// save the new settings
|
Q_ASSERT(homeLocation != NULL);
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
HomeLocation::DataFields homeLocationData = homeLocation->getData();
|
||||||
if (!pm) return -2;
|
homeLocationData.Latitude = LLA[0] * 1e7;
|
||||||
|
homeLocationData.Longitude = LLA[1] * 1e7;
|
||||||
|
homeLocationData.Altitude = LLA[2];
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
homeLocationData.Be[0] = Be[0];
|
||||||
if (!om) return -3;
|
homeLocationData.Be[1] = Be[1];
|
||||||
|
homeLocationData.Be[2] = Be[2];
|
||||||
|
|
||||||
HomeLocation *homeLocation = HomeLocation::GetInstance(om);
|
homeLocationData.Set = HomeLocation::SET_TRUE;
|
||||||
Q_ASSERT(homeLocation != NULL);
|
|
||||||
|
|
||||||
HomeLocation::DataFields homeLocationData = homeLocation->getData();
|
homeLocation->setData(homeLocationData);
|
||||||
homeLocationData.Latitude = LLA[0] * 10e6;
|
|
||||||
homeLocationData.Longitude = LLA[1] * 10e6;
|
|
||||||
homeLocationData.Altitude = LLA[2] * 10e6;
|
|
||||||
|
|
||||||
homeLocationData.Be[0] = Be[0];
|
if (save_to_sdcard)
|
||||||
homeLocationData.Be[1] = Be[1];
|
saveObjectToSD(homeLocation);
|
||||||
homeLocationData.Be[2] = Be[2];
|
|
||||||
|
|
||||||
homeLocationData.Set = HomeLocation::SET_TRUE;
|
return 0;
|
||||||
|
|
||||||
homeLocation->setData(homeLocationData);
|
|
||||||
homeLocation->updated();
|
|
||||||
|
|
||||||
if (save_to_sdcard)
|
|
||||||
saveObjectToSD(homeLocation);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3])
|
int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3])
|
||||||
{
|
{
|
||||||
UAVObjectField *field;
|
HomeLocation *homeLocation = HomeLocation::GetInstance(obm);
|
||||||
|
Q_ASSERT(homeLocation != NULL);
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
HomeLocation::DataFields homeLocationData = homeLocation->getData();
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
set = homeLocationData.Set;
|
||||||
if (!pm) return -1;
|
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
LLA[0] = homeLocationData.Latitude*1e-7;
|
||||||
if (!om) return -2;
|
LLA[1] = homeLocationData.Longitude*1e-7;
|
||||||
|
LLA[2] = homeLocationData.Altitude;
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("HomeLocation")));
|
|
||||||
if (!obj) return -3;
|
|
||||||
|
|
||||||
// obj->requestUpdate();
|
|
||||||
|
|
||||||
field = obj->getField("Set");
|
|
||||||
if (!field) return -4;
|
|
||||||
set = field->getValue().toBool();
|
|
||||||
|
|
||||||
field = obj->getField("Latitude");
|
|
||||||
if (!field) return -5;
|
|
||||||
LLA[0] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField("Longitude");
|
|
||||||
if (!field) return -6;
|
|
||||||
LLA[1] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField("Altitude");
|
|
||||||
if (!field) return -7;
|
|
||||||
LLA[2] = field->getDouble();
|
|
||||||
|
|
||||||
if (LLA[0] != LLA[0]) LLA[0] = 0; // nan detection
|
if (LLA[0] != LLA[0]) LLA[0] = 0; // nan detection
|
||||||
else
|
else
|
||||||
@ -394,88 +369,20 @@ int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3])
|
|||||||
return 0; // OK
|
return 0; // OK
|
||||||
}
|
}
|
||||||
|
|
||||||
int UAVObjectUtilManager::getHomeLocation(bool &set, double LLA[3], double ECEF[3], double RNE[9], double Be[3])
|
|
||||||
{
|
|
||||||
UAVObjectField *field;
|
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
|
||||||
if (!pm) return -1;
|
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
if (!om) return -2;
|
|
||||||
|
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("HomeLocation")));
|
|
||||||
if (!obj) return -3;
|
|
||||||
|
|
||||||
// obj->requestUpdate();
|
|
||||||
|
|
||||||
field = obj->getField("Set");
|
|
||||||
if (!field) return -4;
|
|
||||||
set = field->getValue().toBool();
|
|
||||||
|
|
||||||
field = obj->getField("Latitude");
|
|
||||||
if (!field) return -5;
|
|
||||||
LLA[0] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField("Longitude");
|
|
||||||
if (!field) return -6;
|
|
||||||
LLA[1] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField("Altitude");
|
|
||||||
if (!field) return -7;
|
|
||||||
LLA[2] = field->getDouble();
|
|
||||||
|
|
||||||
field = obj->getField(QString("ECEF"));
|
|
||||||
if (!field) return -8;
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
ECEF[i] = field->getDouble(i);
|
|
||||||
|
|
||||||
field = obj->getField(QString("RNE"));
|
|
||||||
if (!field) return -9;
|
|
||||||
for (int i = 0; i < 9; i++)
|
|
||||||
RNE[i] = field->getDouble(i);
|
|
||||||
|
|
||||||
field = obj->getField(QString("Be"));
|
|
||||||
if (!field) return -10;
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
Be[i] = field->getDouble(i);
|
|
||||||
|
|
||||||
return 0; // OK
|
|
||||||
}
|
|
||||||
|
|
||||||
// ******************************
|
// ******************************
|
||||||
// GPS
|
// GPS
|
||||||
|
|
||||||
int UAVObjectUtilManager::getGPSPosition(double LLA[3])
|
int UAVObjectUtilManager::getGPSPosition(double LLA[3])
|
||||||
{
|
{
|
||||||
UAVObjectField *field;
|
GPSPosition *gpsPosition = GPSPosition::GetInstance(obm);
|
||||||
|
Q_ASSERT(gpsPosition != NULL);
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
GPSPosition::DataFields gpsPositionData = gpsPosition->getData();
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
LLA[0] = gpsPositionData.Latitude;
|
||||||
if (!pm) return -1;
|
LLA[1] = gpsPositionData.Longitude;
|
||||||
|
LLA[2] = gpsPositionData.Altitude;
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
if (!om) return -2;
|
|
||||||
|
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("GPSPosition")));
|
|
||||||
if (!obj) return -3;
|
|
||||||
|
|
||||||
// obj->requestUpdate();
|
|
||||||
|
|
||||||
field = obj->getField(QString("Latitude"));
|
|
||||||
if (!field) return -4;
|
|
||||||
LLA[0] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField(QString("Longitude"));
|
|
||||||
if (!field) return -5;
|
|
||||||
LLA[1] = field->getDouble() * 1e-7;
|
|
||||||
|
|
||||||
field = obj->getField(QString("Altitude"));
|
|
||||||
if (!field) return -6;
|
|
||||||
LLA[2] = field->getDouble();
|
|
||||||
|
|
||||||
if (LLA[0] != LLA[0]) LLA[0] = 0; // nan detection
|
if (LLA[0] != LLA[0]) LLA[0] = 0; // nan detection
|
||||||
else
|
else
|
||||||
@ -494,94 +401,6 @@ int UAVObjectUtilManager::getGPSPosition(double LLA[3])
|
|||||||
return 0; // OK
|
return 0; // OK
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************
|
|
||||||
// telemetry port
|
|
||||||
|
|
||||||
int UAVObjectUtilManager::setTelemetrySerialPortSpeed(QString speed, bool save_to_sdcard)
|
|
||||||
{
|
|
||||||
UAVObjectField *field;
|
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
|
||||||
|
|
||||||
// ******************
|
|
||||||
// save the new settings
|
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
|
||||||
if (!pm) return -1;
|
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
if (!om) return -2;
|
|
||||||
|
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("/*TelemetrySettings*/")));
|
|
||||||
if (!obj) return -3;
|
|
||||||
|
|
||||||
field = obj->getField(QString("Speed"));
|
|
||||||
if (!field) return -4;
|
|
||||||
field->setValue(speed);
|
|
||||||
|
|
||||||
obj->updated();
|
|
||||||
|
|
||||||
// ******************
|
|
||||||
// save the new setting to SD card
|
|
||||||
|
|
||||||
if (save_to_sdcard)
|
|
||||||
saveObjectToSD(obj);
|
|
||||||
|
|
||||||
// ******************
|
|
||||||
|
|
||||||
return 0; // OK
|
|
||||||
}
|
|
||||||
|
|
||||||
int UAVObjectUtilManager::getTelemetrySerialPortSpeed(QString &speed)
|
|
||||||
{
|
|
||||||
UAVObjectField *field;
|
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
|
||||||
if (!pm) return -1;
|
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
if (!om) return -2;
|
|
||||||
|
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("TelemetrySettings")));
|
|
||||||
if (!obj) return -3;
|
|
||||||
|
|
||||||
// obj->requestUpdate();
|
|
||||||
|
|
||||||
field = obj->getField(QString("Speed"));
|
|
||||||
if (!field) return -4;
|
|
||||||
speed = field->getValue().toString();
|
|
||||||
|
|
||||||
return 0; // OK
|
|
||||||
}
|
|
||||||
|
|
||||||
int UAVObjectUtilManager::getTelemetrySerialPortSpeeds(QComboBox *comboBox)
|
|
||||||
{
|
|
||||||
UAVObjectField *field;
|
|
||||||
|
|
||||||
QMutexLocker locker(mutex);
|
|
||||||
|
|
||||||
if (!comboBox) return -1;
|
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
|
||||||
if (!pm) return -2;
|
|
||||||
|
|
||||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
|
||||||
if (!om) return -3;
|
|
||||||
|
|
||||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("TelemetrySettings")));
|
|
||||||
if (!obj) return -4;
|
|
||||||
|
|
||||||
// obj->requestUpdate();
|
|
||||||
|
|
||||||
field = obj->getField(QString("Speed"));
|
|
||||||
if (!field) return -5;
|
|
||||||
comboBox->addItems(field->getOptions());
|
|
||||||
|
|
||||||
return 0; // OK
|
|
||||||
}
|
|
||||||
|
|
||||||
deviceDescriptorStruct UAVObjectUtilManager::getBoardDescriptionStruct()
|
deviceDescriptorStruct UAVObjectUtilManager::getBoardDescriptionStruct()
|
||||||
{
|
{
|
||||||
deviceDescriptorStruct ret;
|
deviceDescriptorStruct ret;
|
||||||
|
@ -55,14 +55,9 @@ public:
|
|||||||
|
|
||||||
int setHomeLocation(double LLA[3], bool save_to_sdcard);
|
int setHomeLocation(double LLA[3], bool save_to_sdcard);
|
||||||
int getHomeLocation(bool &set, double LLA[3]);
|
int getHomeLocation(bool &set, double LLA[3]);
|
||||||
int getHomeLocation(bool &set, double LLA[3], double ECEF[3], double RNE[9], double Be[3]);
|
|
||||||
|
|
||||||
int getGPSPosition(double LLA[3]);
|
int getGPSPosition(double LLA[3]);
|
||||||
|
|
||||||
int setTelemetrySerialPortSpeed(QString speed, bool save_to_sdcard);
|
|
||||||
int getTelemetrySerialPortSpeed(QString &speed);
|
|
||||||
int getTelemetrySerialPortSpeeds(QComboBox *comboBox);
|
|
||||||
|
|
||||||
int getBoardModel();
|
int getBoardModel();
|
||||||
QByteArray getBoardCPUSerial();
|
QByteArray getBoardCPUSerial();
|
||||||
quint32 getFirmwareCRC();
|
quint32 getFirmwareCRC();
|
||||||
@ -78,11 +73,15 @@ signals:
|
|||||||
void saveCompleted(int objectID, bool status);
|
void saveCompleted(int objectID, bool status);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex *mutex;
|
QMutex *mutex;
|
||||||
QQueue<UAVObject *> queue;
|
QQueue<UAVObject *> queue;
|
||||||
enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState;
|
enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState;
|
||||||
void saveNextObject();
|
void saveNextObject();
|
||||||
QTimer failureTimer;
|
QTimer failureTimer;
|
||||||
|
|
||||||
|
ExtensionSystem::PluginManager *pm;
|
||||||
|
UAVObjectManager *obm;
|
||||||
|
UAVObjectUtilManager *obum;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//void transactionCompleted(UAVObject *obj, bool success);
|
//void transactionCompleted(UAVObject *obj, bool success);
|
||||||
|
@ -161,6 +161,9 @@ int main(int argc, char *argv[])
|
|||||||
QString res = parser->parseXML(xmlstr, filename);
|
QString res = parser->parseXML(xmlstr, filename);
|
||||||
|
|
||||||
if (!res.isNull()) {
|
if (!res.isNull()) {
|
||||||
|
if (!verbose) {
|
||||||
|
cout << "Error in XML file: " << fileinfo.fileName().toStdString() << endl;
|
||||||
|
}
|
||||||
cout << "Error parsing " << res.toStdString() << endl;
|
cout << "Error parsing " << res.toStdString() << endl;
|
||||||
return RETURN_ERR_XML;
|
return RETURN_ERR_XML;
|
||||||
}
|
}
|
||||||
|
@ -213,6 +213,9 @@ QString UAVObjectParser::parseXML(QString& xml, QString& filename)
|
|||||||
qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan);
|
qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan);
|
||||||
|
|
||||||
// Make sure that required elements were found
|
// Make sure that required elements were found
|
||||||
|
if ( !fieldFound )
|
||||||
|
return QString("Object::field element is missing");
|
||||||
|
|
||||||
if ( !accessFound )
|
if ( !accessFound )
|
||||||
return QString("Object::access element is missing");
|
return QString("Object::access element is missing");
|
||||||
|
|
||||||
@ -381,11 +384,38 @@ QString UAVObjectParser::processObjectFields(QDomNode& childNode, ObjectInfo* in
|
|||||||
// Get name attribute
|
// Get name attribute
|
||||||
QDomNamedNodeMap elemAttributes = childNode.attributes();
|
QDomNamedNodeMap elemAttributes = childNode.attributes();
|
||||||
QDomNode elemAttr = elemAttributes.namedItem("name");
|
QDomNode elemAttr = elemAttributes.namedItem("name");
|
||||||
if ( elemAttr.isNull() )
|
if (elemAttr.isNull()) {
|
||||||
return QString("Object:field:name attribute is missing");
|
return QString("Object:field:name attribute is missing");
|
||||||
|
}
|
||||||
|
QString name = elemAttr.nodeValue();
|
||||||
|
|
||||||
field->name = elemAttr.nodeValue();
|
// Check to see is this field is a clone of another
|
||||||
|
// field that has already been declared
|
||||||
|
elemAttr = elemAttributes.namedItem("cloneof");
|
||||||
|
if (!elemAttr.isNull()) {
|
||||||
|
QString parentName = elemAttr.nodeValue();
|
||||||
|
if (!parentName.isEmpty()) {
|
||||||
|
foreach(FieldInfo * parent, info->fields) {
|
||||||
|
if (parent->name == parentName) {
|
||||||
|
// clone from this parent
|
||||||
|
*field = *parent; // safe shallow copy, no ptrs in struct
|
||||||
|
field->name = name; // set our name
|
||||||
|
// Add field to object
|
||||||
|
info->fields.append(field);
|
||||||
|
// Done
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QString("Object:field::cloneof parent unknown");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QString("Object:field:cloneof attribute is empty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// this field is not a clone, so remember its name
|
||||||
|
field->name = name;
|
||||||
|
}
|
||||||
|
|
||||||
// Get units attribute
|
// Get units attribute
|
||||||
elemAttr = elemAttributes.namedItem("units");
|
elemAttr = elemAttributes.namedItem("units");
|
||||||
@ -410,6 +440,8 @@ QString UAVObjectParser::processObjectFields(QDomNode& childNode, ObjectInfo* in
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get numelements or elementnames attribute
|
// Get numelements or elementnames attribute
|
||||||
|
field->numElements = 0;
|
||||||
|
// Look for element names as an attribute first
|
||||||
elemAttr = elemAttributes.namedItem("elementnames");
|
elemAttr = elemAttributes.namedItem("elementnames");
|
||||||
if ( !elemAttr.isNull() ) {
|
if ( !elemAttr.isNull() ) {
|
||||||
// Get element names
|
// Get element names
|
||||||
@ -422,9 +454,26 @@ QString UAVObjectParser::processObjectFields(QDomNode& childNode, ObjectInfo* in
|
|||||||
field->defaultElementNames = false;
|
field->defaultElementNames = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Look for a list of child elementname nodes
|
||||||
|
QDomNode listNode = childNode.firstChildElement("elementnames");
|
||||||
|
if (!listNode.isNull()) {
|
||||||
|
for (QDomElement node = listNode.firstChildElement("elementname");
|
||||||
|
!node.isNull(); node = node.nextSiblingElement("elementname")) {
|
||||||
|
QDomNode name = node.firstChild();
|
||||||
|
if (!name.isNull() && name.isText() && !name.nodeValue().isEmpty()) {
|
||||||
|
field->elementNames.append(name.nodeValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
field->numElements = field->elementNames.length();
|
||||||
|
field->defaultElementNames = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If no element names were found, then fall back to looking
|
||||||
|
// for the number of elements in the 'elements' attribute
|
||||||
|
if (field->numElements == 0) {
|
||||||
elemAttr = elemAttributes.namedItem("elements");
|
elemAttr = elemAttributes.namedItem("elements");
|
||||||
if ( elemAttr.isNull() ) {
|
if ( elemAttr.isNull() ) {
|
||||||
return QString("Object:field:elements and Object:field:elementnames attribute is missing");
|
return QString("Object:field:elements and Object:field:elementnames attribute/element is missing");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
field->numElements = elemAttr.nodeValue().toInt();
|
field->numElements = elemAttr.nodeValue().toInt();
|
||||||
@ -434,19 +483,34 @@ QString UAVObjectParser::processObjectFields(QDomNode& childNode, ObjectInfo* in
|
|||||||
field->defaultElementNames = true;
|
field->defaultElementNames = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Get options attribute (only if an enum type)
|
// Get options attribute or child elements (only if an enum type)
|
||||||
if (field->type == FIELDTYPE_ENUM) {
|
if (field->type == FIELDTYPE_ENUM) {
|
||||||
|
|
||||||
// Get options attribute
|
// Look for options attribute
|
||||||
elemAttr = elemAttributes.namedItem("options");
|
elemAttr = elemAttributes.namedItem("options");
|
||||||
if ( elemAttr.isNull() )
|
if (!elemAttr.isNull()) {
|
||||||
return QString("Object:field:options attribute is missing");
|
QStringList options = elemAttr.nodeValue().split(",", QString::SkipEmptyParts);
|
||||||
|
for (int n = 0; n < options.length(); ++n) {
|
||||||
QStringList options = elemAttr.nodeValue().split(",", QString::SkipEmptyParts);
|
options[n] = options[n].trimmed();
|
||||||
for (int n = 0; n < options.length(); ++n)
|
}
|
||||||
options[n] = options[n].trimmed();
|
field->options = options;
|
||||||
|
}
|
||||||
field->options = options;
|
else {
|
||||||
|
// Look for a list of child 'option' nodes
|
||||||
|
QDomNode listNode = childNode.firstChildElement("options");
|
||||||
|
if (!listNode.isNull()) {
|
||||||
|
for (QDomElement node = listNode.firstChildElement("option");
|
||||||
|
!node.isNull(); node = node.nextSiblingElement("option")) {
|
||||||
|
QDomNode name = node.firstChild();
|
||||||
|
if (!name.isNull() && name.isText() && !name.nodeValue().isEmpty()) {
|
||||||
|
field->options.append(name.nodeValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (field->options.length() == 0) {
|
||||||
|
return QString("Object:field:options attribute/element is missing");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the default value attribute (required for settings objects, optional for the rest)
|
// Get the default value attribute (required for settings objects, optional for the rest)
|
||||||
@ -466,12 +530,14 @@ QString UAVObjectParser::processObjectFields(QDomNode& childNode, ObjectInfo* in
|
|||||||
return QString("Object:field:incorrect number of default values");
|
return QString("Object:field:incorrect number of default values");
|
||||||
|
|
||||||
/*support legacy single default for multiple elements
|
/*support legacy single default for multiple elements
|
||||||
We sould really issue a warning*/
|
We should really issue a warning*/
|
||||||
for(int ct=1; ct< field->numElements; ct++)
|
for(int ct=1; ct< field->numElements; ct++)
|
||||||
defaults.append(defaults[0]);
|
defaults.append(defaults[0]);
|
||||||
}
|
}
|
||||||
field->defaultValues = defaults;
|
field->defaultValues = defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Limits attribute
|
||||||
elemAttr = elemAttributes.namedItem("limits");
|
elemAttr = elemAttributes.namedItem("limits");
|
||||||
if ( elemAttr.isNull() ) {
|
if ( elemAttr.isNull() ) {
|
||||||
field->limitValues=QString();
|
field->limitValues=QString();
|
||||||
|
@ -5,29 +5,76 @@
|
|||||||
<field name="FeedForward" units="" type="float" elements="1" defaultvalue="0"/>
|
<field name="FeedForward" units="" type="float" elements="1" defaultvalue="0"/>
|
||||||
<field name="AccelTime" units="ms" type="float" elements="1" defaultvalue="0"/>
|
<field name="AccelTime" units="ms" type="float" elements="1" defaultvalue="0"/>
|
||||||
<field name="DecelTime" units="ms" type="float" elements="1" defaultvalue="0"/>
|
<field name="DecelTime" units="ms" type="float" elements="1" defaultvalue="0"/>
|
||||||
<field name="ThrottleCurve1" units="percent" type="float" elements="5" elementnames="0,25,50,75,100" defaultvalue="0,0,0,0,0"/>
|
<field name="ThrottleCurve1" units="percent" type="float" elementnames="0,25,50,75,100" defaultvalue="0,0,0,0,0"/>
|
||||||
<field name="Curve2Source" units="" type="enum" elements="1" options="Throttle,Roll,Pitch,Yaw,Collective,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Throttle"/>
|
<field name="Curve2Source" units="" type="enum" elements="1" defaultvalue="Throttle">
|
||||||
<field name="ThrottleCurve2" units="percent" type="float" elements="5" elementnames="0,25,50,75,100" defaultvalue="0,0.25,0.5,0.75,1"/>
|
<options>
|
||||||
<field name="Mixer1Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Throttle</option>
|
||||||
<field name="Mixer1Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Roll</option>
|
||||||
<field name="Mixer2Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Pitch</option>
|
||||||
<field name="Mixer2Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Yaw</option>
|
||||||
<field name="Mixer3Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Collective</option>
|
||||||
<field name="Mixer3Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Accessory0</option>
|
||||||
<field name="Mixer4Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Accessory1</option>
|
||||||
<field name="Mixer4Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Accessory2</option>
|
||||||
<field name="Mixer5Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Accessory3</option>
|
||||||
<field name="Mixer5Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Accessory4</option>
|
||||||
<field name="Mixer6Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Accessory5</option>
|
||||||
<field name="Mixer6Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
</options>
|
||||||
<field name="Mixer7Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
</field>
|
||||||
<field name="Mixer7Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<field name="ThrottleCurve2" units="percent" type="float" elementnames="0,25,50,75,100" defaultvalue="0,0.25,0.5,0.75,1"/>
|
||||||
<field name="Mixer8Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<field name="Mixer1Type" units="" type="enum" elements="1" defaultvalue="Disabled">
|
||||||
<field name="Mixer8Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<options>
|
||||||
<field name="Mixer9Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Disabled</option>
|
||||||
<field name="Mixer9Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>Motor</option>
|
||||||
<field name="Mixer10Type" units="" type="enum" elements="1" options="Disabled,Motor,Servo,CameraRoll,CameraPitch,CameraYaw,Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5" defaultvalue="Disabled"/>
|
<option>Servo</option>
|
||||||
<field name="Mixer10Vector" units="" type="int8" elements="5" elementnames="ThrottleCurve1,ThrottleCurve2,Roll,Pitch,Yaw" defaultvalue="0"/>
|
<option>CameraRoll</option>
|
||||||
|
<option>CameraPitch</option>
|
||||||
|
<option>CameraYaw</option>
|
||||||
|
<option>Accessory0</option>
|
||||||
|
<option>Accessory1</option>
|
||||||
|
<option>Accessory2</option>
|
||||||
|
<option>Accessory3</option>
|
||||||
|
<option>Accessory4</option>
|
||||||
|
<option>Accessory5</option>
|
||||||
|
</options>
|
||||||
|
</field>
|
||||||
|
<field name="Mixer1Vector" units="" type="int8" defaultvalue="0">
|
||||||
|
<elementnames>
|
||||||
|
<elementname>ThrottleCurve1</elementname>
|
||||||
|
<elementname>ThrottleCurve2</elementname>
|
||||||
|
<elementname>Roll</elementname>
|
||||||
|
<elementname>Pitch</elementname>
|
||||||
|
<elementname>Yaw</elementname>
|
||||||
|
</elementnames>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field name="Mixer2Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer2Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer3Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer3Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer4Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer4Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer5Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer5Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer6Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer6Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer7Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer7Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer8Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer8Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer9Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer9Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
|
<field name="Mixer10Type" cloneof="Mixer1Type"/>
|
||||||
|
<field name="Mixer10Vector" cloneof="Mixer1Vector"/>
|
||||||
|
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||||
|
@ -1,9 +1,94 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="TaskInfo" singleinstance="true" settings="false">
|
<object name="TaskInfo" singleinstance="true" settings="false">
|
||||||
<description>Task information</description>
|
<description>Task information</description>
|
||||||
<field name="StackRemaining" units="bytes" type="uint16" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Airspeed,Stabilization,AltitudeHold,PathPlanner,PathFollower,FlightPlan,Com2UsbBridge,Usb2ComBridge,OveroSync,ModemRx,ModemTx,ModemStat,EventDispatcher,Autotune"/>
|
<field name="StackRemaining" units="bytes" type="uint16">
|
||||||
<field name="Running" units="bool" type="enum" options="False,True" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Airspeed,Stabilization,AltitudeHold,PathPlanner,PathFollower,FlightPlan,Com2UsbBridge,Usb2ComBridge,OveroSync,ModemRx,ModemTx,ModemStat,EventDispatcher,Autotune"/>
|
<elementnames>
|
||||||
<field name="RunningTime" units="%" type="uint8" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Airspeed,Stabilization,AltitudeHold,PathPlanner,PathFollower,FlightPlan,Com2UsbBridge,Usb2ComBridge,OveroSync,ModemRx,ModemTx,ModemStat,EventDispatcher,Autotune"/>
|
<elementname>System</elementname>
|
||||||
|
<elementname>Actuator</elementname>
|
||||||
|
<elementname>Attitude</elementname>
|
||||||
|
<elementname>Sensors</elementname>
|
||||||
|
<elementname>TelemetryTx</elementname>
|
||||||
|
<elementname>TelemetryTxPri</elementname>
|
||||||
|
<elementname>TelemetryRx</elementname>
|
||||||
|
<elementname>GPS</elementname>
|
||||||
|
<elementname>ManualControl</elementname>
|
||||||
|
<elementname>Altitude</elementname>
|
||||||
|
<elementname>Airspeed</elementname>
|
||||||
|
<elementname>Stabilization</elementname>
|
||||||
|
<elementname>AltitudeHold</elementname>
|
||||||
|
<elementname>PathPlanner</elementname>
|
||||||
|
<elementname>PathFollower</elementname>
|
||||||
|
<elementname>FlightPlan</elementname>
|
||||||
|
<elementname>Com2UsbBridge</elementname>
|
||||||
|
<elementname>Usb2ComBridge</elementname>
|
||||||
|
<elementname>OveroSync</elementname>
|
||||||
|
<elementname>ModemRx</elementname>
|
||||||
|
<elementname>ModemTx</elementname>
|
||||||
|
<elementname>ModemStat</elementname>
|
||||||
|
<elementname>Autotune</elementname>
|
||||||
|
<elementname>EventDispatcher</elementname>
|
||||||
|
</elementnames>
|
||||||
|
</field>
|
||||||
|
<field name="Running" units="bool" type="enum">
|
||||||
|
<elementnames>
|
||||||
|
<elementname>System</elementname>
|
||||||
|
<elementname>Actuator</elementname>
|
||||||
|
<elementname>Attitude</elementname>
|
||||||
|
<elementname>Sensors</elementname>
|
||||||
|
<elementname>TelemetryTx</elementname>
|
||||||
|
<elementname>TelemetryTxPri</elementname>
|
||||||
|
<elementname>TelemetryRx</elementname>
|
||||||
|
<elementname>GPS</elementname>
|
||||||
|
<elementname>ManualControl</elementname>
|
||||||
|
<elementname>Altitude</elementname>
|
||||||
|
<elementname>Airspeed</elementname>
|
||||||
|
<elementname>Stabilization</elementname>
|
||||||
|
<elementname>AltitudeHold</elementname>
|
||||||
|
<elementname>PathPlanner</elementname>
|
||||||
|
<elementname>PathFollower</elementname>
|
||||||
|
<elementname>FlightPlan</elementname>
|
||||||
|
<elementname>Com2UsbBridge</elementname>
|
||||||
|
<elementname>Usb2ComBridge</elementname>
|
||||||
|
<elementname>OveroSync</elementname>
|
||||||
|
<elementname>ModemRx</elementname>
|
||||||
|
<elementname>ModemTx</elementname>
|
||||||
|
<elementname>ModemStat</elementname>
|
||||||
|
<elementname>Autotune</elementname>
|
||||||
|
<elementname>EventDispatcher</elementname>
|
||||||
|
</elementnames>
|
||||||
|
<options>
|
||||||
|
<option>False</option>
|
||||||
|
<option>True</option>
|
||||||
|
</options>
|
||||||
|
</field>
|
||||||
|
<field name="RunningTime" units="%" type="uint8">
|
||||||
|
<elementnames>
|
||||||
|
<elementname>System</elementname>
|
||||||
|
<elementname>Actuator</elementname>
|
||||||
|
<elementname>Attitude</elementname>
|
||||||
|
<elementname>Sensors</elementname>
|
||||||
|
<elementname>TelemetryTx</elementname>
|
||||||
|
<elementname>TelemetryTxPri</elementname>
|
||||||
|
<elementname>TelemetryRx</elementname>
|
||||||
|
<elementname>GPS</elementname>
|
||||||
|
<elementname>ManualControl</elementname>
|
||||||
|
<elementname>Altitude</elementname>
|
||||||
|
<elementname>Airspeed</elementname>
|
||||||
|
<elementname>Stabilization</elementname>
|
||||||
|
<elementname>AltitudeHold</elementname>
|
||||||
|
<elementname>PathPlanner</elementname>
|
||||||
|
<elementname>PathFollower</elementname>
|
||||||
|
<elementname>FlightPlan</elementname>
|
||||||
|
<elementname>Com2UsbBridge</elementname>
|
||||||
|
<elementname>Usb2ComBridge</elementname>
|
||||||
|
<elementname>OveroSync</elementname>
|
||||||
|
<elementname>ModemRx</elementname>
|
||||||
|
<elementname>ModemTx</elementname>
|
||||||
|
<elementname>ModemStat</elementname>
|
||||||
|
<elementname>Autotune</elementname>
|
||||||
|
<elementname>EventDispatcher</elementname>
|
||||||
|
</elementnames>
|
||||||
|
</field>
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||||
<telemetryflight acked="true" updatemode="periodic" period="10000"/>
|
<telemetryflight acked="true" updatemode="periodic" period="10000"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user