浏览代码

Avoid running an IO detection where there are no IOs

Fabio Battaglia 4 年之前
父节点
当前提交
6d07be4dc5
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

+ 5 - 0
src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

@@ -30,6 +30,11 @@ public class DuPALAnalyzer {
     } 
 
     public int detectIOTypeMask(final DuPALCmdInterface dpci) throws DuPALBoardException {
+        if(dpci.palSpecs.getPinCount_IO() == 0) {
+            logger.info("detectIOTypeMask -> This PAL has no IOs");
+            return 0;
+        }
+
         int ioAsOutMask = 0;
         int maxINVal = 1 << (dpci.palSpecs.getPinCount_IN() + dpci.palSpecs.getPinCount_IO());