1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1477 - typos and other fixes from review

This commit is contained in:
Alessio Morale 2014-09-20 20:58:40 +02:00
parent c220257a67
commit cedb4f127d
5 changed files with 9 additions and 9 deletions

View File

@ -43,7 +43,7 @@ typedef struct {
} __attribute__((packed)) UBXFooter_t;
typedef union {
uint8_t bynarystream[0];
uint8_t binarystream[0];
struct {
UBXHeader_t header;
uint8_t payload[0];

View File

@ -24,7 +24,7 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ubx_utils.h>
bool ubx_getLastSentence(uint8_t *data, uint16_t bufferCount, uint8_t * *lastSentence, uint16_t *lenght)
bool ubx_getLastSentence(uint8_t *data, uint16_t bufferCount, uint8_t * *lastSentence, uint16_t *length)
{
const uint8_t packet_overhead = UBX_HEADER_LEN + 2;
uint8_t *current = data + bufferCount - packet_overhead;
@ -36,7 +36,7 @@ bool ubx_getLastSentence(uint8_t *data, uint16_t bufferCount, uint8_t * *lastSen
uint16_t len = current[4] + (current[5] << 8);
if (len + packet_overhead + current <= data + bufferCount) {
*lastSentence = current;
*lenght = len + packet_overhead;
*length = len + packet_overhead;
return true;
}
}
@ -68,7 +68,7 @@ void ubx_appendChecksum(UBXPacket_t *pkt)
// From class field to the end of payload
for (uint8_t i = 2; i < len + UBX_HEADER_LEN; i++) {
chkA += pkt->bynarystream[i];
chkA += pkt->binarystream[i];
chkB += chkA;
}
;

View File

@ -52,10 +52,10 @@ void handleGPS()
PIOS_UBX_DDC_ReadData(PIOS_I2C_GPS, buffer, toRead);
uint8_t *lastSentence;
static uint16_t lastSentenceLenght;
completeSentenceSent = ubx_getLastSentence(buffer, toRead, &lastSentence, &lastSentenceLenght);
uint16_t lastSentenceLength;
completeSentenceSent = ubx_getLastSentence(buffer, toRead, &lastSentence, &lastSentenceLength);
if (completeSentenceSent) {
toSend = (uint8_t)(lastSentence - buffer + lastSentenceLenght);
toSend = (uint8_t)(lastSentence - buffer + lastSentenceLength);
} else {
lastUnsentData = 0;
}

View File

@ -47,7 +47,7 @@ void handleMag()
magPkt.fragments.data.Z = mag[2];
magPkt.fragments.data.status = 1;
ubx_buildPacket(&magPkt.packet, UBX_OP_CUST_CLASS, UBX_OP_MAG, sizeof(MagData));
PIOS_COM_SendBuffer(pios_com_main_id, magPkt.packet.bynarystream, sizeof(MagUbxPkt));
PIOS_COM_SendBuffer(pios_com_main_id, magPkt.packet.binarystream, sizeof(MagUbxPkt));
return;
}
}

View File

@ -202,7 +202,7 @@ static void updateStats()
sysPkt.fragments.data.options = SYS_DATA_OPTIONS_MAG | (flash_available() ? SYS_DATA_OPTIONS_FLASH : 0);
ubx_buildPacket(&sysPkt.packet, UBX_OP_CUST_CLASS, UBX_OP_SYS, sizeof(SysData));
PIOS_COM_SendBuffer(pios_com_main_id, sysPkt.packet.bynarystream, sizeof(SysUbxPkt));
PIOS_COM_SendBuffer(pios_com_main_id, sysPkt.packet.binarystream, sizeof(SysUbxPkt));
}