mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Create a pg for rxSpiConfig
This commit is contained in:
parent
1ab7b7816b
commit
1a035aa0f3
28 changed files with 138 additions and 50 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "pg/pg_ids.h"
|
||||
#include "pg/beeper.h"
|
||||
#include "pg/rx.h"
|
||||
#include "pg/rx_spi.h"
|
||||
|
||||
#include "drivers/accgyro/accgyro.h"
|
||||
#include "drivers/bus_i2c.h"
|
||||
|
@ -1054,9 +1055,15 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
|
|||
sbufWriteU8(dst, rxConfig()->rcInterpolation);
|
||||
sbufWriteU8(dst, rxConfig()->rcInterpolationInterval);
|
||||
sbufWriteU16(dst, rxConfig()->airModeActivateThreshold * 10 + 1000);
|
||||
sbufWriteU8(dst, rxConfig()->rx_spi_protocol);
|
||||
sbufWriteU32(dst, rxConfig()->rx_spi_id);
|
||||
sbufWriteU8(dst, rxConfig()->rx_spi_rf_channel_count);
|
||||
#ifdef USE_RX_SPI
|
||||
sbufWriteU8(dst, rxSpiConfig()->rx_spi_protocol);
|
||||
sbufWriteU32(dst, rxSpiConfig()->rx_spi_id);
|
||||
sbufWriteU8(dst, rxSpiConfig()->rx_spi_rf_channel_count);
|
||||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
sbufWriteU32(dst, 0);
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
sbufWriteU8(dst, rxConfig()->fpvCamAngleDegrees);
|
||||
break;
|
||||
|
||||
|
@ -1894,9 +1901,15 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
|||
rxConfigMutable()->airModeActivateThreshold = (sbufReadU16(src) - 1000) / 10;
|
||||
}
|
||||
if (sbufBytesRemaining(src) >= 6) {
|
||||
rxConfigMutable()->rx_spi_protocol = sbufReadU8(src);
|
||||
rxConfigMutable()->rx_spi_id = sbufReadU32(src);
|
||||
rxConfigMutable()->rx_spi_rf_channel_count = sbufReadU8(src);
|
||||
#ifdef USE_RX_SPI
|
||||
rxSpiConfigMutable()->rx_spi_protocol = sbufReadU8(src);
|
||||
rxSpiConfigMutable()->rx_spi_id = sbufReadU32(src);
|
||||
rxSpiConfigMutable()->rx_spi_rf_channel_count = sbufReadU8(src);
|
||||
#else
|
||||
sbufReadU8(src);
|
||||
sbufReadU32(src);
|
||||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
if (sbufBytesRemaining(src) >= 1) {
|
||||
rxConfigMutable()->fpvCamAngleDegrees = sbufReadU8(src);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue