diff --git a/flight/OpenPilot/Modules/Example/examplemodperiodic.c b/flight/OpenPilot/Modules/Example/examplemodperiodic.c index 439107b85..432db22b4 100644 --- a/flight/OpenPilot/Modules/Example/examplemodperiodic.c +++ b/flight/OpenPilot/Modules/Example/examplemodperiodic.c @@ -88,9 +88,10 @@ static void exampleTask(void* parameters) ExampleSettingsGet(&settings); // TODO: Remove, this is temporary for testing (force settings) + // will remove when default setting values are implemented settings.StepDirection = EXAMPLESETTINGS_STEPDIRECTION_UP; settings.StepSize = 1; - settings.UpdatePeriod = 10; + settings.UpdatePeriod = 100; // Get the object data ExampleObject2Get(&data); diff --git a/flight/OpenPilot/System/openpilot.c b/flight/OpenPilot/System/openpilot.c index 3c17c6b13..b611b7157 100644 --- a/flight/OpenPilot/System/openpilot.c +++ b/flight/OpenPilot/System/openpilot.c @@ -121,7 +121,7 @@ int main() //xTaskCreate(TaskSDCard, (signed portCHAR *)"SDCard", configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 2), NULL); /* Initialize modules */ - //SystemModInitialize(); + SystemModInitialize(); TelemetryInitialize(); //ExampleModEventInitialize(); ExampleModPeriodicInitialize(); diff --git a/flight/OpenPilot/UAVTalk/uavtalk.c b/flight/OpenPilot/UAVTalk/uavtalk.c index 6e4d2687b..0325b643c 100644 --- a/flight/OpenPilot/UAVTalk/uavtalk.c +++ b/flight/OpenPilot/UAVTalk/uavtalk.c @@ -195,7 +195,7 @@ int32_t UAVTalkProcessInputStream(uint8_t rxbyte) if (rxCount == 4) { // Search for object, if not found reset state machine - objId = (tmpBuffer[0] << 24) | (tmpBuffer[1] << 16) | (tmpBuffer[2] << 8) | (tmpBuffer[3]); + objId = (tmpBuffer[3] << 24) | (tmpBuffer[2] << 16) | (tmpBuffer[1] << 8) | (tmpBuffer[0]); obj = UAVObjGetByID(objId); if (obj == 0) { @@ -249,7 +249,7 @@ int32_t UAVTalkProcessInputStream(uint8_t rxbyte) tmpBuffer[rxCount++] = rxbyte; if (rxCount == 2) { - instId = (tmpBuffer[0] << 8) | (tmpBuffer[1]); + instId = (tmpBuffer[1] << 8) | (tmpBuffer[0]); cs = updateChecksum(cs, tmpBuffer, 2); rxCount = 0; // If there is a payload get it, otherwise receive checksum @@ -276,7 +276,7 @@ int32_t UAVTalkProcessInputStream(uint8_t rxbyte) tmpBuffer[rxCount++] = rxbyte; if (rxCount == 2) { - csRx = (tmpBuffer[0] << 8) | (tmpBuffer[1]); + csRx = (tmpBuffer[1] << 8) | (tmpBuffer[0]); if (csRx == cs) { xSemaphoreTakeRecursive(lock, portMAX_DELAY); @@ -456,10 +456,10 @@ static int32_t sendSingleObject(UAVObjHandle obj, uint16_t instId, uint8_t type) // Setup type and object id fields objId = UAVObjGetID(obj); txBuffer[0] = type; - txBuffer[1] = (uint8_t)((objId >> 24) & 0xFF); - txBuffer[2] = (uint8_t)((objId >> 16) & 0xFF); - txBuffer[3] = (uint8_t)((objId >> 8) & 0xFF); - txBuffer[4] = (uint8_t)(objId & 0xFF); + txBuffer[1] = (uint8_t)(objId & 0xFF); + txBuffer[2] = (uint8_t)((objId >> 8) & 0xFF); + txBuffer[3] = (uint8_t)((objId >> 16) & 0xFF); + txBuffer[4] = (uint8_t)((objId >> 24) & 0xFF); // Setup instance ID if one is required if (UAVObjIsSingleInstance(obj)) @@ -468,8 +468,8 @@ static int32_t sendSingleObject(UAVObjHandle obj, uint16_t instId, uint8_t type) } else { - txBuffer[5] = (uint8_t)((instId >> 8) & 0xFF); - txBuffer[6] = (uint8_t)(instId & 0xFF); + txBuffer[5] = (uint8_t)(instId & 0xFF); + txBuffer[6] = (uint8_t)((instId >> 8) & 0xFF); dataOffset = 7; } @@ -501,8 +501,8 @@ static int32_t sendSingleObject(UAVObjHandle obj, uint16_t instId, uint8_t type) // Calculate checksum cs = 0; cs = updateChecksum(cs, txBuffer, dataOffset+length); - txBuffer[dataOffset+length] = (uint8_t)((cs >> 8) & 0xFF); - txBuffer[dataOffset+length+1] = (uint8_t)(cs & 0xFF); + txBuffer[dataOffset+length] = (uint8_t)(cs & 0xFF); + txBuffer[dataOffset+length+1] = (uint8_t)((cs >> 8) & 0xFF); // Send buffer if (outStream!=NULL) (*outStream)(txBuffer, dataOffset+length+CHECKSUM_LENGTH);