Arne Schwabe
bb21c20b21
Check sizes of eeprom struct sizes at compile time
...
Changing the size of a struct by accident lead to random the wrong data from the eeprom and can screw the eeprom up pretty bad. Better bail out if the eeprom size changes and let the developer make that an intentional choice. The template magic is there to print out the actual and expected size:
/Users/arne/oss/opentx/radio/src/datastructs.h:1045:3: error: static_assert failed "struct size changed"
static_assert(expectedSize == realSize, "struct size changed");
^ ~~~~~~~~~~~~~~~~~~~~~~~~
/Users/arne/oss/opentx/radio/src/datastructs.h:1181:3: note: in instantiation of function template specialization 'check_size<TrainerData, 168, 16>' requested here
CHKSIZE(TrainerData, 168);
2016-04-04 10:20:58 +02:00
..
2016-03-27 10:49:04 +02:00
2016-03-24 22:11:08 +01:00
2016-04-03 19:27:47 +02:00
2016-03-25 12:54:35 +01:00
2016-04-02 21:05:22 +02:00
2016-03-29 21:41:14 +02:00
2016-04-04 07:00:32 +02:00
2016-04-02 21:05:22 +02:00
2016-03-28 20:31:42 +02:00
2016-04-03 17:56:32 +02:00
2016-04-01 23:08:52 +02:00
2015-11-18 22:07:48 +01:00
2016-04-03 23:07:55 +02:00
2016-04-03 23:07:55 +02:00
2016-03-10 20:22:26 +01:00
2015-12-23 19:57:13 +01:00
2015-12-23 19:57:13 +01:00
2015-12-23 19:57:13 +01:00
2016-03-14 22:30:46 +01:00
2015-12-23 19:57:13 +01:00
2016-04-03 23:06:08 +02:00
2016-04-03 17:56:32 +02:00
2016-04-03 23:27:02 +02:00
2016-03-28 20:31:42 +02:00
2016-03-14 22:30:46 +01:00
2016-03-28 19:07:28 +02:00
2016-04-04 10:20:58 +02:00
2016-04-03 19:27:47 +02:00
2016-04-03 23:06:08 +02:00
2016-03-18 21:49:06 +01:00
2016-03-20 15:20:59 +01:00
2016-03-04 23:54:35 +01:00
2015-12-23 19:57:13 +01:00
2016-03-18 21:49:06 +01:00
2016-04-02 19:31:54 +02:00
2016-03-10 20:22:26 +01:00
2016-03-10 20:22:26 +01:00
2016-03-10 20:22:26 +01:00
2015-12-23 19:57:13 +01:00
2016-03-15 23:21:32 +01:00
2016-02-27 19:11:58 +01:00
2016-03-28 11:24:55 +02:00
2016-04-03 19:27:47 +02:00
2015-12-23 19:57:13 +01:00
2016-03-28 11:24:55 +02:00
2016-03-28 11:24:55 +02:00
2016-04-01 23:08:52 +02:00
2016-04-03 19:27:47 +02:00
2016-04-01 23:08:52 +02:00
2015-12-23 19:57:13 +01:00
2015-12-23 19:57:13 +01:00
2016-03-14 22:30:46 +01:00
2015-12-23 19:57:13 +01:00
2016-03-20 15:20:59 +01:00
2016-03-20 15:20:59 +01:00
2016-03-12 20:52:03 +01:00
2016-03-09 07:06:51 +01:00
2016-03-14 22:30:46 +01:00
2015-12-23 19:57:13 +01:00
2016-03-28 11:24:55 +02:00
2016-02-29 20:44:30 +01:00
2015-11-25 18:00:44 +01:00
2016-02-29 20:43:37 +01:00
2016-02-01 20:45:56 +01:00
2016-03-14 22:30:46 +01:00
2016-02-25 23:14:58 +01:00
2016-04-03 19:27:47 +02:00
2016-04-03 17:56:32 +02:00
2016-03-14 22:30:46 +01:00
2015-12-23 19:57:13 +01:00
2015-12-23 19:57:13 +01:00
2016-03-01 19:44:10 +01:00
2015-12-23 19:57:13 +01:00
2015-12-23 19:57:13 +01:00
2016-04-01 23:08:52 +02:00
2016-04-01 23:08:52 +02:00
2016-03-28 11:24:55 +02:00