Browse Source

Added a versioning system to the config files

João Brázio 9 years ago
parent
commit
de8108648f
No account linked to committer's email address
4 changed files with 50 additions and 0 deletions
  1. 13
    0
      Marlin/Configuration.h
  2. 13
    0
      Marlin/Configuration_adv.h
  3. 14
    0
      Marlin/SanityCheck.h
  4. 10
    0
      Marlin/Version.h

+ 13
- 0
Marlin/Configuration.h View File

38
 #ifndef CONFIGURATION_H
38
 #ifndef CONFIGURATION_H
39
 #define CONFIGURATION_H
39
 #define CONFIGURATION_H
40
 
40
 
41
+/**
42
+ *
43
+ *  ***********************************
44
+ *  **  ATTENTION TO ALL DEVELOPERS  **
45
+ *  ***********************************
46
+ *
47
+ * You must increment this version number for every significant change such as,
48
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
49
+ *
50
+ * Note: Update also Default_Version.h !
51
+ */
52
+#define CONFIGURATION_H_VERSION 1
53
+
41
 #include "boards.h"
54
 #include "boards.h"
42
 #include "macros.h"
55
 #include "macros.h"
43
 
56
 

+ 13
- 0
Marlin/Configuration_adv.h View File

33
 #ifndef CONFIGURATION_ADV_H
33
 #ifndef CONFIGURATION_ADV_H
34
 #define CONFIGURATION_ADV_H
34
 #define CONFIGURATION_ADV_H
35
 
35
 
36
+/**
37
+ *
38
+ *  ***********************************
39
+ *  **  ATTENTION TO ALL DEVELOPERS  **
40
+ *  ***********************************
41
+ *
42
+ * You must increment this version number for every significant change such as,
43
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
44
+ *
45
+ * Note: Update also Default_Version.h !
46
+ */
47
+#define CONFIGURATION_ADV_H_VERSION 1
48
+
36
 #include "Conditionals.h"
49
 #include "Conditionals.h"
37
 
50
 
38
 // @section temperature
51
 // @section temperature

+ 14
- 0
Marlin/SanityCheck.h View File

39
 #endif
39
 #endif
40
 
40
 
41
 /**
41
 /**
42
+ * We try our best to include sanity checks for all the changes configuration
43
+ * directives because people have a tendency to use outdated config files with
44
+ * the bleding edge source code, but sometimes this is not enough. This check
45
+ * will force a minimum config file revision, otherwise Marlin will not build.
46
+ */
47
+#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION
48
+  #error You are using an old Configuration.h file, updated it before building Marlin.
49
+#endif
50
+
51
+#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION
52
+  #error You are using an old Configuration_adv.h file, updated it before building Marlin.
53
+#endif
54
+
55
+/**
42
  * Marlin release, version and default string
56
  * Marlin release, version and default string
43
  */
57
  */
44
 #ifndef SHORT_BUILD_VERSION
58
 #ifndef SHORT_BUILD_VERSION

+ 10
- 0
Marlin/Version.h View File

45
 #define STRING_DISTRIBUTION_DATE "2016-04-27 12:00"
45
 #define STRING_DISTRIBUTION_DATE "2016-04-27 12:00"
46
 
46
 
47
 /**
47
 /**
48
+ * Required minimum Configuration.h and Configuration_adv.h file versions.
49
+ *
50
+ * You must increment this version number for every significant change such as,
51
+ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on
52
+ * the configuration files.
53
+ */
54
+#define REQUIRED_CONFIGURATION_H_VERSION 1
55
+#define REQUIRED_CONFIGURATION_ADV_H_VERSION 1
56
+
57
+/**
48
  * @todo: Missing documentation block
58
  * @todo: Missing documentation block
49
  */
59
  */
50
 #define PROTOCOL_VERSION "1.0"
60
 #define PROTOCOL_VERSION "1.0"

Loading…
Cancel
Save