Selaa lähdekoodia

Make Parser::seen volatile

Scott Lahteine 8 vuotta sitten
vanhempi
commit
0282452cea
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2
    2
      Marlin/gcode.h

+ 2
- 2
Marlin/gcode.h Näytä tiedosto

@@ -120,7 +120,7 @@ public:
120 120
 
121 121
     // Code seen bit was set. If not found, value_ptr is unchanged.
122 122
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
123
-    static bool seen(const char c) {
123
+    static volatile bool seen(const char c) {
124 124
       const uint8_t ind = c - 'A';
125 125
       if (ind >= COUNT(param)) return false; // Only A-Z
126 126
       const bool b = TEST(codebits[ind >> 3], ind & 0x7);
@@ -132,7 +132,7 @@ public:
132 132
 
133 133
     // Code is found in the string. If not found, value_ptr is unchanged.
134 134
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
135
-    static bool seen(const char c) {
135
+    static volatile bool seen(const char c) {
136 136
       const char *p = strchr(command_args, c);
137 137
       const bool b = !!p;
138 138
       if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;

Loading…
Peruuta
Tallenna