diff --git a/flight/libraries/inc/ubx_utils.h b/flight/libraries/inc/ubx_utils.h index 387b0f7ea..425b4a070 100644 --- a/flight/libraries/inc/ubx_utils.h +++ b/flight/libraries/inc/ubx_utils.h @@ -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]; diff --git a/flight/libraries/ubx_utils.c b/flight/libraries/ubx_utils.c index ac33285cc..0c82069a2 100644 --- a/flight/libraries/ubx_utils.c +++ b/flight/libraries/ubx_utils.c @@ -24,7 +24,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -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; } ; diff --git a/flight/modules/gpsp/gps9gpshandler.c b/flight/modules/gpsp/gps9gpshandler.c index b16d77414..669baadda 100644 --- a/flight/modules/gpsp/gps9gpshandler.c +++ b/flight/modules/gpsp/gps9gpshandler.c @@ -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; } diff --git a/flight/modules/gpsp/gps9maghandler.c b/flight/modules/gpsp/gps9maghandler.c index 9ea20be7f..610d9f74b 100644 --- a/flight/modules/gpsp/gps9maghandler.c +++ b/flight/modules/gpsp/gps9maghandler.c @@ -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; } } diff --git a/flight/modules/gpsp/gpsdsysmod.c b/flight/modules/gpsp/gpsdsysmod.c index a256a1d85..5f76202b7 100644 --- a/flight/modules/gpsp/gpsdsysmod.c +++ b/flight/modules/gpsp/gpsdsysmod.c @@ -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)); }