mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 21:35:27 +03:00
Fixes
This commit is contained in:
parent
9fbff6e67d
commit
57a0aeffbb
4 changed files with 11 additions and 11 deletions
|
@ -793,7 +793,7 @@ enum BluetoothModes {
|
|||
|
||||
// PXX2 constants
|
||||
#define PXX2_LEN_REGISTRATION_ID 8
|
||||
#define PXX2_LEN_RX_NAME 8
|
||||
#define PXX2_LEN_RX_NAME 8
|
||||
#define PXX2_MAX_RECEIVERS_PER_MODULE 5
|
||||
|
||||
#endif // _DATACONSTANTS_H_
|
||||
|
|
|
@ -136,7 +136,7 @@ const uint8_t * DeviceFirmwareUpdate::readFrame(uint32_t timeout)
|
|||
}
|
||||
}
|
||||
|
||||
bool DeviceFirmwareUpdate::waitState(State state, uint32_t timeout)
|
||||
bool DeviceFirmwareUpdate::waitState(State newState, uint32_t timeout)
|
||||
{
|
||||
#if defined(SIMU)
|
||||
UNUSED(state);
|
||||
|
@ -150,8 +150,8 @@ bool DeviceFirmwareUpdate::waitState(State state, uint32_t timeout)
|
|||
return false;
|
||||
}
|
||||
|
||||
processFrame(&frame[1]);
|
||||
return state == state;
|
||||
processFrame(frame);
|
||||
return state == newState;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -258,11 +258,11 @@ const char * DeviceFirmwareUpdate::uploadFile(const char *filename)
|
|||
|
||||
count >>= 2;
|
||||
|
||||
for (UINT i=0; i<count; i++) {
|
||||
for (uint32_t i=0; i<count; i++) {
|
||||
if (!waitState(SPORT_DATA_REQ, 2000)) {
|
||||
return "Module refused data";
|
||||
}
|
||||
startFrame(PRIM_DATA_WORD) ;
|
||||
startFrame(PRIM_DATA_WORD);
|
||||
uint32_t offset = (address & 1023) >> 2; // 32 bit word offset into buffer
|
||||
*((uint32_t *)(frame + 2)) = buffer[offset];
|
||||
frame[6] = address & 0x000000FF;
|
||||
|
|
|
@ -102,19 +102,19 @@ void processBindFrame(uint8_t module, uint8_t * frame)
|
|||
if (frame[3] == 0x00) {
|
||||
bool found = false;
|
||||
for (uint8_t i=0; i<reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversCount; i++) {
|
||||
if (memcmp(reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[i], &frame[4], PXX2_LEN_RX_NAME) == 0) {
|
||||
if (memcmp(&reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[i], &frame[4], PXX2_LEN_RX_NAME) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversCount < PXX2_MAX_RECEIVERS_PER_MODULE) {
|
||||
memcpy(reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversCount], &frame[4], PXX2_LEN_RX_NAME);
|
||||
memcpy(&reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversCount], &frame[4], PXX2_LEN_RX_NAME);
|
||||
++reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversCount;
|
||||
reusableBuffer.moduleSetup.pxx2.bindStep = BIND_RX_NAME_RECEIVED;
|
||||
}
|
||||
}
|
||||
else if (frame[3] == 0x01) {
|
||||
if (memcmp(reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[reusableBuffer.moduleSetup.pxx2.bindSelectedReceiverIndex], &frame[4], PXX2_LEN_RX_NAME) == 0) {
|
||||
if (memcmp(&reusableBuffer.moduleSetup.pxx2.bindCandidateReceiversNames[reusableBuffer.moduleSetup.pxx2.bindSelectedReceiverIndex], &frame[4], PXX2_LEN_RX_NAME) == 0) {
|
||||
reusableBuffer.moduleSetup.pxx2.bindStep = BIND_WAIT;
|
||||
reusableBuffer.moduleSetup.pxx2.bindWaitTimeout = get_tmr10ms() + 30;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void processBindFrame(uint8_t module, uint8_t * frame)
|
|||
|
||||
void processTelemetryFrame(uint8_t module, uint8_t * frame)
|
||||
{
|
||||
sportProcessTelemetryPacketWithoutCrc(&frame[2]);
|
||||
sportProcessTelemetryPacketWithoutCrc(&frame[3]);
|
||||
}
|
||||
|
||||
void processSpectrumFrame(uint8_t module, uint8_t * frame)
|
||||
|
|
|
@ -155,7 +155,7 @@ void logTelemetryWriteByte(uint8_t data);
|
|||
#define LOG_TELEMETRY_WRITE_BYTE(data)
|
||||
#endif
|
||||
|
||||
#define TELEMETRY_OUTPUT_FIFO_SIZE 16
|
||||
#define TELEMETRY_OUTPUT_FIFO_SIZE 20
|
||||
extern uint8_t outputTelemetryBuffer[TELEMETRY_OUTPUT_FIFO_SIZE] __DMA;
|
||||
extern uint8_t outputTelemetryBufferSize;
|
||||
extern uint8_t outputTelemetryBufferTrigger;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue