浏览代码

IR volt debugging

Alex Voinea 3 年之前
父节点
当前提交
338f1f7615
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      Firmware/Filament_sensor.h

+ 9 - 0
Firmware/Filament_sensor.h

@@ -3,6 +3,7 @@
 #include <inttypes.h>
 #include <stdio.h>
 #include <avr/pgmspace.h>
+#include <util/atomic.h>
 
 #include "Marlin.h"
 #include "ultralcd.h"
@@ -136,6 +137,14 @@ public:
     
     void update() {
         IR_sensor::update();
+        if (voltReady) {
+            uint16_t newVoltRaw;
+            ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+                newVoltRaw = voltRaw;
+                voltReady = false;
+            }
+            printf_P(PSTR("newVoltRaw:%u\n"), newVoltRaw / OVERSAMPLENR);
+        }
         ;//
     }