浏览代码

Remove redundant check (always trigger the fsensor isr)

Since fsensor_st_block_chunk is already called on fsensor_chunk_size
boundaries, there's no need to check a second time.
Yuri D'Elia 4 年之前
父节点
当前提交
3af35844e1
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      Firmware/fsensor.cpp

+ 4 - 6
Firmware/fsensor.cpp

@@ -563,12 +563,10 @@ void fsensor_st_block_chunk(int cnt)
 {
 	if (!fsensor_enabled) return;
 	fsensor_st_cnt += cnt;
-	if (abs(fsensor_st_cnt) >= fsensor_chunk_len)
-	{
-// !!! bit toggling (PINxn <- 1) (for PinChangeInterrupt) does not work for some MCU pins
-		if (PIN_GET(FSENSOR_INT_PIN)) {PIN_VAL(FSENSOR_INT_PIN, LOW);}
-		else {PIN_VAL(FSENSOR_INT_PIN, HIGH);}
-	}
+
+    // !!! bit toggling (PINxn <- 1) (for PinChangeInterrupt) does not work for some MCU pins
+    if (PIN_GET(FSENSOR_INT_PIN)) {PIN_VAL(FSENSOR_INT_PIN, LOW);}
+    else {PIN_VAL(FSENSOR_INT_PIN, HIGH);}
 }
 #endif //PAT9125