2 byte pin index #4097

wow we have so many useful 'todo's :)
This commit is contained in:
rusefillc 2022-04-24 23:23:12 -04:00
parent 10409ebd59
commit 66e661361b
4 changed files with 11 additions and 11 deletions

Binary file not shown.

View File

@ -292,8 +292,7 @@ public class ReaderState {
log.debug("Need to align before " + cf.getName());
structure.addAlignmentFill(state, getPrimitiveSize);
} else {
// adding a structure instance - had to be aligned
// todo? structure.addAlignmentFill(state);
structure.addAlignmentFill(state, 4);
}
if (cf.isIterate()) {

View File

@ -510,15 +510,15 @@ public class ConfigFieldParserTest {
"\t */\n" +
"\tint8_t byte1 = (int8_t)0;\n" +
"\t/**\n" +
"\t * offset 1\n" +
"\t */\n" +
"\tstruct_s struct;\n" +
"\t/**\n" +
"\t * need 4 byte alignment\n" +
"\tunits\n" +
"\t * offset 5\n" +
"\t * offset 1\n" +
"\t */\n" +
"\tuint8_t alignmentFill_at_5[3];\n" +
"\tuint8_t alignmentFill_at_1[3];\n" +
"\t/**\n" +
"\t * offset 4\n" +
"\t */\n" +
"\tstruct_s struct;\n" +
"};\n" +
"static_assert(sizeof(pid_s) == 8);\n" +
"\n",

View File

@ -37,10 +37,11 @@ public class JavaSensorsConsumerTest {
"alignmentFill_at_10(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 10, 1.0, -20.0, 100.0, \"units\"),\n" +
"luaTimingMult(\"luaTimingMult\", SensorCategory.SENSOR_INPUTS, FieldType.INT, 12, 1.0, -1.0, -1.0, \"\"),\n" +
"vehicleSpeedKph(\"vehicleSpeedKph\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 16, 1.0, -1.0, -1.0, \"\"),\n" +
"internalMcuTemperature(\"mcu\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 17, 1.0, 0.0, 0.0, \"deg C\"),\n" +
"alignmentFill_at_18(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 18, 1.0, -20.0, 100.0, \"units\"),\n",
"alignmentFill_at_17(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 17, 1.0, -20.0, 100.0, \"units\"),\n" +
"internalMcuTemperature(\"mcu\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 20, 1.0, 0.0, 0.0, \"deg C\"),\n" +
"alignmentFill_at_21(\"need 4 byte alignment\", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 21, 1.0, -20.0, 100.0, \"units\"),\n",
javaSensorsConsumer.getContent());
assertEquals(20, javaSensorsConsumer.sensorTsPosition);
assertEquals(24, javaSensorsConsumer.sensorTsPosition);
}
@Test