1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

corrected instance id encoding in filename to not conflict with metadata uavobject ids

This commit is contained in:
Corvus Corax 2013-11-16 18:55:54 +01:00
parent f25926d4bc
commit 314d526e94
2 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,8 @@ static void customSPrintf(uint8_t *buffer, uint8_t *format, ...)
*/
static void objectFilename(uint32_t obj_id, uint16_t obj_inst_id, uint8_t *filename)
{
uint32_t prefix = obj_id + (obj_inst_id / 256);
uint32_t prefix = obj_id + (obj_inst_id / 256) * 16; // put upper 8 bit of instance id into object id modification,
// skip least sig nibble since that is used for meta object id
uint8_t suffix = obj_inst_id & 0xff;
customSPrintf(filename, (uint8_t *)"%08X.o%02X", prefix, suffix);

View File

@ -57,7 +57,8 @@ static void customSPrintf(uint8_t *buffer, uint8_t *format, ...)
*/
static void objectFilename(uint32_t obj_id, uint16_t obj_inst_id, uint8_t *filename)
{
uint32_t prefix = obj_id + (obj_inst_id / 256);
uint32_t prefix = obj_id + (obj_inst_id / 256) * 16; // put upper 8 bit of instance id into object id modification,
// skip least sig nibble since that is used for meta object id
uint8_t suffix = obj_inst_id & 0xff;
customSPrintf(filename, (uint8_t *)"%08X.o%02X", prefix, suffix);