浏览代码

Volatile keyword not needed for parser.seen

Scott Lahteine 7 年前
父节点
当前提交
76e90b93b7
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2
    4
      Marlin/gcode.h

+ 2
- 4
Marlin/gcode.h 查看文件

@@ -131,8 +131,7 @@ public:
131 131
 
132 132
     // Code seen bit was set. If not found, value_ptr is unchanged.
133 133
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
134
-    // This is volatile because its side-effects are important
135
-    static volatile bool seen(const char c) {
134
+    static bool seen(const char c) {
136 135
       const uint8_t ind = LETTER_OFF(c);
137 136
       if (ind >= COUNT(param)) return false; // Only A-Z
138 137
       const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind));
@@ -148,8 +147,7 @@ public:
148 147
 
149 148
     // Code is found in the string. If not found, value_ptr is unchanged.
150 149
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
151
-    // This is volatile because its side-effects are important
152
-    static volatile bool seen(const char c) {
150
+    static bool seen(const char c) {
153 151
       const char *p = strchr(command_args, c);
154 152
       const bool b = !!p;
155 153
       if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;

正在加载...
取消
保存