var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(fa,ra,ca){fa instanceof String&&(fa=String(fa));for(var ta=fa.length,Ba=0;Ba<ta;Ba++){var vb=fa[Ba];if(ra.call(ca,vb,Ba,fa))return{i:Ba,v:vb}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(fa,ra,ca){if(fa==Array.prototype||fa==Object.prototype)return fa;fa[ra]=ca.value;return fa};$jscomp.getGlobal=function(fa){fa=["object"==typeof globalThis&&globalThis,fa,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var ra=0;ra<fa.length;++ra){var ca=fa[ra];if(ca&&ca.Math==Math)return ca}throw Error("Cannot find global object");};
$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(fa,ra){var ca=$jscomp.propertyToPolyfillSymbol[ra];if(null==ca)return fa[ra];ca=fa[ca];return void 0!==ca?ca:fa[ra]};
$jscomp.polyfill=function(fa,ra,ca,ta){ra&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(fa,ra,ca,ta):$jscomp.polyfillUnisolated(fa,ra,ca,ta))};$jscomp.polyfillUnisolated=function(fa,ra,ca,ta){ca=$jscomp.global;fa=fa.split(".");for(ta=0;ta<fa.length-1;ta++){var Ba=fa[ta];if(!(Ba in ca))return;ca=ca[Ba]}fa=fa[fa.length-1];ta=ca[fa];ra=ra(ta);ra!=ta&&null!=ra&&$jscomp.defineProperty(ca,fa,{configurable:!0,writable:!0,value:ra})};
$jscomp.polyfillIsolated=function(fa,ra,ca,ta){var Ba=fa.split(".");fa=1===Ba.length;ta=Ba[0];ta=!fa&&ta in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var vb=0;vb<Ba.length-1;vb++){var Lb=Ba[vb];if(!(Lb in ta))return;ta=ta[Lb]}Ba=Ba[Ba.length-1];ca=$jscomp.IS_SYMBOL_NATIVE&&"es6"===ca?ta[Ba]:null;ra=ra(ca);null!=ra&&(fa?$jscomp.defineProperty($jscomp.polyfills,Ba,{configurable:!0,writable:!0,value:ra}):ra!==ca&&(void 0===$jscomp.propertyToPolyfillSymbol[Ba]&&(ca=1E9*Math.random()>>>0,
$jscomp.propertyToPolyfillSymbol[Ba]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(Ba):$jscomp.POLYFILL_PREFIX+ca+"$"+Ba),$jscomp.defineProperty(ta,$jscomp.propertyToPolyfillSymbol[Ba],{configurable:!0,writable:!0,value:ra})))};$jscomp.polyfill("Array.prototype.find",function(fa){return fa?fa:function(ra,ca){return $jscomp.findInternal(this,ra,ca).v}},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(fa){return fa?fa:function(ra,ca,ta){var Ba=this.length||0;0>ca&&(ca=Math.max(0,Ba+ca));if(null==ta||ta>Ba)ta=Ba;ta=Number(ta);0>ta&&(ta=Math.max(0,Ba+ta));for(ca=Number(ca||0);ca<ta;ca++)this[ca]=ra;return this}},"es6","es3");$jscomp.typedArrayFill=function(fa){return fa?fa:Array.prototype.fill};$jscomp.polyfill("Int8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Float64Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");var NUTOOL_PIN={};
(function(){function fa(){var a;var d=0;for(a=Z.length;d<a;d+=1)Z[d].restore();Z.length=0}function ra(){var a,d=$("#panel");var c=0;d[0].setAttribute("style","width:"+(Ya-275-8)+"px; height:"+(Ua-8)+"px; border: 1px solid white; position:absolute; left:275px; top:0px;");-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?Ha?d.hover(function(){$(this).css("opacity","1");$("#pin_side_0").show();$("#NUC_PinConfiguration_Canvas_Lining").hide();eb()},function(){$(this).css("opacity",Qb);$("#pin_side_0").hide();
$("#NUC_PinConfiguration_Canvas_Lining").show()}):d.hover(function(){$(this).css("opacity","1");$("#pin_side_0").css("opacity","0.8");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","0");eb()},function(){$(this).css("opacity",Qb);$("#pin_side_0").css("opacity","0.1");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","1")}):d.hover(function(){$(this).css("opacity","1");eb()},function(){$(this).css("opacity",Qb)});var e=$("#NUC_PinConfiguration_Canvas")[0];e.setAttribute("style","z-index:1; position:absolute; left:0px; top:0px; border: 1px solid white;");
e.setAttribute("width",Za);e.setAttribute("height",qb);var f=ua.getContext(e);ua.addEvent(e,"click",rb);$("html").hasClass("ie10+")&&ua.addEvent(e,"dblclick",function(){Xb("userDefined")});f.strokeStyle="#000000";if(-1!==E.indexOf("SOP")){f.strokeRect(R,V,A/2,A);e=f.createLinearGradient(R+A/2,V+A,0,0);e.addColorStop(0,"#000000");e.addColorStop(1,"#8CA5B9");f.fillStyle=e;f.fillRect(R,V,A/2,A);f.beginPath();f.arc(R+10,V+10,5,0,2*Math.PI,!0);f.strokeStyle="white";f.stroke();f.strokeStyle="#000000";var h=
1;do h+=1,f.font=h+"px Arial Black";while(f.measureText(Ta).width<A/2);c=h;f.save();f.translate(R+A/4,V+A/2-f.measureText(Ta).width/2);f.rotate(Math.PI/2);f.fillStyle="#FE2E2E";f.fillText(Ta,0,0);f.restore();e=E.slicePriorToX("(");c=0;for(a=NUTOOL_PIN.g_cfg_chips.length;c<a;c+=1)if(NUTOOL_PIN.g_cfg_chips[c].name+"("+NUTOOL_PIN.g_cfg_chips[c].pkg+")"===E){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[c].display&&(e=NUTOOL_PIN.g_cfg_chips[c].display);break}f.fillStyle="white";c=1;do c+=1,f.font="bold "+
c+"px Calibri";while(f.measureText(e).width<A/2);c>h&&(c=h,f.font="bold "+c+"px Calibri");c=c/2+5;f.save();f.translate(R+A/4-c,V+A/2-f.measureText(e).width/2);f.rotate(Math.PI/2);f.fillText(e,0,0);f.restore();if(12<Q){h=1;do h+=1,f.font="bold "+h+"px Calibri";while(f.measureText(NUTOOL_PIN.g_packageNumber).width<A/4);c=c+h/2+5;f.save();f.translate(R+A/4-c,V+A/2-f.measureText(NUTOOL_PIN.g_packageNumber).width/2);f.rotate(Math.PI/2);f.fillText(NUTOOL_PIN.g_packageNumber,0,0);f.restore()}Z=[];for(c=
0;2>c;c+=1)f="pin_side_"+c,d[0].appendChild($a("canvas",f)),Z[c]=fc().init(f,$("#"+f),c),Z[c].draw()}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){f.strokeRect(R,V,A,A);e=f.createLinearGradient(R+A,V+A,0,0);e.addColorStop(0,"#000000");e.addColorStop(1,"#8CA5B9");f.fillStyle=e;f.fillRect(R,V,A,A);f.beginPath();f.arc(R+10,V+A-10,5,0,2*Math.PI,!0);f.strokeStyle="white";f.stroke();f.strokeStyle="#000000";0===$("#NUC_PinConfiguration_Canvas_Lining").length&&$("#panel")[0].appendChild($a("canvas",
"NUC_PinConfiguration_Canvas_Lining"));f=$("#NUC_PinConfiguration_Canvas_Lining")[0];f.setAttribute("style","z-index:1; position:absolute; left:0px; top:0px; border: 1px solid white;");f.setAttribute("width",Za);f.setAttribute("height",qb);f=ua.getContext(f);h=1;do h+=1,f.font=h+"px Arial Black";while(f.measureText(Ta).width<A/2);f.fillStyle="#FE2E2E";f.fillText(Ta,R+A/2-f.measureText(Ta).width/2,V+A/2);e=E.slicePriorToX("(");c=0;for(a=NUTOOL_PIN.g_cfg_chips.length;c<a;c+=1)if(NUTOOL_PIN.g_cfg_chips[c].name+
"("+NUTOOL_PIN.g_cfg_chips[c].pkg+")"===E){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[c].display&&(e=NUTOOL_PIN.g_cfg_chips[c].display);break}f.fillStyle="white";c=1;do c+=1,f.font="bold "+c+"px Calibri";while(f.measureText(e).width<A/2);c>h&&(c=h,f.font="bold "+c+"px Calibri");c=100>Q?c/2+Q/2:c/2+Q/10;f.fillText(e,R+A/2-f.measureText(e).width/2,V+A/2+c);e=E.slicePriorToX(")").sliceAfterX("(")+"(TOP VIEW)";h=1;do h+=1,f.font="bold "+h+"px Calibri";while(f.measureText(e).width<A/2);c=100>Q?c+h/2+
Q/2:c+h/2+Q/10;f.fillText(e,R+A/2-f.measureText(e).width/2,V+A/2+c);Z=[];f="pin_side_0";d[0].appendChild($a("canvas",f));Z[0]=fc().init(f,$("#"+f),0);Z[0].draw()}else{f.strokeRect(R,V,A,A);e=f.createLinearGradient(R+A,V+A,0,0);e.addColorStop(0,"#000000");e.addColorStop(1,"#8CA5B9");f.fillStyle=e;f.fillRect(R,V,A,A);f.beginPath();f.arc(R+10,V+A-10,5,0,2*Math.PI,!0);f.strokeStyle="white";f.stroke();f.strokeStyle="#000000";h=1;do h+=1,f.font=h+"px Arial Black";while(f.measureText(Ta).width<A/2);f.fillStyle=
"#FE2E2E";f.fillText(Ta,R+A/2-f.measureText(Ta).width/2,V+A/2);e=E.slicePriorToX("(");c=0;for(a=NUTOOL_PIN.g_cfg_chips.length;c<a;c+=1)if(NUTOOL_PIN.g_cfg_chips[c].name+"("+NUTOOL_PIN.g_cfg_chips[c].pkg+")"===E){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[c].display&&(e=NUTOOL_PIN.g_cfg_chips[c].display);break}f.fillStyle="white";c=1;do c+=1,f.font="bold "+c+"px Calibri";while(f.measureText(e).width<A/2);c>h&&(c=h,f.font="bold "+c+"px Calibri");c=c/2+Q/8;f.fillText(e,R+A/2-f.measureText(e).width/
2,V+A/2+c);h=1;do h+=1,f.font="bold "+h+"px Calibri";while(f.measureText(NUTOOL_PIN.g_packageNumber).width<A/4);c=c+h/2+Q/8;f.fillText(NUTOOL_PIN.g_packageNumber,R+A/2-f.measureText(NUTOOL_PIN.g_packageNumber).width/2,V+A/2+c);Z=[];for(c=0;4>c;c+=1)f="pin_side_"+c,d[0].appendChild($a("canvas",f)),Z[c]=fc().init(f,$("#"+f),c),Z[c].draw()}Vc();gc();c=h=f=c=e=e=f=f=e=d=a=c=null}function ca(a,d){var c=0,e;var f=/(\d+)|(\D+)/g;var h=/\d/;if(isFinite(a)&&isFinite(d))return a-d;a=String(a).toLowerCase();
d=String(d).toLowerCase();if(a===d)return 0;if(!h.test(a)||!h.test(d))return a>d?1:-1;a=a.match(f);d=d.match(f);for(e=a.length>d.length?d.length:a.length;c<e;)if(f=a[c],h=d[c],c+=1,f!==h)return isFinite(f)&&isFinite(h)?("0"===f.charAt(0)&&(f="."+f),"0"===h.charAt(0)&&(h="."+h),f-h):f>h?1:-1;return a.length-d.length}function ta(){var a=[],d,c,e,f=[],h=[],n=[],b=[],g,k=[],r=[],v=[],w=$("#rootTree_Pin"),p=$("#moduleTree"),q=$("#ChipType_span"),t=$("#MCU_span");a=za(Na);a.sort(ca);b=[];zb=[];pa=[];v=
[];var l=0;for(d=a.length;l<d;l+=1){f=[];n=[];var y=0;for(c=Na[a[l]].length;y<c;y+=1){var u=ab[a[l]][y];f.push(u+"_Pin"+Na[a[l]][y])}f.sort(ca);h=[];var z=!1;y=0;for(c=f.length;y<c;y+=1)if(!(0<h.length&&-1!==$.inArray(y,h))){u=f[y];var F=!1;if(0===NUTOOL_PIN.g_cfg_shareBits.length&&y!==f.length-1){var J=y+1;for(e=f.length;J<e;J+=1)u.restorePinTreeNodeName()===f[J].restorePinTreeNodeName()?(h.push(J),z=F=!0):u.sliceAfterX("_Pin")===f[J].sliceAfterX("_Pin")&&(z=!0)}var aa=u.replaceSpecialCharacters();
var ba={};var da={};if(F){var S={};da.id=aa;S.data="Pin:"+X(u.sliceAfterX("_Pin"));S.attr=da;r=[];r.push(S);pa.push(da.id);J=0;for(e=h.length;J<e;J+=1)u.restorePinTreeNodeName()===f[h[J]].restorePinTreeNodeName()&&(S={},da={},da.id=f[h[J]],da.id=da.id.replaceSpecialCharacters(),S.data="Pin:"+X(da.id.sliceAfterX("_Pin")),S.attr=da,r.push(S),pa.push(da.id));da={};da.id=aa.restorePinTreeNodeName()+"_Intermediate";ba.data=u.restorePinTreeNodeName();ba.attr=da;ba.children=r;zb.push(da.id)}else da.id=aa,
ba.data=u.restorePinTreeNodeName()+"(Pin:"+X(u.sliceAfterX("_Pin"))+")",ba.attr=da;n.push(ba)}z&&v.push(a[l]+"_Root");var Ea={};da={};da.id=a[l]+"_Root";Ea.data=a[l];Ea.attr=da;Ea.state="closed";Ea.children=n;b[l]=Ea}if(0===p.length){sb();if("Simplified Chinese"===oa){var bb="\u652f\u63f4\u6a21\u7ec4";y="\u641c\u5bfb..";J="\u82af\u7247\u7cfb\u5217:";c="\u578b\u53f7:"}else"Traditional Chinese"===oa?(bb="\u652f\u63f4\u6a21\u7d44",y="\u641c\u5c0b..",J="\u6676\u7247\u7cfb\u5217:",c="\u578b\u865f:"):(bb=
"Supported Modules",y="Search..",J="Chip Series:",c="Part No.:");w[0].appendChild($a("div","supportedModules",""));var wb=$("#supportedModules");wb.append("<span id=supportedModules_span></span>");var cb=$("#supportedModules_span");cb.css("vertical-align","text-top");cb.css("font-size","16px");cb.css("font-weight","bold");wb.append("<input id='searchInput_Pin' type='text' value="+y+">");var Eb=$("#searchInput_Pin");w[0].appendChild($a("div","moduleTree","Loading..."));p=$("#moduleTree");q.text(J);
q.css("font-size","16px");q.css("font-weight","bold");t.text(c);t.css("font-size","16px");t.css("font-weight","bold");c=J=y=null}wb[0].setAttribute("style","background-color: #FFFFFF; border-right: 16px solid #F2F2F2; float:left; width:259px; height: 22px;");cb.text(bb);Eb[0].setAttribute("style","font-family:Times Arial; position:absolute; left:"+(cb.width()+10)+"px; width:"+(259-cb.width()-10)+"px; height: 16px;");w.hide();Eb.change(function(){Yb(this.value)});p[0].setAttribute("style","background-color: #FFFFFF; overflow-y: scroll; float:left; width:275px; height: "+
(Oa-db-6-$("#supportedModules").height())+"px; font-size:16px;");-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?Ha?p.hover(function(){$(this).css("background-color","#FAFAFA");eb();$("#pin_side_0").show();$("#NUC_PinConfiguration_Canvas_Lining").hide()},function(){$(this).css("background-color","#FFFFFF");$("#pin_side_0").hide();$("#NUC_PinConfiguration_Canvas_Lining").show()}):p.hover(function(){$(this).css("background-color","#FAFAFA");eb();$("#pin_side_0").css("opacity","0.8");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity",
"0")},function(){$(this).css("background-color","#FFFFFF");$("#pin_side_0").css("opacity","0.1");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","1")}):p.hover(function(){$(this).css("background-color","#FAFAFA");eb()},function(){$(this).css("background-color","#FFFFFF")});p.jstree({themes:{theme:"classic",icons:!1},json_data:{data:b,progressive_render:!0},search:{case_insensitive:!0},core:{animation:0},plugins:"themes json_data types search checkbox ui".split(" ")}).bind("hover_node.jstree",
function(H,O){H=O.rslt.obj.attr("id");var ma=!1;O=-1;if(Mb&&0<NUTOOL_PIN.g_cfg_gpiosDescriptions.length&&-1===H.indexOf("_dot")){if(-1!==H.indexOf("_Pin")){var U=H.restorePinTreeNodeName();O=parseInt(H.sliceAfterX("_Pin"),10);ma=!0}ma&&(U=U.restorePinTreeNodeName().restoreSpecialCharacters(),U=Ac(U,O),va(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][O-1])&&(U="("+NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][O-1]+") "+U),"unknown"!==U&&$("#"+H).simpletip({content:U,fixed:!1,offset:[100,
-7]}))}}).bind("check_node.jstree",function(H,O){H=O.rslt.obj.attr("id");var ma=H.restorePinTreeNodeName();try{var U=O.inst._get_parent(O.rslt.obj).attr("id")}catch(qa){}k=[];Ma();rb();if($("#"+H).hasClass("semi-disabled"))Wc(H);else{if("undefined"===typeof U){O=0;for(U=Na[ma].length;O<U;O+=1)k.push(Na[ma][O]);g=ma;p.jstree("open_node",$("#"+H))}else k[0]=parseInt(H.sliceAfterX("Pin"),10),g=x(U.slicePriorToX("_"));Fb?Pa(H,g,k):Ba(!0,H,g,k)}}).bind("uncheck_node.jstree",function(H,O){H=O.rslt.obj.attr("id");
var ma=H.restorePinTreeNodeName();try{var U=O.inst._get_parent(O.rslt.obj).attr("id")}catch(qa){}k=[];Ma();if("undefined"===typeof U)k=Na[ma],g=x(ma);else{if(-1!==H.indexOf("_Intermediate")){l=0;for(d=pa.length;l<d;l+=1)pa[l].restorePinTreeNodeName()===H.restorePinTreeNodeName()&&(O=pa[l],g=x(O.slicePriorToX("_")),k[0]=parseInt(O.sliceAfterX("_Pin"),10),U=O.restorePinTreeNodeName(),U===D[k[0]-1].replaceSpecialCharacters()&&(tb(O,g,k),fb()));return}k[0]=parseInt(H.sliceAfterX("Pin"),10);g=x(U.slicePriorToX("_"))}Ba(!1,
H,g,k)}).bind("open_node.jstree",function(H,O){var ma=O.rslt.obj.attr("id");H=ma.restorePinTreeNodeName();var U,qa,ha;try{var M=O.inst._get_parent(O.rslt.obj).attr("id")}catch(Ca){}if("undefined"===typeof M&&-1!==$.inArray(ma,v))for(l=0,d=zb.length;l<d;l+=1)-1!==zb[l].indexOf(H)&&($("#"+zb[l]).addClass("semi-disabled"),$("#"+zb[l]+" >a").css("background-color","#B0C4DE"));if("undefined"===typeof M&&"undefined"!==typeof B[H]&&0<B[H].length){Fb=!0;l=0;for(d=B[H].length;l<d;l+=1)p.jstree("open_node",
$("#"+B[H][l].restorePinTreeNodeName()+"_Intermediate")),p.jstree("check_node",$("#"+B[H][l]));B[H].length=0;Fb=!1;fb()}$(O.rslt.obj).find("li").each(function(Ca,kb){U=$(kb).attr("id");M=x(U.slicePriorToX("_"));if(-1!==U.indexOf("_Pin"))if(ha=Va[parseInt(U.sliceAfterX("_Pin"),10)-1],0!==U.indexOf(ha)&&!va(ha)||-1!==U.indexOf(ha)&&!1===$("#"+U).hasClass("jstree-checked"))$("#"+U+" >a").css("color","red"),$("#"+ma+" >a").css("color","red");else{if("undefined"===typeof B[M]||"undefined"!==typeof B[M]&&
0===B[M].length)I=$.inArray(U,Ka),-1!==I&&($("#"+U+" >a").css("color","blue"),Ka.splice(I,1))}else p.jstree("open_node",$("#"+U)),$("#"+U).find("li").each(function(Ia,C){qa=$(C).attr("id");M=x(qa.slicePriorToX("_"));ha=Va[parseInt(qa.sliceAfterX("_Pin"),10)-1];if(-1===qa.indexOf(ha)&&!va(ha)||-1!==qa.indexOf(ha)&&!1===$("#"+qa).hasClass("jstree-checked"))$("#"+qa+" >a").css("color","red"),$("#"+U+" >a").css("color","red"),$("#"+ma+" >a").css("color","red");else if("undefined"===typeof B[M]||"undefined"!==
typeof B[M]&&0===B[M].length)Ia=$.inArray(qa,Ka),-1!==Ia&&($("#"+qa+" >a").css("color","blue"),Ka.splice(Ia,1))}),p.jstree("close_node",$("#"+U))});var I=ha=qa=U=M=H=ma=null}).bind("select_node.jstree",function(H,O){H=O.rslt.obj.attr("id");var ma;p.jstree("open_node",$("#"+H));$("#"+H).find("li").each(function(qa,ha){ma=$(ha).attr("id");-1!==ma.indexOf("_Pin")?p.jstree("open_node",$("#"+ma)):(p.jstree("open_node",$("#"+ma)),$("#"+ma).find("li").each(function(M,I){U=$(I).attr("id");p.jstree("open_node",
$("#"+U))}))});var U=ma=H=null}).bind("loaded.jstree",function(){l=0;for(d=v.length;l<d;l+=1)$("#"+v[l]).addClass("semi-disabled"),$("#"+v[l]+" >a").css("background-color","#B0C4DE");if(Gb){Fb=!0;var H,O,ma,U,qa=[];var ha=ja;var M=za(Da);if("NUC400"===m||"M451HD"===m||"M451LD"===m||"M4521"===m||"NANO100AN"===m||"NANO100BN"===m||"NANO112"===m||"NUC505"===m||"NUC121AE"===m||"NUC123AE"===m||"NANO103"===m||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"AX58200"===m||0===m.indexOf("M25")||"NDA102SD2"===
m||"M261"===m||0===m.indexOf("M235")||0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||"M0564"===m||"M05641"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC029xGE"===m||"NUC029KGE"===m||"MINI57"===m||"NM1120"===m||"NDA102"===m||"MA35D1"===m){var I=0;for(O=M.length;I<O;I+=1)if(0!==Da[M[I]]){var Ca=Da[M[I]];var kb=-1!==M[I].indexOf("MFPH")||-1!==M[I].indexOf("_H_MFP")?!1:!0;for(H=0;8>H;H+=1){var Ia=15<<4*H>>>0;var C=(Ca&Ia)>>>0;if(C=C>>>4*H>>>0){var Y=kb?H:H+8;var Wa="P"+M[I].slice(M[I].indexOf("P")+
1,M[I].indexOf("P")+2)+"."+Y.toString();var P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);if(-1!==P){var sa=gb(M[I],Y);Y=1;for(ma=NUTOOL_PIN.g_cfg_gpios[sa].f.length;Y<ma;Y+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)){var G=NUTOOL_PIN.g_cfg_gpios[sa].f[Y];G=G.slicePriorToX(":");Y+=1;if(Y<ma&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C))if(-1!==ja.indexOf("Pin"+X(P+1))){var T=ja.slice(ja.indexOf("Pin"+X(P+1)));T=T.sliceBetweenXandX(":","\r").trim();G!==
T&&(G=T)}else-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T));break}C=G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+(P+1)):B[C].push(G+"_Pin"+(P+1))}}Ca=(Ca&~Ia)>>>0;if(0===Ca)break}}}else if("M0A21"===m||0===m.indexOf("M46"))for(I=0,O=M.length;I<O;I+=1){if(0!==Da[M[I]])for(Ca=Da[M[I]],kb=parseInt(M[I].substr(-1),
10),H=0;4>H;H+=1){Ia=255<<8*H>>>0;C=(Ca&Ia)>>>0;if(C=C>>>8*H>>>0)if(Y=H+4*kb,Wa="P"+M[I].slice(M[I].indexOf("P")+1,M[I].indexOf("P")+2)+"."+Y.toString(),P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==P){sa=gb(M[I],Y);Y=1;for(ma=NUTOOL_PIN.g_cfg_gpios[sa].f.length;Y<ma;Y+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)){G=NUTOOL_PIN.g_cfg_gpios[sa].f[Y];G=G.slicePriorToX(":");Y+=1;Y<ma&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)&&(-1!==ja.indexOf("Pin"+
X(P+1))?(T=ja.slice(ja.indexOf("Pin"+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)):-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)));break}C=G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+(P+1)):B[C].push(G+"_Pin"+(P+1))}Ca=(Ca&~Ia)>>>0;if(0===Ca)break}}else if(0===m.indexOf("ML5")||0===
m.indexOf("MS51")||0===m.indexOf("KM1M7"))for(I=0,O=M.length;I<O;I+=1){if(0!==Da[M[I]])for(Ca=Da[M[I]],H=0;8>H;H+=1){Ia=15<<4*H>>>0;C=(Ca&Ia)>>>0;if(C=C>>>4*H>>>0)if(Y=H,Wa="P"+M[I].slice(M[I].indexOf("P")+1,M[I].indexOf("P")+2)+"."+Y.toString(),P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==P){sa=gb(M[I],Y);Y=1;for(ma=NUTOOL_PIN.g_cfg_gpios[sa].f.length;Y<ma;Y+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)){G=NUTOOL_PIN.g_cfg_gpios[sa].f[Y];G=G.slicePriorToX(":");
Y+=1;Y<ma&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)&&(-1!==ja.indexOf("Pin"+X(P+1))?(T=ja.slice(ja.indexOf("Pin"+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)):-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)));break}C=G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+(P+1)):B[C].push(G+
"_Pin"+(P+1))}Ca=(Ca&~Ia)>>>0;if(0===Ca)break}}else if("ISD9100"===m||"ISD9300"===m)for(I=0,O=M.length;I<O;I+=1){if(0!==Da[M[I]])for(Ca=Da[M[I]],H=0;16>H;H+=1){Ia=3<<2*H>>>0;C=(Ca&Ia)>>>0;if(C=C>>>2*H>>>0)if(Y=H,Wa="P"+M[I].slice(M[I].indexOf("P")+1,M[I].indexOf("P")+2)+"."+Y.toString(),P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==P){sa=gb(M[I],Y);Y=1;for(ma=NUTOOL_PIN.g_cfg_gpios[sa].f.length;Y<ma;Y+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)){G=NUTOOL_PIN.g_cfg_gpios[sa].f[Y];
G=G.slicePriorToX(":");Y+=1;Y<ma&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[Y].indexOf(":"+C)&&(-1!==ja.indexOf("Pin"+X(P+1))?(T=ja.slice(ja.indexOf("Pin"+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)):-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)));break}C=G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=
G+"_Pin"+(P+1)):B[C].push(G+"_Pin"+(P+1))}Ca=(Ca&~Ia)>>>0;if(0===Ca)break}}else if("NUC200AE"===m||"NUC2201"===m||"M071R1S"===m||"NUC029xEE"===m||"NUC100AN_BN"===m||"NUC100CN"===m||"NUC100DN"===m)for(I=0,O=M.length;I<O;I+=1){if(-1===M[I].indexOf("ALT")&&0!==Da[M[I]])for(H=0;32>H;H+=1){Ca=Da[M[I]];Ia=1<<H>>>0;C=(Ca&Ia)>>>H>>>0;P=-1;if(C)for(T=M[I]+"["+H+"]",Y=0,ma=NUTOOL_PIN.g_cfg_gpioMatrix.length;Y<ma;Y+=1){var wa=1;for(U=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f.length;wa<U;wa+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[wa].indexOf(T)){Wa=
NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[0];P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==P){C=0;wa=1;for(U=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f.length;wa<U;wa+=1)G=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[wa],kb=parseInt(G.slice(G.indexOf("[")+1,G.indexOf("]")),10),Ia=1<<kb>>>0,sa=G.slicePriorToX("["),Ca=Da[sa],C+=((Ca&Ia)>>>kb)*Math.pow(2,wa-1),sa=G.slicePriorToX(":"),-1===$.inArray(sa,NUTOOL_PIN.g_cfg_shareBits)&&(Da[sa]=Ca&~Ia);G="";sa=gb(Wa,parseInt(Wa.sliceAfterX("."),10));
wa=1;for(U=NUTOOL_PIN.g_cfg_gpios[sa].f.length;wa<U;wa+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[wa].indexOf(":"+C)){G=NUTOOL_PIN.g_cfg_gpios[sa].f[wa];G=G.slicePriorToX(":");wa+=1;wa<U&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[wa].indexOf(":"+C)&&(-1!==ja.indexOf("Pin"+X(P+1))?(T=ja.slice(ja.indexOf("Pin"+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)):-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)));break}if(""!==G){C=
G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+(P+1)):B[C].push(G+"_Pin"+(P+1));break}}}if(0===Da[M[I]])break}}else for(I=0,O=M.length;I<O;I+=1)if(0!==Da[M[I]])for(H=0;32>H;H+=1){Ca=Da[M[I]];Ia=1<<H>>>0;C=(Ca&Ia)>>>H>>>0;P=-1;if(C)for(T=M[I]+"["+H+"]",Y=0,ma=NUTOOL_PIN.g_cfg_gpioMatrix.length;Y<ma;Y+=1){wa=1;for(U=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f.length;wa<U;wa+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[wa].indexOf(T)){Wa=
NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[0];P=$.inArray(Wa,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==P){C=0;wa=1;for(U=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f.length;wa<U;wa+=1)G=NUTOOL_PIN.g_cfg_gpioMatrix[Y].f[wa],kb=parseInt(G.slice(G.indexOf("[")+1,G.indexOf("]")),10),Ia=1<<kb>>>0,sa=G.slicePriorToX("["),Ca=Da[sa],C+=((Ca&Ia)>>>kb)*Math.pow(2,wa-1),Da[sa]=Ca&~Ia;G="";sa=gb(Wa,parseInt(Wa.sliceAfterX("."),10));wa=1;for(U=NUTOOL_PIN.g_cfg_gpios[sa].f.length;wa<U;wa+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[wa].indexOf(":"+
C)){G=NUTOOL_PIN.g_cfg_gpios[sa].f[wa];G=G.slicePriorToX(":");wa+=1;wa<U&&-1!==NUTOOL_PIN.g_cfg_gpios[sa].f[wa].indexOf(":"+C)&&(-1!==ja.indexOf("Pin"+X(P+1))?(T=ja.slice(ja.indexOf("Pin"+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)):-1!==ja.indexOf("Pin "+X(P+1))&&(T=ja.slice(ja.indexOf("Pin "+X(P+1))),T=T.sliceBetweenXandX(":","\r").trim(),G!==T&&(G=T)));break}if(""!==G){C=G;C=x(C);G=G.replaceSpecialCharacters();-1!==C.indexOf("_")&&(C=C.slicePriorToX("_"));qa[0]=P+1;Pa(G+"_Pin"+
(P+1),C,qa);"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+(P+1)):B[C].push(G+"_Pin"+(P+1));break}}}if(0===Da[M[I]])break}for(;-1!==ha.indexOf("IN_ICE_MODE");){M=!0;I=ha.indexOf("IN_ICE_MODE");for(O=1;":"!==ha.charAt(I-O);)if(O+=1,0>I-O||30<O){M=!1;break}if(M)G=ha.slice(I-O+1,I)+"IN_ICE_MODE",C=G=G.replaceSpecialCharacters(),-1!==C.indexOf("_")&&(C=C.slicePriorToX("_")),C=x(C);else break;M=!0;I-=O;for(O=1;"n"!==ha.charAt(I-O);)if(O+=1,0>I-O||30<O){M=!1;break}if(M)I=ha.slice(I-O+1).slicePriorToX(":"),
I=parseInt(I,10),qa[0]=I,Pa(G+"_Pin"+(P+1),C,qa),"undefined"===typeof B[C]?(B[C]=[],B[C][0]=G+"_Pin"+I):B[C].push(G+"_Pin"+I);else break;ha=ha.slice(ha.indexOf("IN_ICE_MODE")+1)}I=0;for(O=Fa.length;I<O;I+=1)if(""===D[Fa[I]]){ha=la[Fa[I]];for(ha=ha.slice(ha.indexOf("P"));-1!==ha.indexOf(".")&&2!==ha.indexOf(".");)ha=ha.slice(1),ha=ha.slice(ha.indexOf("P"));ha=ha.slicePriorToX("/");P=ha.replaceSpecialCharacters()+"_Pin"+(Fa[I]+1);ha=x(ha);qa[0]=Fa[I]+1;Pa(P,ha,qa);"undefined"===typeof B[ha]?(B[ha]=
[],B[ha][0]=P):B[ha].push(P)}qa=za(B);I=0;for(O=qa.length;I<O;I+=1)$("#"+qa[I]+"_Root").addClass("jstree-undetermined");Da=[];fb();ja=null}else Gb=!0,(Rb||NUTOOL_PIN.g_bFunctionalTesting)&&Bc();Fb=!1;Rb?($("#ChipType").show(),$("#MCU").show(),$("#moduleTree").height(Oa-$("#ChipType").height()-$("#MCU").height()-db-6-$("#supportedModules").height())):($("#ChipType").show(),$("#MCU").show());$("#ChipTypeSelect").show();$("#MCUselect").show();$("#rootTree_Pin").show();$("#panel").css("overflow-x","scroll");
$("#panel").css("overflow-y","scroll");$("#ChipType").css("border-right","16px solid #F2F2F2");$("#MCU").css("border-right","16px solid #F2F2F2");if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA"))Ha?($("#pin_side_0").hide(),$("#NUC_PinConfiguration_Canvas_Lining").show()):($("#pin_side_0").css("opacity","0.1"),$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","1"));Zb();"undefined"!==typeof NUTOOL_PER&&"PinConfigure"!==NUTOOL_PER.getg_currentTool()&&($("#parentOfPanel").hide(),$("#ChipType").hide(),
$("#MCU").hide(),$("#rootTree_Pin").hide());NUTOOL_PIN.g_bModuleTreeLoaded=!0}).bind("destroy.jstree",function(){a=[];f=[];h=[];n=[];b=[];k=[];r=[];v=[];B=[];Ka=[];bb=Eb=cb=wb=t=q=p=w=da=Ea=S=ba=g=z=F=aa=u=null})}function Ba(a,d,c,e){function f(J,aa){if($("#"+$(aa).attr("id")).hasClass("jstree-checked")||$("#"+$(aa).attr("id")).hasClass("jstree-undetermined"))return F=!0,!1}function h(J,aa){if($("#"+$(aa).attr("id")).hasClass("jstree-checked"))return $("#"+d.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),
$("#"+x(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1}var n;var b=!1;var g=[],k=[],r=[],v=xa.length,w="",p;var q="#41AF88";var t=$("#moduleTree");var l=0;for(n=xa.length;l<n;l+=1)g[l]=xa[l].slicePriorToX(":");if(a){sb();for(l=0;l<v;l+=1)-1!==$.inArray(parseInt(g[l],10),e)&&(1!==e.length&&xa[l]!==g[l]+":"+c||1===e.length&&D[g[l]-1].replaceSpecialCharacters()!==d.restorePinTreeNodeName())&&(w="Simplified Chinese"===oa?w+("\u7b2c"+X(g[l])+"\u811a\u4f4d\u5df2\u88ab"+
ya(D[g[l]-1])+"\u4f7f\u7528\u3002<br />"):"Traditional Chinese"===oa?w+("\u7b2c"+X(g[l])+"\u8173\u4f4d\u5df2\u88ab"+ya(D[g[l]-1])+"\u4f7f\u7528\u3002<br />"):w+("Pin"+X(g[l])+" has been asserted by "+ya(D[g[l]-1])+".<br />"),b=!0);if(b){if("Simplified Chinese"===oa){v="\u51b2\u7a81\u53d1\u751f";var y="\u9810\u671f\u7684"+c+"\u548c\u522b\u7684\u6a21\u7ec4\u51b2\u7a81\u3002\u8bf7\u95ee\u4f60\u8981\u8c03\u6574\u65e7\u7684\u4e14\u6539\u8bbe\u7f6e\u5230\u73b0\u5728\u7684\u6a21\u7ec4\u5417?";var u="\u8981";
var z="\u4e0d\u8981"}else"Traditional Chinese"===oa?(v="\u885d\u7a81\u767c\u751f",y="\u9810\u671f\u7684"+c+"\u548c\u5225\u7684\u6a21\u7d44\u885d\u7a81\u3002\u8acb\u554f\u4f60\u8981\u8abf\u6574\u820a\u7684\u4e14\u6539\u8a2d\u7f6e\u5230\u73fe\u5728\u7684\u6a21\u7d44\u55ce?",u="\u8981",z="\u4e0d\u8981"):(v="Conflict Occurred",y="The expected "+c+" conflicts with other modules. Would you like to adjust the old modules and configure to the current one?",u="Yes",z="No");Ma();$('<div id="conflictDialog"><p>'+
y+"<br />"+w+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:v,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#conflictDialog").dialog("destroy")},buttons:[{text:u,click:function(){r=za(L);Sb=[];l=0;for(n=r.length;l<n;l+=1)Sb[r[l]]=L[r[l]];Nb=[];l=0;for(n=Fa.length;l<n;l+=1)Nb[l]=Fa[l];ja="";l=0;for(n=D.length;l<n;l+=1)""!==D[l]&&(ja+="Pin"+(l+1)+":"+ya(D[l])+"\r");W="";vb(d,c,e,g);$("#conflictDialog").dialog("isOpen")&&
$("#conflictDialog").dialog("destroy")}},{text:z,click:function(){l=0;for(n=e.length;l<n;l+=1)-1===$.inArray(e[l].toString(),g)&&k.push(e[l]);$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");l=0;for(n=k.length;l<n;l+=1)p=ab[c][$.inArray(k[l],Na[c])]+"_Pin"+k[l],p=p.replaceSpecialCharacters(),$("#moduleTree").jstree("check_node",$("#"+p))}}]});$("#conflictDialog").dialog("widget").draggable("option","axis","x y");$("#conflictDialog").dialog("widget").draggable({containment:"window",
scroll:!1});z=u=y=v=null}}if(b&&a)if(1===e.length&&-1!==d.indexOf("_Pin")){if($("#"+d).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),-1!==d.indexOf("_")){$("#"+d.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");var F=!1;$("#"+x(c)+"_Root").find("li").each(function(J,aa){if($("#"+$(aa).attr("id")).hasClass("jstree-checked")||$("#"+$(aa).attr("id")).hasClass("jstree-undetermined"))return F=!0,$("#"+
x(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1});F||($("#"+d.slicePriorToX("_")).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+x(c)+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"));$("#"+d.restorePinTreeNodeName()+"_Intermediate").find("li").each(function(J,aa){if($("#"+$(aa).attr("id")).hasClass("jstree-checked"))return $("#"+d.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),
$("#"+x(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1})}}else for(l=0,n=e.length;l<n;l+=1){t=ab[c][l];d=t+"_Pin"+e[l];d=d.replaceSpecialCharacters();F=!1;t=0;for(b=xa.length;t<b;t+=1)e[l]===parseInt(xa[t].slicePriorToX(":"),10)&&0===d.indexOf(xa[t].sliceAfterX(":"))&&(F=!0);F||($("#"+d).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+x(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"));
-1!==d.indexOf("_")&&($("#"+d.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),F=!1,$("#"+x(c)+"_Root").find("li").each(f),F||($("#"+d.slicePriorToX("_")).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+x(c)+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")),$("#"+d.restorePinTreeNodeName()+"_Intermediate").find("li").each(h))}else{if(a){if(-1!==$.inArray(d.restorePinTreeNodeName()+
"_Intermediate",zb))for(l=0,n=pa.length;l<n;l+=1)pa[l].restorePinTreeNodeName()===d.restorePinTreeNodeName()&&d!==pa[l]&&t.jstree("uncheck_node",$("#"+pa[l]));if(1===e.length&&0===d.indexOf("EBI")&&(v=la[parseInt(d.sliceAfterX("_Pin"),10)-1],v.indexOf("EBI")!==v.lastIndexOf("EBI")))for(;-1!==v.indexOf("EBI");)v=v.slice(v.indexOf("EBI")),-1!==v.indexOf("/")?(d.restorePinTreeNodeName()!==v.slice(v.indexOf("EBI"),v.indexOf("/"))&&t.jstree("uncheck_node",$("#"+v.slice(v.indexOf("EBI"),v.indexOf("/"))+
"_Pin"+d.sliceAfterX("_Pin"))),v=v.slice(v.indexOf("/")+1)):(d.restorePinTreeNodeName()!==v.slice(v.indexOf("EBI"))&&t.jstree("uncheck_node",$("#"+v.slice(v.indexOf("EBI"))+"_Pin"+d.sliceAfterX("_Pin"))),v=v.slice(1))}v=e.length;if(a)if(1===e.length&&-1!==d.indexOf("_Pin"))Ab(e[0]-1,d.restorePinTreeNodeName(),!1);else for(l=0,n=e.length;l<n;l+=1)t=ab[c][l],Ab(e[l]-1,t,!1);else for(l=0,n=e.length;l<n;l+=1)if(c===Va[e[l]-1]||""===Va[e[l]-1])Va[e[l]-1]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e[l]-
1],Ab(e[l]-1,"",!0);if(a){if(0<xb.length)q="#FAB92D";else if(0!==Ga.length)for(t=0,b=Ga.length;t<b;t+=1)Ga[t]===e[l]&&Ga.splice(t,1);for(l=0;l<v;l+=1){w=!1;t=0;for(b=xa.length;t<b;t+=1)if(e[l]===parseInt(xa[t].slicePriorToX(":"),10)){xa[t]=e[l]+":"+c;w=!0;break}w||xa.push(e[l]+":"+c);1!==e.length?Bb(e[l]-1,c):-1!==d.indexOf("_Pin")?Bb(e[l]-1,d.restorePinTreeNodeName(),!0):Bb(e[l]-1,d);yb(e[l],q);Va[e[l]-1]=c}}else for(l=0;l<v;l+=1)if(q=$.inArray(e[l]+":"+c,xa),-1!==q&&(xa.splice(q,1),Bb(e[l]-1,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e[l]-
1]),yb(e[l],"#FFFFFF"),0!==Ga.length))for(t=0,b=Ga.length;t<b;t+=1)Ga[t]===e[l]&&Ga.splice(t,1);fb();if(a)if(1===e.length&&-1!==d.indexOf("_Pin"))Ob(d,e[0],!0);else for(l=0,n=e.length;l<n;l+=1)t=ab[c][l],Ob(t+"_Pin"+e[l],e[l],!0);else for(l=0,n=e.length;l<n;l+=1)t=ab[c][l],Ob(t+"_Pin"+e[l],e[l],!1);b=null;g=[];k=[];r=[];F=q=w=v=t=t=p=w=v=null}}function vb(a,d,c,e){function f(J,aa){u=$(aa).attr("id");if("red"===$("#"+u+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+u+" >a").css("color")||y)$("#"+u).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
else{y=!0;t=[];t[0]=parseInt(u.sliceAfterX("Pin"),10);""!==W&&(F=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),F!==t[0].toString()&&"removed"!==F&&"end"!==F&&(W+=D[parseInt(F,10)-1]+":"+F+"/end;"));W+=u.restorePinTreeNodeName()+":"+t[0];l=0;for(b=k.length;l<b;l+=1)if(0===k[l].indexOf(u.restorePinTreeNodeName()+"_Pin")){W+="/"+k[l].sliceAfterX("Pin");k.splice(l,1);break}W+=";";Pa(u,q,t);$("#"+u).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");$("#"+u+" >a").css("color",
"blue")}}function h(J,aa){u=$(aa).attr("id");w=parseInt(u.sliceAfterX("Pin"),10);-1===$.inArray(w,c)&&(z=Lb(u,c,0,k));if(z)return!1}var n,b;var g=$("#moduleTree");var k=[],r=[];var v=0;for(n=c.length;v<n;v+=1){var w=c[v];if(-1!==$.inArray(w.toString(),e)){var p=D[w-1]+"_Pin"+w;p=p.replaceSpecialCharacters();g.jstree("uncheck_node",$("#"+p));k.push(p);if(!$("#"+p).hasClass("jstree-unchecked")){var q=x(p.slicePriorToX("_"));var t=[];t[0]=w;tb(p,q,t);if("undefined"!==typeof B[q]){var l=0;for(b=B[q].length;l<
b;l+=1)if(B[q][l]===p){B[q][l]="";break}l=0;for(b=B[q].length;l<b&&""===B[q][l];l+=1)l===b-1&&$("#"+q+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}g.jstree("close_node",$("#"+q+"_Root"))}-1!==$.inArray(p,pa)&&r.push(p.restorePinTreeNodeName()+"_Intermediate")}}if(1===c.length&&-1!==a.indexOf("_Pin"))g.jstree("check_node",$("#"+a));else for(v=0,n=c.length;v<n;v+=1)for(l=0,b=Na[d].length;l<b;l+=1)Na[d][l]===c[v]&&(a=ab[d][l].replaceSpecialCharacters(),g.jstree("check_node",
$("#"+a+"_Pin"+c[v])));if(0<r.length){v=0;for(n=r.length;v<n;v+=1){var y=!1;q=x(r[v].slicePriorToX("_"));if(0<$("#"+r[v]).find("li").length)$("#"+r[v]).find("li").each(f);else{var u=r[v].restorePinTreeNodeName();l=0;for(b=pa.length;l<b;l+=1)if(0===pa[l].indexOf(u+"_Pin")){w=pa[l].sliceAfterX("_Pin");var z=!1;d=0;for(g=xa.length;d<g;d+=1)if(xa[d].slicePriorToX(":")===w){z=!0;break}if(!z){y=!0;u=pa[l];t=[];t[0]=parseInt(u.sliceAfterX("Pin"),10);if(""!==W){var F=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";");
F!==t[0].toString()&&"removed"!==F&&"end"!==F&&(W+=D[parseInt(F,10)-1]+":"+F+"/end;")}W+=u.restorePinTreeNodeName()+":"+t[0];l=0;for(b=k.length;l<b;l+=1)if(0===k[l].indexOf(u.restorePinTreeNodeName()+"_Pin")){W+="/"+k[l].sliceAfterX("Pin");k.splice(l,1);break}W+=";";Pa(u,q,t);d=0;for(g=Ka.length;d<g;d+=1)if(0===Ka[d].indexOf(u.restorePinTreeNodeName()+"_Pin")){Ka.splice(d,1);break}Ka.push(u);"undefined"===typeof B[q]?(B[q]=[],B[q][0]=u):B[q].push(u);break}}}if(y)$("#"+q+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
$("#"+r[v]).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");else{z=!1;if(0<$("#"+r[v]).find("li").length)$("#"+r[v]).find("li").each(h);else for(u=r[v].restorePinTreeNodeName(),l=0,b=pa.length;l<b&&(0!==pa[l].indexOf(u+"_Pin")||(w=parseInt(pa[l].sliceAfterX("_Pin"),10),-1===$.inArray(w,c)&&(z=Lb(pa[l],c,0,k)),!z));l+=1);z||$("#"+r[v]).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}}fb()}""!==W&&(F=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),
"removed"!==F&&"end"!==F&&(W+=D[parseInt(F,10)-1]+":"+F+"/end;"));l=0;for(b=k.length;l<b;l+=1)W+=k[l].restorePinTreeNodeName().restoreSpecialCharacters()+":"+k[l].sliceAfterX("_Pin")+"/removed;";""!==W&&Xc(W);q=g=a=u=p=a=F=w=g=d=b=l=n=v=null;t=[];k=[];r=[];z=y=null}function Lb(a,d,c,e){function f(z,F){t=$(F).attr("id");t!==a&&$("#"+t).hasClass("jstree-checked")&&(w=!0,""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+
":"+u+"/end;")),W+=a.restorePinTreeNodeName()+":"+b[0]+"/"+t.sliceAfterX("Pin")+";");t!==a&&$("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}var h,n,b=[],g=[];$("#moduleTree");var k;var r=parseInt(a.sliceAfterX("Pin"),10);var v=D[r-1].replaceSpecialCharacters();if(-1===$.inArray(v+"_Pin"+r,pa)||-1!==$.inArray(r,d)||10<=c)return!1;d.push(r);c+=1;var w=k=!1;g=[];var p=x(v.slicePriorToX("_"));var q=v+"_Intermediate";if(0<$("#"+q).find("li").length)$("#"+q).find("li").each(function(z,
F){t=$(F).attr("id");"red"===$("#"+t+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+t+" >a").css("color")||t.sliceAfterX("_Pin")===r.toString()||k?t.sliceAfterX("_Pin")!==r.toString()&&(g.push(t),$("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):(k=!0,b=[],b[0]=parseInt(t.sliceAfterX("Pin"),10),""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+":"+u+"/end;")),W+=t.restorePinTreeNodeName()+
":"+b[0]+"/"+r+";",Pa(t,p,b),$("#"+t).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),$("#"+t+" >a").css("color","blue"))});else for(q=0,h=pa.length;q<h;q+=1)if(0===pa[q].indexOf(v+"_Pin")){var t=pa[q];var l=t.sliceAfterX("_Pin");if(l===r.toString())w=!0;else{w=!1;var y=0;for(n=xa.length;y<n;y+=1)if(xa[y].slicePriorToX(":")===l){w=!0;break}}if(w||k)t.sliceAfterX("_Pin")!==r.toString()&&g.push(t);else{k=!0;b=[];b[0]=parseInt(t.sliceAfterX("Pin"),10);if(""!==W){var u=
W.slice(W.lastIndexOf("/")+1).slicePriorToX(";");u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+":"+u+"/end;")}W+=t.restorePinTreeNodeName()+":"+b[0]+"/"+r+";";Pa(t,p,b);y=0;for(n=Ka.length;y<n;y+=1)if(0===Ka[y].indexOf(t.restorePinTreeNodeName()+"_Pin")){Ka.splice(y,1);break}Ka.push(t);"undefined"===typeof B[p]?(B[p]=[],B[p][0]=t):B[p].push(t);if("undefined"!==typeof B[p]){q=0;for(h=B[p].length;q<h;q+=1)if(B[p][q]===v+"_Pin"+r){B[p][q]="";break}q=0;for(h=B[p].length;q<h&&
""===B[p][q];q+=1)q===h-1&&$("#"+p+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}break}}if(k){$("#"+v+"_Pin"+r).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");b=[];b[0]=parseInt(a.sliceAfterX("Pin"),10);p=x(a.slicePriorToX("_"));if(0<$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length)$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").each(function(z,F){t=$(F).attr("id");t===a||!$("#"+t).hasClass("jstree-checked")&&
-1===$.inArray(t,e)||(""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+":"+u+"/end;")),W+=a.restorePinTreeNodeName()+":"+b[0]+"/"+t.sliceAfterX("Pin")+";");t!==a&&$("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")});else for(q=0,h=pa.length;q<h;q+=1)if(0===pa[q].indexOf(a.restorePinTreeNodeName()+"_Pin")&&(t=pa[q],t!==a&&(t.restorePinTreeNodeName()===D[parseInt(t.sliceAfterX("Pin"),
10)-1]||-1!==$.inArray(t,e)))){""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+":"+u+"/end;"));W+=a.restorePinTreeNodeName()+":"+b[0]+"/"+t.sliceAfterX("Pin")+";";break}q=0;for(h=e.length;q<h;q+=1)if(0===e[q].indexOf(a.restorePinTreeNodeName()+"_Pin")){e.splice(q,1);break}Pa(a,p,b);$("#"+p+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");$("#"+a.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
$("#"+a).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");$("#"+a+" >a").css("color","blue");if(0===$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length){y=0;for(n=Ka.length;y<n;y+=1)if(0===Ka[y].indexOf(a.restorePinTreeNodeName()+"_Pin")){Ka.splice(y,1);break}Ka.push(a);"undefined"===typeof B[p]?(B[p]=[],B[p][0]=a):B[p].push(a);if("undefined"!==typeof B[p]){q=0;for(h=B[p].length;q<h;q+=1)if(B[p][q]===t){B[p][q]="";break}q=0;for(h=B[p].length;q<h&&""===
B[p][q];q+=1)q===h-1&&$("#"+p+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}return!0}if(0<g.length){for(q=0;q<g.length;q+=1)if(w=Lb(g[q],d,c,e)){b=[];b[0]=parseInt(a.sliceAfterX("Pin"),10);p=x(a.slicePriorToX("_"));w=!1;if(0<$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length)$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").each(f);else for(q=0,h=pa.length;q<h;q+=1)if(0===pa[q].indexOf(a.restorePinTreeNodeName()+"_Pin")&&(t=pa[q],t!==a&&t.restorePinTreeNodeName()===
D[parseInt(t.sliceAfterX("Pin"),10)-1])){w=!0;""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,10)-1]+":"+u+"/end;"));W+=a.restorePinTreeNodeName()+":"+b[0]+"/"+t.sliceAfterX("Pin")+";";break}if(w)for(q=0,h=e.length;q<h;q+=1){if(0===e[q].indexOf(a.restorePinTreeNodeName()+"_Pin")){e.splice(q,1);break}}else{""!==W&&(u=W.slice(W.lastIndexOf("/")+1).slicePriorToX(";"),u!==b[0].toString()&&"removed"!==u&&"end"!==u&&(W+=D[parseInt(u,
10)-1]+":"+u+"/end;"));W+=a.restorePinTreeNodeName()+":"+b[0];q=0;for(h=e.length;q<h;q+=1)if(0===e[q].indexOf(a.restorePinTreeNodeName()+"_Pin")){W+="/"+e[q].sliceAfterX("Pin");t=e[q];e.splice(q,1);break}W+=";"}Pa(a,p,b);$("#"+p+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");$("#"+a.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");$("#"+a).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
$("#"+a+" >a").css("color","blue");if(0===$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length){y=0;for(n=Ka.length;y<n;y+=1)if(0===Ka[y].indexOf(a.restorePinTreeNodeName()+"_Pin")){Ka.splice(y,1);break}Ka.push(a);"undefined"===typeof B[p]?(B[p]=[],B[p][0]=a):B[p].push(a);if("undefined"!==typeof B[p]){q=0;for(h=B[p].length;q<h;q+=1)if(B[p][q]===t){B[p][q]="";break}q=0;for(h=B[p].length;q<h&&""===B[p][q];q+=1)q===h-1&&$("#"+p+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}return!0}return!1}q=
p=u=r=l=n=y=h=q=h=q=null;b=[];g=[];w=k=t=v=null}function Pa(a,d,c){var e,f=c.length;$("#moduleTree");if(0!==Ga.length){var h=0;for(e=Ga.length;h<e;h+=1)Ga[h]===c[n]&&Ga.splice(h,1)}if(1===c.length&&-1!==a.indexOf("_Pin"))Ab(c[0]-1,a.restorePinTreeNodeName(),!1);else{var n=0;for(h=c.length;n<h;n+=1)e=ab[d][n],Ab(c[n]-1,e,!1)}for(n=0;n<f;n+=1){var b=!1;h=0;for(e=xa.length;h<e;h+=1)if(c[n]===parseInt(xa[h].slicePriorToX(":"),10)){xa[h]=c[n]+":"+d;b=!0;break}b||xa.push(c[n]+":"+d);1!==c.length?Bb(c[n]-
1,d):-1!==a.indexOf("_Pin")?Bb(c[n]-1,a.restorePinTreeNodeName(),!0):Bb(c[n]-1,a,!0);yb(c[n],"#41AF88");Va[c[n]-1]=d}if(1===c.length&&-1!==a.indexOf("_Pin"))Ob(a,c[0],!0);else for(n=0,h=c.length;n<h;n+=1)e=ab[d][n],Ob(e+"_Pin"+c[n],c[n],!0);c.length=null}function Wc(a){var d,c,e=$("#moduleTree"),f=[],h=[],n=[],b=[],g=[],k=[],r=[],v;var w=!0;b=[];g=[];k=[];r=[];var p=x(a.slicePriorToX("_"));var q=v=!1;var t=0;e.jstree("open_node",$("#"+a));$("#"+a).find("li").each(function(da,S){y=$(S).attr("id");
if(-1===$.inArray(y,b))if(b.push(y),-1===$.inArray(y,pa))-1!==y.indexOf("_Pin")?(z=D[parseInt(y.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters(),z!==y.restorePinTreeNodeName()?(w=!1,$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):q=!0,"red"!==$("#"+y+" >a").css("color")&&"rgb(255, 0, 0)"!==$("#"+y+" >a").css("color")||-1!==$.inArray(y.sliceAfterX("Pin"),k)||(g.push(y),k.push(y.sliceAfterX("Pin")))):(v=!1,t=0,e.jstree("open_node",$("#"+y)),$("#"+y).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
$("#"+y).find("li").each(function(Ea,bb){ba=$(bb).attr("id");b.push(ba);z=D[parseInt(ba.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();z===ba.restorePinTreeNodeName()?q=v=!0:$("#"+ba).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if("red"===$("#"+ba+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+ba+" >a").css("color"))t+=1;Ea+1===$("#"+y).find("li").length&&!1===v&&(w=!1,t===$("#"+y).find("li").length&&r.push(y),$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"))}));
else{z=D[parseInt(y.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();z===y.restorePinTreeNodeName()?q=v=!0:$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if("red"===$("#"+y+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+y+" >a").css("color"))t+=1;if(da+1===$("#"+a).find("li").length&&!1===v){w=!1;if(t===$("#"+a).find("li").length)for(l=0,d=$("#"+a).find("li").length;l<d;l+=1)if(z=$("#"+a).find("li")[l].id,-1===$.inArray(z.sliceAfterX("Pin"),k)){g.push(z);
k.push(z.sliceAfterX("Pin"));break}$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");l=0;for(d=xa.length;l<d;l+=1)if(xa[l].sliceAfterX(":")===p){v=!0;break}v?$("#"+p+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+p+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}}});if(0<r.length){var l=0;for(d=r.length;l<d;l+=1){var y=r[l];var u=0;for(c=$("#"+y).find("li").length;u<c;u+=1){var z=
$("#"+y).find("li")[u].id;if(-1===$.inArray(z.sliceAfterX("Pin"),k)){g.push(z);k.push(z.sliceAfterX("Pin"));break}}}}q?$("#"+a).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(w)"undefined"!==typeof B[p]&&0<B[p].length&&(B[p].length=0),e.jstree("uncheck_node",$("#"+a));else if(0<g.length){var F="";for(l=0;l<g.length;l+=1)z=g[l].sliceAfterX("Pin"),F="Simplified Chinese"===oa?F+
("\u7b2c"+X(z)+"\u811a\u4f4d\u5df2\u88ab"+ya(D[parseInt(z,10)-1])+"\u4f7f\u7528\u3002<br />"):"Traditional Chinese"===oa?F+("\u7b2c"+X(z)+"\u8173\u4f4d\u5df2\u88ab"+ya(D[parseInt(z,10)-1])+"\u4f7f\u7528\u3002<br />"):F+("Pin"+X(z)+" has been asserted by "+ya(D[parseInt(z,10)-1])+".<br />");if("Simplified Chinese"===oa){u="\u51b2\u7a81\u53d1\u751f";c="\u9810\u671f\u7684"+p+"\u548c\u522b\u7684\u6a21\u7ec4\u51b2\u7a81\u3002\u8bf7\u95ee\u4f60\u8981\u8c03\u6574\u65e7\u7684\u4e14\u6539\u8bbe\u7f6e\u5230\u73b0\u5728\u7684\u6a21\u7ec4\u5417?";
var J="\u8981";var aa="\u4e0d\u8981"}else"Traditional Chinese"===oa?(u="\u885d\u7a81\u767c\u751f",c="\u9810\u671f\u7684"+p+"\u548c\u5225\u7684\u6a21\u7d44\u885d\u7a81\u3002\u8acb\u554f\u4f60\u8981\u8abf\u6574\u820a\u7684\u4e14\u6539\u8a2d\u7f6e\u5230\u73fe\u5728\u7684\u6a21\u7d44\u55ce?",J="\u8981",aa="\u4e0d\u8981"):(u="Conflict Occurred",c="The expected "+p+" conflicts with other modules. Would you like to adjust the old modules and configure to the current one?",J="Yes",aa="No");Ma();$('<div id="conflictDialog"><p>'+
c+"<br />"+F+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:u,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#conflictDialog").dialog("destroy")},buttons:[{text:J,click:function(){n=za(L);Sb=[];l=0;for(d=n.length;l<d;l+=1)Sb[n[l]]=L[n[l]];Nb=[];l=0;for(d=Fa.length;l<d;l+=1)Nb[l]=Fa[l];ja="";l=0;for(d=D.length;l<d;l+=1)""!==D[l]&&(ja+="Pin"+(l+1)+":"+ya(D[l])+"\r");hc(a);W="";f=[];h=[];for(l=0;l<g.length;l+=1)f.push(parseInt(g[l].sliceAfterX("Pin"),
10)),h.push(g[l].sliceAfterX("Pin"));p=x(g[0].slicePriorToX("_"));vb(g[0],p,f,h)}},{text:aa,click:function(){$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");hc(a)}}]});$("#conflictDialog").dialog("widget").draggable("option","axis","x y");$("#conflictDialog").dialog("widget").draggable({containment:"window",scroll:!1});aa=J=c=u=null}else hc(a);fb();var ba=y=p=e=c=u=d=l=null;b=[];n=[];q=w=v=null}function hc(a){function d(t,l){q=$(l).attr("id");k=D[parseInt(q.sliceAfterX("_Pin"),
10)-1].replaceSpecialCharacters();if(k===q.restorePinTreeNodeName())return v=r=!0,!1}function c(t,l){q=$(l).attr("id");"red"===$("#"+q+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+q+" >a").css("color")||v||(n=q.restorePinTreeNodeName()+"_Intermediate",h=[],h[0]=parseInt(q.sliceAfterX("Pin"),10),Pa(q,w,h),v=r=!0);k=D[parseInt(q.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();k===q.restorePinTreeNodeName()?$("#"+q).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"):
$("#"+q).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}var e,f=$("#moduleTree"),h=[],n,b,g=[],k,r;var v=r=!1;g=[];var w=x(a.slicePriorToX("_"));$("#"+a).find("li").each(function(t,l){b=$(l).attr("id");-1!==b.indexOf("_Pin")&&-1===$.inArray(b.restorePinTreeNodeName()+"_Intermediate",g)?("red"===$("#"+b+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+b+" >a").css("color")||v||(-1===$.inArray(b,pa)?(h=[],h[0]=parseInt(b.sliceAfterX("Pin"),10),Pa(b,w,h),r=!0):(r=!1,n=b.restorePinTreeNodeName()+
"_Intermediate",f.jstree("open_node",$("#"+n)),$("#"+n).find("li").each(function(y,u){q=$(u).attr("id");k=D[parseInt(q.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();if(k===q.restorePinTreeNodeName())return r=!0,!1}),r||(h=[],h[0]=parseInt(b.sliceAfterX("Pin"),10),Pa(b,w,h)),v=r=!0)),k=D[parseInt(b.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters(),k===b.restorePinTreeNodeName()?$("#"+b).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"):$("#"+b).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):
-1!==b.indexOf("_Intermediate")&&g.push(b)});var p=0;for(e=g.length;p<e;p+=1)v=!1,f.jstree("open_node",$("#"+g[p])),$("#"+g[p]).find("li").each(d),$("#"+g[p]).find("li").each(c),v?$("#"+g[p]).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+g[p]).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");r?($("#"+a).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),$("#"+w+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined")):
$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");fb();w=f=e=p=null;h=[];var q=b=n=null;g=[];v=r=k=null}function tb(a,d,c){var e,f;var h=c.length;for(e=0;e<h;e+=1){var n=$.inArray(c[e]+":"+d,xa);if(-1!==n&&(xa.splice(n,1),Bb(c[e]-1,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c[e]-1]),Va[c[e]-1]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c[e]-1],0!==Ga.length))for(n=0,f=Ga.length;n<f;n+=1)Ga[n]===c[e]&&Ga.splice(n,1)}e=0;for(h=c.length;e<
h;e+=1)d!==Va[c[e]-1]&&(Ab(c[e]-1,"",!0),Ob(a+"_Pin"+c[e],c[e],!1)),yb(c[e],"#FFFFFF")}function Ab(a,d,c){var e;var f=-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?ua.getContext($("#pin_side_0")[0]):ua.getContext($("#NUC_PinConfiguration_Canvas")[0]);c||-1===d.indexOf("_dot")&&2!==d.indexOf(".")||-1!==$.inArray(a,Fa)||("undefined"===typeof Fa?Fa[0]=a:Fa.push(a));if(c&&0!==Fa.length){var h=0;for(e=Fa.length;h<e;h+=1)Fa[h]===a&&Fa.splice(h,1)}d=d.restorePinTreeNodeName().restoreSpecialCharacters();
D[a]=c?"":d;d=ya(d);f.font="12px Arial";-1!==E.indexOf("SOP")?(e=a-Math.floor(a/Q*2)*Q/2,a<=Q/2-1?(h=R-40-3,e=V+na+e*(16+ka)+12.8,f.save(),f.fillStyle="#FFFFFF",f.fillRect(h-Za/2+1,e-12.8-2-1,Za/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],h-f.measureText(la[a]).width,e),c||f.fillText(d,h-f.measureText(d).width,e),f.restore()):(h=R+A/2+40+3,e=V+A-na-16-e*(16+ka)+12.8,f.fillStyle="#FFFFFF",f.fillRect(h,e-12.8-2-1,Za/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],h,e),c||f.fillText(d,h,
e))):-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?(h=na+30+Math.floor(a/Qa)*(60+ka),e=na+30+(Qa-1-a%Qa)*(60+ka),f.beginPath(),f.arc(h,e,30,0,2*Math.PI,!0),f.fillStyle="#FFFFFF",f.fill(),f.fillStyle="#000000",""===d&&(d=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a]),6<d.length&&(d=d.slice(0,6)+".."),f.fillText(d,h-f.measureText(d).width/2,e+parseInt(f.font,10)/2)):a<K?(e=a+Math.floor((Ra-K)/2),h=R+na+e*(16+ka),e=V+A+40,f.save(),f.translate(h,e),f.rotate(-Math.PI/2),f.textAlign="end",
f.fillStyle="#FFFFFF",f.fillRect(-qb/2-3,-3,qb/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],-3,12.8),c||f.fillText(d,-3,12.8),f.restore()):a>=K&&a<K+ea?(e=a-K+Math.floor((Ra-ea)/2),h=R+A+40+3,e=V+A-na-16-e*(16+ka)+12.8,f.fillStyle="#FFFFFF",f.fillRect(h,e-12.8-2-1,Za/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],h,e),c||f.fillText(d,h,e)):a>=K+ea&&a<K+ea+Aa?(e=a-K-ea+Math.floor((Ra-Aa)/2),h=R+A-na-16-e*(16+ka),e=V-40,f.save(),f.translate(h,e),f.rotate(-Math.PI/2),f.fillStyle="#FFFFFF",
f.fillRect(4,-3,qb/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],6,12),c||f.fillText(d,6,12),f.restore()):a>=K+ea+Aa&&a<Q&&(e=a-K-ea-Aa+Math.floor((Ra-lb)/2),h=R-40-3,e=V+na+e*(16+ka)+12.8,f.save(),f.fillStyle="#FFFFFF",f.fillRect(h-Za/2+1,e-12.8-2-1,Za/2,20),f.fillStyle="#000000",c&&La&&f.fillText(la[a],h-f.measureText(la[a]).width,e),c||f.fillText(d,h-f.measureText(d).width,e),f.restore())}function Ob(a,d,c){function e(v,w){if("red"===$("#"+$(w).attr("id")+" >a").css("color")||"rgb(255, 0, 0)"===
$("#"+$(w).attr("id")+" >a").css("color"))return $("#"+b[r]+" >a").css("color","red"),!1}function f(v,w){if("red"===$("#"+$(w).attr("id")+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+$(w).attr("id")+" >a").css("color"))return $("#"+g[r]+" >a").css("color","red"),!1}var h,n=la[d-1],b=[],g=[];if(c)for(;""!==n;){if(-1!==n.indexOf("/")){c=n.slicePriorToX("/")+"_Pin"+d;var k=n.slicePriorToX("/")+"_Intermediate"}else c=n+"_Pin"+d,k=n+"_Intermediate";c=c.replaceSpecialCharacters();k=k.replaceSpecialCharacters();
a=a.replaceSpecialCharacters();if(c.restorePinTreeNodeName()!==a.restorePinTreeNodeName()){if("red"!==$("#"+c+" >a").css("color")||"rgb(255, 0, 0)"!==$("#"+c+" >a").css("color"))$("#"+c+" >a").css("color","red"),$("#"+k+" >a").css("color","red"),-1!==c.indexOf("_")&&$("#"+x(c.slicePriorToX("_"))+"_Root >a").css("color","red")}else if("black"!==$("#"+c+" >a").css("color")||"rgb(0, 0, 0)"!==$("#"+c+" >a").css("color"))$("#"+c+" >a").css("color","black"),$("#"+k+" >a").css("color","black"),-1===$.inArray(k,
b)&&b.push(k),-1!==c.indexOf("_")&&(c=x(c.slicePriorToX("_"))+"_Root",0===$("#"+c).find("li").length&&"red"===$("#"+c+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+c+" >a").css("color")||($("#"+c+" >a").css("color","black"),-1===$.inArray(c,g)&&g.push(c)));n=-1!==n.indexOf("/")?n.sliceAfterX("/"):""}else for(;""!==n;){-1!==n.indexOf("/")?(c=n.slicePriorToX("/")+"_Pin"+d,k=n.slicePriorToX("/")+"_Intermediate"):(c=n+"_Pin"+d,k=n+"_Intermediate");c=c.replaceSpecialCharacters();k=k.replaceSpecialCharacters();
if(c.restorePinTreeNodeName()===D[d-1].replaceSpecialCharacters()||""===D[d-1]){if("black"!==$("#"+c+" >a").css("color")||"rgb(0, 0, 0)"!==$("#"+c+" >a").css("color"))if($("#"+c+" >a").css("color","black"),$("#"+k+" >a").css("color","black"),-1===$.inArray(k,b)&&b.push(k),-1!==c.indexOf("_")&&(c=x(c.slicePriorToX("_"))+"_Root","red"===$("#"+c+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+c+" >a").css("color")))if($("#"+c+" >a").css("color","black"),0!==$("#"+c).find("li").length)-1===$.inArray(c,
g)&&g.push(c);else{c=c.restorePinTreeNodeName();var r=0;for(k=Na[c].length;r<k;r+=1)for(a=0,h=xa.length;a<h;a+=1)if(Na[c][r]===parseInt(xa[a].slicePriorToX(":"),10)&&c!==xa[a].sliceAfterX(":")){$("#"+c+"_Root >a").css("color","red");break}}}else if("red"!==$("#"+c+" >a").css("color")||"rgb(255, 0, 0)"!==$("#"+c+" >a").css("color"))$("#"+c+" >a").css("color","red"),$("#"+k+" >a").css("color","red"),-1!==c.indexOf("_")&&$("#"+x(c.slicePriorToX("_"))+"_Root >a").css("color","red");n=-1!==n.indexOf("/")?
n.sliceAfterX("/"):""}r=0;for(k=b.length;r<k;r+=1)$("#"+b[r]).find("li").each(e);r=0;for(k=g.length;r<k;r+=1)$("#"+g[r]).find("li").each(f);h=k=a=r=c=k=c=n=null}function Yb(a){function d(y,u){return y-u}var c,e,f,h=$("#moduleTree"),n=$("#searchInput_Pin"),b=a,g=[],k=[],r=[];if(/^\d+$/.test(a)||2>a.length||15<a.length||0===a.toLowerCase().indexOf("pin:")&&4===a.length)h.jstree("close_all"),h.jstree("clear_search"),""!==a&&(sb(),2>a.length?Sa("\u6700\u5c0f\u8f93\u5165\u5b57\u5143\u4e3a\u4e24\u4e2a\u3002\u8bf7\u66f4\u6362\u81f3\u66f4\u5408\u9002\u7684\u641c\u5bfb\u3002",
"\u6700\u5c0f\u8f38\u5165\u5b57\u5143\u70ba\u5169\u500b\u3002\u8acb\u66f4\u63db\u81f3\u66f4\u5408\u9069\u7684\u641c\u5c0b\u3002","The minimum inputting characters are two. Please change to a proper search."):Sa("\u9884\u671f\u7684\u641c\u5bfb\u5c06\u82b1\u8d39\u5f88\u591a\u65f6\u95f4\u3002\u8bf7\u66f4\u6362\u81f3\u66f4\u5408\u9002\u7684\u641c\u5bfb\u3002","\u9810\u671f\u7684\u641c\u5c0b\u5c07\u82b1\u8cbb\u5f88\u591a\u6642\u9593\u3002\u8acb\u66f4\u63db\u81f3\u66f4\u5408\u9069\u7684\u641c\u5c0b\u3002",
"The expected search will take much time. Please change to a proper search.")),n.val("");else{try{if(-1!==a.toLowerCase().indexOf("pin:")){a=a.slice(a.toLowerCase().indexOf("pin:")+4);-1!==a.indexOf(")")&&(a=a.slicePriorToX(")"));if(parseInt(a,10)>Q)return;var v=la[parseInt(a,10)-1];r=[];var w=0;for(c=v.length;w<c;w+=1)"/"===v[w]&&r.push(w);if(0===r.length){var p=v;p=x(p);-1!==p.indexOf("_")&&(p=p.slicePriorToX("_"));-1===$.inArray(p,g)&&g.push(p)}else for(w=0,c=r.length+1;w<c;w+=1)p=0===w?v.slice(0,
r[0]):w===c-1?v.slice(r[c-2]+1):v.slice(r[w-1]+1,r[w]),p=x(p),-1!==p.indexOf("_")&&(p=p.slicePriorToX("_")),-1===$.inArray(p,g)&&g.push(p)}else for(w=0;w<Q;w+=1)if(v=la[w],-1!==v.toLowerCase().indexOf(a.toLowerCase())){k=[];var q=0;for(e=v.length;q<e;q+=1)0===v.slice(q).toLowerCase().indexOf(a.toLowerCase())&&k.push(q);r=[];q=0;for(e=v.length;q<e;q+=1)"/"===v[q]&&r.push(q);q=0;for(e=k.length;q<e;q+=1)if(0===r.length)p=v;else{r.push(k[q]);r.sort(d);var t=0;for(f=r.length;t<f;t+=1)if(r[t]===k[q]){var l=
t;break}p=0===l?v.slice(0,r[1]):l===r.length-1?v.slice(r[r.length-2]+1):v.slice(r[l-1]+1,r[l+1]);r.splice(l,1);p=x(p);-1!==p.indexOf("_")&&(p=p.slicePriorToX("_"));-1===$.inArray(p,g)&&g.push(p)}}w=0;for(c=g.length;w<c;w+=1)h.jstree("open_node",$("#"+g[w]+"_Root"));h.jstree("close_all");h.jstree("search",b)}catch(y){}p=n=h=b=e=q=c=w=null;g=[];l=v=null;k=[];r=[]}}function $b(){$("#ChipType").hide();$("#MCU").hide();$("#panel").css("overflow","hidden");$("#ChipType").css("border","white");$("#MCU").css("border",
"white")}function Cb(){var a=$("#panel").height(),d=$("#NUC_PinConfiguration_Canvas").height();Rb?a<d?(N=10*Math.floor(a/d*100/10)-5,0<Hb&&N<Hb&&(N=Hb),ic=N,ub()):ic=100:(N=Hb=100,ub())}function Cc(){$(document).mousedown(function(a){a=a||window.event;a=(a.target||a.srcElement).id;if("panel"===a||"NUC_PinConfiguration_Canvas"===a||"NUC_PinConfiguration_Canvas_Lining"===a)return!1;"ChipTypeSelect"===a&&Tb(function(){$("#ChipTypeSelect").focus()});"MCUselect"===a&&Tb(function(){$("#MCUselect").focus()});
"searchInput_Pin"===a&&$("#searchInput_Pin").val("");a=0;return this})}function Sa(a,d,c){sb();"Simplified Chinese"===oa?window.alert(a):"Traditional Chinese"===oa?window.alert(d):window.alert(c)}function Dc(){var a=!0;Yc(NUTOOL_PIN.g_readConfigFilePath)||(a=!1);NUTOOL_PIN.decidepackageNumber();jc();return a}function jc(){Q=parseInt(NUTOOL_PIN.g_packageNumber.slice(NUTOOL_PIN.g_packageNumber.indexOf(NUTOOL_PIN.g_packageNumber.match(/\d/))),10);33===Q&&(Q=32);-1!==NUTOOL_PIN.g_packageNumberIndex.toLowerCase().indexOf("pin:")?
(K=parseInt(NUTOOL_PIN.g_packageNumberIndex.sliceBetweenXandX("D","R"),10),ea=parseInt(NUTOOL_PIN.g_packageNumberIndex.sliceBetweenXandX("R","U"),10),Aa=parseInt(NUTOOL_PIN.g_packageNumberIndex.sliceBetweenXandX("U","L"),10),lb=parseInt(NUTOOL_PIN.g_packageNumberIndex.sliceBetweenXandX("L",")"),10)):(K=Q/4,ea=Q/4,Aa=Q/4,lb=Q/4);Ra=Math.max(K,ea,Aa,lb);return this}function Ec(){var a=!1;!1===jQuery.support.leadingWhitespace?(Ha=!0,Hb=25,Qb=.5,ac="\f",$("#panel").scroll(function(){$(this).css("border",
"3px solid white")}),ua.getContext=function(c){G_vmlCanvasManager.initElement(c);return c.getContext("2d")},ua.removeContext=function(c){"undefined"!==typeof c[0]&&(G_vmlCanvasManager.uninitElement(c[0]),c.remove())},ua.addEvent=function(c,e,f){c.attachEvent("on"+e,f)}):(Ha=!1,Hb=30,ka=2,Qb=.95,ac="\f",ua.getContext=function(c){return c.getContext("2d")},ua.removeContext=function(c){c.remove()},ua.addEvent=function(c,e,f){c.addEventListener(e,f,!1)},window.MSStream&&($("html").addClass("ie10+"),"undefined"===
typeof NUTOOL_PER&&(Xa("","tabulator/promise-polyfill.js","js"),Xa("","tabulator/js/tabulator.js","js"),Xa("","tabulator/css/tabulator.css","css"))));if($("html").hasClass("ie7")||$("html").hasClass("ie6")){a=!0;var d=$('<div id="belowIE8Dialog"><p>Please upgrade your IE to IE8 or higher version.<br />Otherwise, this tool will not run properly!</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>');d.dialog({modal:!0,title:"Please update your IE!",width:500,height:"auto",
show:"fade",hide:"fade",buttons:[{text:"Cancel",click:function(){$(this).dialog("close")}}]})}return a}function sb(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:")?(oa=a.sliceAfterX("UIlanguage:"),oa=oa.slicePriorToX("\r")):oa="English"}function Fc(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("DisplayTooltip:")?(Ib=a.sliceAfterX("DisplayTooltip:"),Ib=Ib.slicePriorToX("\r"),Mb=
"No"===Ib?!1:!0):(Ib="Yes",Mb=!0)}function Gc(){var a=document.body,d=document.getElementById("panel");mouseWheel=function(c){c=c?c:window.event;if(c.ctrlKey)return c.preventDefault?c.preventDefault():c.returnValue=!1,!1};$("#panel").mousewheel(function(c){!0===window.external.getCtrlState()&&(0<c.deltaY?Hc():0>c.deltaY&&Ic());!0===window.external.getShiftState()&&(0<c.deltaY?d.scrollLeft-=50:0>c.deltaY&&(d.scrollLeft+=50))});a.addEventListener?(a.addEventListener("DOMMouseScroll",mouseWheel,!1),
a.addEventListener("mousewheel",mouseWheel,!1)):a.onmousewheel=mouseWheel}function kc(a){return!isNaN(parseFloat(a))&&isFinite(a)}function va(a){return"undefined"!==typeof a&&"P"===a.slice(0,1)&&"."===a.slice(2,3)&&kc(a.sliceAfterX("."))?!0:!1}function lc(){var a,d,c=0,e=0,f=0,h=0;0===$("#NUC_PinConfiguration_Canvas").length&&$("#panel")[0].appendChild($a("canvas","NUC_PinConfiguration_Canvas"));var n=$("#NUC_PinConfiguration_Canvas")[0];var b=ua.getContext(n);b.font="12px Arial";var g=b.measureText("012345678901234567890123456789").width;
ka=Ha?0:2;na=20;if(-1!==E.indexOf("SOP")){n=0;for(d=Q/2;n<d;n+=1){var k="";var r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n];var v=r+":0";var w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[w].f.length-1;0<=a;--a)k+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),0!==a&&(k+="/");break}""===k&&(k=r);la[n]=k;var p="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n+Q/2];v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<
a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){a=0;for(v=NUTOOL_PIN.g_cfg_gpios[w].f.length;a<v;a+=1)p+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[w].f.length-1&&(p+="/");break}""===p&&(p=r);la[n+Q/2]=p;La&&(b.measureText(k).width>c&&(c=b.measureText(k).width),b.measureText(p).width>f&&(f=b.measureText(p).width))}A=Q/2*(16+ka)-ka+2*na;La?(c<g&&(c=g),f<g&&(f=g),e<g&&(e=g),R=c+40+A/4,V=170+A/4):(R=g+40+25,V=195)}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){ka=
14;na=24;mc=Qa=Math.sqrt(Q);n=0;for(d=Q;n<d;n+=1){k="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n];v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[w].f.length-1;0<=a;--a)k+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),0!==a&&(k+="/");break}""===k&&(k=r);la[n]=k}A=Math.sqrt(Q)*(60+ka)-ka+2*na;R=g+40+25;V=g+40+25}else{n=0;for(d=K;n<d;n+=1){k="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n];
v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[w].f.length-1;0<=a;--a)k+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),0!==a&&(k+="/");break}""===k&&(k=r);la[n]=k;La&&b.measureText(k).width>e&&(e=b.measureText(k).width)}n=0;for(d=ea;n<d;n+=1){p="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n+K];v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){a=0;for(v=NUTOOL_PIN.g_cfg_gpios[w].f.length;a<
v;a+=1)p+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[w].f.length-1&&(p+="/");break}""===p&&(p=r);la[n+K]=p;La&&b.measureText(p).width>f&&(f=b.measureText(p).width)}n=0;for(d=Aa;n<d;n+=1){k="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n+K+ea];v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){a=0;for(v=NUTOOL_PIN.g_cfg_gpios[w].f.length;a<v;a+=1)k+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[w].f.length-
1&&(k+="/");break}""===k&&(k=r);la[n+K+ea]=k;La&&b.measureText(k).width>h&&(h=b.measureText(k).width)}n=0;for(d=lb;n<d;n+=1){k="";r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][n+K+ea+Aa];v=r+":0";w=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;w<a;w+=1)if(v===NUTOOL_PIN.g_cfg_gpios[w].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[w].f.length-1;0<=a;--a)k+=NUTOOL_PIN.g_cfg_gpios[w].f[a].slicePriorToX(":"),0!==a&&(k+="/");break}""===k&&(k=r);la[n+K+ea+Aa]=k;La&&b.measureText(k).width>c&&(c=b.measureText(k).width)}A=
Ra*(16+ka)-ka+2*na;La?(c<g&&(c=g),f<g&&(f=g),h<g&&(h=g),e<g&&(e=g),R=c+40+A/4,V=h+40+A/4):(R=g+40+25,V=g+40+25)}La?(Za=R+A+f+40+A/4,qb=V+A+e+40+A/4):(Za=R+A+40+25+g,qb=V+A+40+25+g);Rb?(c=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText,"undefined"!==typeof c&&-1!==c.indexOf("DialogSize:")?(c=c.sliceAfterX("DialogSize:X_"),Ya=parseInt(c.slicePriorToX("Y_"),10),Ua=parseInt(c.slice(c.indexOf("Y_")+2,c.indexOf("\r")),10),792>Ya&&(Ya=792),590>Ua&&(Ua=590)):(Ya=792,Ua=590)):(Ya=screen.availWidth,Ua=
screen.availHeight);Oa=Ua-10}function nc(){var a;var d=0;for(a=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;d<a;d+=1)Va[d]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d],D[d]=""}function Bc(){"NUC400"===m&&"undefined"!==typeof L.GPG_MFPH?mb("GPG_MFPH:0x00001100"):"M451HD"!==m&&"M451LD"!==m&&"M4521"!==m||"undefined"===typeof L.GPF_MFPL?0!==m.indexOf("M47")&&"M480MD"!==m&&"M480LD"!==m&&"AX58200"!==m&&"M251"!==m&&"M261"!==m&&"NDA102SD2"!==m&&"M2351"!==m&&0!==m.indexOf("M030")&&
0!==m.indexOf("M031")||"undefined"===typeof L.GPF_MFPL?"NUC121AE"===m&&"undefined"!==typeof L.GPF_MFPL?mb("GPF_MFPL:0x00110011"):"NANO100AN"!==m&&"NANO100BN"!==m||"undefined"===typeof L.PF_L_MFP?"NANO112"===m&&"undefined"!==typeof L.PF_L_MFP?mb("PF_L_MFP:0x00FFFFFF"):"NUC123AE"===m&&"undefined"!==typeof L.GPF_MFPL?mb("GPF_MFPL:0x00001100"):"NANO103"===m&&"undefined"!==typeof L.GPF_MFPL?mb("GPF_MFPL:0x77777777"):"M051AN"!==m&&"M051BN"!==m&&"M051DN_DE"!==m&&"M058S"!==m&&"MINI51AN"!==m&&"MINI51DE"!==
m&&"MINI55"!==m&&"MINI58"!==m&&"NUC029AE"!==m&&"NUC029TAE"!==m&&"NUC029AN"!==m&&"NM1200"!==m||"undefined"===typeof L.P4_MFP?$("#moduleTree").jstree("check_node",$("#ICE_Root")):mb("P4_MFP:0x000000C0"):mb("PF_L_MFP:0x00007777"):mb("GPF_MFPL:0x000000EE"):mb("GPF_MFPL:0x01100000")}function bc(a){-1===a.indexOf("(")&&(a+="(");0===a.indexOf("NDA102SD2")?a="NDA102SD2":0===a.indexOf("NDA102")?a="NDA102":0===a.indexOf("M05641")?a="M05641":0===a.indexOf("M0564")?a="M0564":0===a.indexOf("M4521")?a="M4521":
0===a.indexOf("M45")||0===a.indexOf("M4TK")?(a=a.slicePriorToX("("),a=a.slice(a.length-4,a.length-3),a="D"===a||"C"===a?"M451LD":"M451HD"):a=0===a.indexOf("M460LD")?"M460LD":0===a.indexOf("M46")?"M460HD":0===a.indexOf("M471")?"M471":0===a.indexOf("M479")?"M479":0===a.indexOf("M48")?-1!==a.indexOf("8AE")||-1!==a.indexOf("CAE")?"M480LD":"M480MD":0===a.indexOf("KM1M7AF")?"KM1M7AF":0===a.indexOf("KM1M7BF")?"KM1M7BF":0===a.indexOf("M253")?"M253":0===a.indexOf("M251")||0===a.indexOf("M252")?"M251":0===
a.indexOf("M256MD2AE")||0===a.indexOf("M254SD2AE")||0===a.indexOf("M254MD2AE")||0===a.indexOf("M256SD2AE")?"M256D":0===a.indexOf("M258SG6AE")||0===a.indexOf("M256QG6AE")||0===a.indexOf("M254KG6AE")||0===a.indexOf("M254SG6AE")||0===a.indexOf("M258QG6AE")||0===a.indexOf("M258KG6AE")?"M258G":0===a.indexOf("M254")||0===a.indexOf("M256")||0===a.indexOf("M258")?"M258":0===a.indexOf("M26")?"M261":0===a.indexOf("M2354")?"M2354":0===a.indexOf("M2351")?"M2351":0===a.indexOf("M0A2")?"M0A21":0===a.indexOf("M231")?
"M231":0===a.indexOf("M030G")?"M030G":0===a.indexOf("M031GG")||0===a.indexOf("M031GT")?"M030G_31G":0===a.indexOf("M030FD2AE")||0===a.indexOf("M030TD2AE")||0===a.indexOf("M030LD2AE")||0===a.indexOf("M032FC1AE")||0===a.indexOf("M032EC1AE")||0===a.indexOf("M032TC1AE")||0===a.indexOf("M032TD2AE")||0===a.indexOf("M032LC2AE")||0===a.indexOf("M032LD2AE")?"M031KM":0===a.indexOf("M031BT")?"M031BT":0===a.indexOf("M032BTAG8AN")||(0===a.indexOf("M031")||0===a.indexOf("M032"))&&"G"===a.charAt(5)?"M031G":0===a.indexOf("M032BTAIAAN")||
(0===a.indexOf("M031")||0===a.indexOf("M032"))&&"I"===a.charAt(5)?"M031I":0===a.indexOf("M031")||0===a.indexOf("M032")?"M031":0===a.indexOf("M0518")?"M0518":0===a.indexOf("M071M")?"M071M":0===a.indexOf("M071Q")||0===a.indexOf("M071V")?"M071QV":0===a.indexOf("M071R1")||0===a.indexOf("M071S")?"M071R1S":0===a.indexOf("ML56")||0===a.indexOf("ML54")?"ML56":0===a.indexOf("ML51")?"D"===a.charAt(5)?"ML5156":"ML51":0!==a.indexOf("MS51")||-1===a.indexOf("C0AE(")&&-1===a.indexOf("C0BE(")&&-1===a.indexOf("B0AE(")?
0!==a.indexOf("MS51")||-1===a.indexOf("B9AE(")&&-1===a.indexOf("B9BE(")?0===a.indexOf("MS51IA9AE")?"MS51_8KDB":0===a.indexOf("MS51")&&-1!==a.indexOf("A9AE(")?"MS51_8K":0===a.indexOf("M0519")?"M0519":0===a.indexOf("M0515LDE")?"M0515LDE":0!==a.indexOf("M05")||-1===a.indexOf("DN(")&&-1===a.indexOf("DE(")?0===a.indexOf("MHC54ZDN")||0===a.indexOf("PL054TDN")?"M051DN_DE":0===a.indexOf("M05")&&-1!==a.indexOf("BN(")?"M051BN":0===a.indexOf("E32")?"M051BN":0===a.indexOf("M058S")?"M058S":0===a.indexOf("M05")&&
-1!==a.indexOf("AN(")?"M051AN":0===a.indexOf("MINI57")?"MINI57":0===a.indexOf("MINI58")?"MINI58":0===a.indexOf("MINI5")&&-1!==a.indexOf("AN(")?"MINI51AN":0===a.indexOf("MINI5")&&-1!==a.indexOf("AE(")||0===a.indexOf("MINI54XFHC")||0===a.indexOf("MINI55")||0===a.indexOf("NVS06AL")?"MINI55":0===a.indexOf("MINI5")&&-1!==a.indexOf("DE(")||0===a.indexOf("MINI54FHC")?"MINI51DE":0===a.indexOf("NUC2201")?"NUC2201":0===a.indexOf("NUC2")&&-1!==a.indexOf("AN(")?"NUC200AN":0===a.indexOf("NUC2")&&-1!==a.indexOf("AE(")?
"NUC200AE":0===a.indexOf("NUC029MDE")?"NUC029MDE":0===a.indexOf("NUC029KGE")?"NUC029KGE":0===a.indexOf("NUC029LDE")||0===a.indexOf("NUC029SDE")?"NUC029xDE":0===a.indexOf("NUC029LGE")||0===a.indexOf("NUC029SGE")?"NUC029xGE":0===a.indexOf("NUC029LEE")||0===a.indexOf("NUC029SEE")?"NUC029xEE":0===a.indexOf("NUC029TAE")?"NUC029TAE":0===a.indexOf("NUC029")&&-1!==a.indexOf("AE(")?"NUC029AE":0===a.indexOf("NUC029")&&-1!==a.indexOf("AN(")?"NUC029AN":0!==a.indexOf("NANO120")&&0!==a.indexOf("NANO100")||-1===
a.indexOf("AN(")?0!==a.indexOf("NANO100")&&0!==a.indexOf("NANO110")&&0!==a.indexOf("NANO120")&&0!==a.indexOf("NANO130")||-1===a.indexOf("BN(")?0===a.indexOf("NANO103")&&-1!==a.indexOf("AE(")?"NANO103":0===a.indexOf("NANO1")&&-1!==a.indexOf("AN(")?"NANO112":0===a.indexOf("NM112")?"NM1120":0===a.indexOf("NM11")||0===a.indexOf("NM12")?"NM1200":0===a.indexOf("NM15")?"NM1500":0===a.indexOf("NUC121")||0===a.indexOf("NUC125")?"NUC121AE":0===a.indexOf("NUC122")&&-1!==a.indexOf("AN(")?"NUC122AN":0!==a.indexOf("NUC123")||
-1===a.indexOf("AN0(")&&-1===a.indexOf("AN1(")?0!==a.indexOf("NUC123")||-1===a.indexOf("AE0(")&&-1===a.indexOf("AE1(")?0!==a.indexOf("NUC1")||-1===a.indexOf("AN(")&&-1===a.indexOf("BN(")?0===a.indexOf("NUC1")&&-1!==a.indexOf("CN(")?"NUC100CN":0===a.indexOf("NUC1")&&-1!==a.indexOf("DN(")?"NUC100DN":0===a.indexOf("NUC1311")?"NUC1311":0===a.indexOf("NUC13")?"NUC131":0===a.indexOf("NUC1261")?"NUC1261":0===a.indexOf("NUC1262")?"NUC1262":0===a.indexOf("NUC126")?"NUC126":0===a.indexOf("NUC505")?"NUC505":
0===a.indexOf("I91")?"ISD9100":0===a.indexOf("I93")?"ISD9300":0===a.indexOf("AX58200")?"AX58200":0===a.indexOf("MA35D1")?"MA35D1":"NUC400":"NUC100AN_BN":"NUC123AE":"NUC123AN":"NANO100BN":"NANO100AN":"M051DN_DE":"MS51_16K":"MS51_32K";return a}function Yc(a){var d,c=!1,e,f="",h="",n=!1,b=[],g=[];ja="";var k=e=$.ajax({url:""===a?"Nu_config.cfg ":"file:///"+a,async:!1}).responseText;if(!e||/^\s*$/.test(e))return ja=e,"undefined"===typeof NUTOOL_PER?"undefined"===typeof NUTOOL_PIN.g_chipType_default||
""===NUTOOL_PIN.g_chipType_default||"undefined"===typeof NUTOOL_PIN.g_partNumber_package_default||""===NUTOOL_PIN.g_partNumber_package_default?("undefined"!==typeof m&&"NUC400"!==m&&(f="NUC_"+m+"_Content.js",Xa(f,"NUC_NUC400_Content.js","js")),E="NUC472VI8AE(LQFP100)",m="NUC400"):("undefined"===typeof m?(h="NUC_"+NUTOOL_PIN.g_chipType_default+"_Content.js",Xa("NUC_NUC400_Content.js",h,"js")):"undefined"!==typeof m&&m!==NUTOOL_PIN.g_chipType_default&&(f="NUC_"+m+"_Content.js",h="NUC_"+NUTOOL_PIN.g_chipType_default+
"_Content.js",Xa(f,h,"js")),E=NUTOOL_PIN.g_partNumber_package_default,m=NUTOOL_PIN.g_chipType_default):("undefined"!==typeof m&&"M251"!==m&&(f="NUC_"+m+"_Content.js",Xa(f,"NUC_M251_Content.js","js")),E="M251EB2AE(TSSOP28)",m="M251"),c;for(;-1!==e.indexOf("\r")&&e.indexOf("\r")<e.indexOf("MCU:");)e=e.sliceAfterX("\r");var r=e.sliceBetweenXandX("MCU:","\r");r=r.trim();var v=bc(r);if(-1===$.inArray(cc(v),dc))return Sa("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u82af\u7247\u578b\u53f7 "+v+" \u4e0d\u6b63\u786e\u3002",
"\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u6676\u7247\u578b\u865f "+v+" \u4e0d\u6b63\u78ba\u3002","The chip type of "+v+" read from the config file is incorrect."),null;"undefined"!==typeof m?(f="NUC_"+m+"_Content.js",h="NUC_"+v+"_Content.js",Xa(f,h,"js")):"undefined"===typeof m&&(f="undefined"===typeof NUTOOL_PER?"undefined"===typeof NUTOOL_PIN.g_chipType_default||""===NUTOOL_PIN.g_chipType_default?"NUC_NUC400_Content.js":"NUC_"+NUTOOL_PIN.g_chipType_default+"_Content.js":"NUC_M251_Content.js",
h="NUC_"+v+"_Content.js",Xa(f,h,"js"));a=0;for(d=NUTOOL_PIN.g_cfg_chips.length;a<d;a+=1)if(NUTOOL_PIN.g_cfg_chips[a].name+"("+NUTOOL_PIN.g_cfg_chips[a].pkg+")"===r){c=!0;break}if(c){if("undefined"!==typeof E)var w=E;else"undefined"===typeof NUTOOL_PER?"undefined"===typeof NUTOOL_PIN.g_chipType_default||""===NUTOOL_PIN.g_chipType_default||"undefined"===typeof NUTOOL_PIN.g_partNumber_package_default||""===NUTOOL_PIN.g_partNumber_package_default?(w="NUC472VI8AE(LQFP100)",m="NUC400"):(w=NUTOOL_PIN.g_partNumber_package_default,
m=NUTOOL_PIN.g_chipType_default):(w="M251EB2AE(TSSOP28)",m="M251");E=r;NUTOOL_PIN.decidepackageNumber();a=0;for(d=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;a<d;a+=1){var p=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a];va(p)&&b.push(p)}if("M451HD"===v||"M451LD"===v||"M4521"===v||"NUC121AE"===v||"M0564"===v||"M05641"===v||0===v.indexOf("NUC126")||"M071QV"===v||"NUC029xGE"===v||"NUC029KGE"===v||"NUC400"===v||0===v.indexOf("M47")||"M480MD"===v||"M480LD"===v||"AX58200"===
v||0===v.indexOf("M25")||"NDA102SD2"===v||"M261"===v||0===v.indexOf("M235")||0===v.indexOf("M030")||0===v.indexOf("M031")||0===v.indexOf("M231")||"NANO103"===v||"NUC505"===v||"NUC123AE"===v||"MA35D1"===v)for(a=0,d=b.length;a<d;a+=1)p=8>parseInt(b[a].sliceAfterX("."),10)?"G"+b[a].slicePriorToX(".")+"_MFPL":"G"+b[a].slicePriorToX(".")+"_MFPH",-1===$.inArray(p,g)&&g.push(p);else if("M0A21"===v||0===v.indexOf("M46"))for(a=0,d=b.length;a<d;a+=1)p="G"+b[a].slicePriorToX(".")+"_MFP"+Math.floor(parseInt(b[a].sliceAfterX("."),
10)/4),-1===$.inArray(p,g)&&g.push(p);else if("NANO100AN"===v||"NANO100BN"===v||"NANO112"===v)for(a=0,d=b.length;a<d;a+=1)p=8>parseInt(b[a].sliceAfterX("."),10)?b[a].slicePriorToX(".")+"_L_MFP":b[a].slicePriorToX(".")+"_H_MFP",-1===$.inArray(p,g)&&g.push(p);else if("NM1500"===v||"M0519"===v||"M051DN_DE"===v||"M051BN"===v||"M051AN"===v||"M058S"===v||"MINI51AN"===v||"MINI51DE"===v||"MINI55"===v||"MINI58"===v||"NUC029AE"===v||"NUC029TAE"===v||"NUC029AN"===v||"NM1200"===v)for(a=0,d=b.length;a<d;a+=1)p=
b[a].slicePriorToX(".")+"_MFP",-1===$.inArray(p,g)&&g.push(p);else if(0===v.indexOf("ML5")||0===v.indexOf("MS51"))for(a=0,d=b.length;a<d;a+=1)p=b[a].slicePriorToX(".")+"MF76543210",-1===$.inArray(p,g)&&g.push(p);else if(0===v.indexOf("KM1M7"))for(a=0,d=b.length;a<d;a+=1)p="IO"+b[a].slicePriorToX(".")+"MD",-1===$.inArray(p,g)&&g.push(p);else for(a=0,d=b.length;a<d;a+=1)p="G"+b[a].slicePriorToX(".")+"_MFP",-1===$.inArray(p,g)&&g.push(p);b="ALT_MFP ALT_MFP1 ALT_MFP2 ALT_MFP3 ALT_MFP4 ALT_MFP5 ALT_MFP6 ALT_MFP7 ALT_MFP8 ALT_MFP9".split(" ");
a=0;for(d=b.length;a<d;a+=1)p=b[a],"undefined"!==typeof NUTOOL_PIN.g_cfg_regDescriptions[p]&&-1===$.inArray(p,g)&&g.push(p);if("MINI55"===v||"NM1200"===v)g.push("ADCHER"),g.push("ADCR"),g.push("PIN_SEL");a=0;for(d=g.length;a<d;a+=1)if(-1===e.indexOf(g[a])){p=g[a];n=!0;E=w;break}}if(c)if(n)Sa("\u5728\u914d\u7f6e\u6863\u91cc\u627e\u4e0d\u5230\u5fc5\u9700\u7684MFP\u6682\u5b58\u5668 "+p+"\u3002","\u5728\u914d\u7f6e\u6a94\u88e1\u627e\u4e0d\u5230\u5fc5\u9700\u7684MFP\u66ab\u5b58\u5668 "+p+"\u3002","The prerequisite MFP register of "+
p+" is missing in the config file."),""!==h&&""!==f&&Xa(h,f,"js"),c=!1;else{if(ja=k,E=r,m=v,$("#ChipTypeSelect").val(cc(m)),f=n=ja,h="SYS->",""!==n&&"undefined"!==typeof n){0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:GPIO_")&&(h="GPIO_MD->");for(Fa=[];-1!==n.indexOf("GPIOpin:");)g=n.slice(n.indexOf("GPIOpin:")),n=g.slice(g.indexOf("GPIOpin:")+8,g.indexOf("\r")),b=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][parseInt(n,
10)],va(b)&&("undefined"===typeof Fa?Fa[0]=parseInt(n,10):Fa.push(parseInt(n,10))),n=g.slice(1);for(Ja={};-1!==n.indexOf("UserDefined:");)g=n.slice(n.indexOf("UserDefined:")),n=g.slice(g.indexOf("UserDefined:")+12,g.indexOf("\r")),b=n.sliceAfterX("=>"),n=n.slicePriorToX("=>"),Ja[n]=b,n=g.slice(1);for(n=f;-1!==n.indexOf(h);)n=n.sliceAfterX(h),b=n.slice(n.indexOf(" = ")+3,n.indexOf("\r")),isNaN(parseInt(b.slice(2),16))?Sa("\u6682\u5b58\u5668\u7684\u503c"+n.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u9519\u8bef\uff0c\u8bf7\u66f4\u6b63\u5b83\u5e76\u91cd\u8f7d\u914d\u7f6e\u6863\u3002",
"\u66ab\u5b58\u5668\u7684\u503c"+n.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u932f\u8aa4\uff0c\u8acb\u66f4\u6b63\u5b83\u4e26\u91cd\u8f09\u914d\u7f6e\u6a94\u3002","The register value of "+n.slicePriorToX("\r")+" in the config file is incorrect.Please correct it and re-load the config file again."):Da[n.slicePriorToX(" = ")]=parseInt(b.slice(2),16),n=n.slice(1);for(n=f;-1!==n.indexOf("ALT_MFP");)n=n.slice(n.indexOf("ALT_MFP")),b=n.slice(n.indexOf(" = ")+3,n.indexOf("\r")),isNaN(parseInt(b.slice(2),
16))?Sa("\u6682\u5b58\u5668\u7684\u503c"+n.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u9519\u8bef\uff0c\u8bf7\u66f4\u6b63\u5b83\u5e76\u91cd\u8f7d\u914d\u7f6e\u6863\u3002","\u66ab\u5b58\u5668\u7684\u503c"+n.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u932f\u8aa4\uff0c\u8acb\u66f4\u6b63\u5b83\u4e26\u91cd\u8f09\u914d\u7f6e\u6a94\u3002","The register value of "+n.slicePriorToX("\r")+" in the config file is incorrect.Please correct it and re-load the config file again."):Da[n.slicePriorToX(" = ")]=
parseInt(b.slice(2),16),n=n.slice(1)}}else Sa("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u5c01\u88c5\u540d\u79f0 "+r+" \u4e0d\u6b63\u786e","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u5c01\u88dd\u540d\u7a31 "+r+" \u4e0d\u6b63\u78ba\u3002","The package name "+r+" read from the config file is incorrect."),""!==h&&""!==f&&Xa(h,f,"js"),E="undefined"===typeof NUTOOL_PER?"undefined"===typeof NUTOOL_PIN.g_partNumber_package_default||""===NUTOOL_PIN.g_partNumber_package_default?"NUC472VI8AE(LQFP100)":NUTOOL_PIN.g_partNumber_package_default:
"M251EB2AE(TSSOP28)";bMismatchedRedundant=null;return c}function oc(){var a=[],d=[],c;var e=0;for(c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;e<c;e+=1){var f=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e];va(f)&&a.push(f)}if("M451HD"===m||"M451LD"===m||"M4521"===m||"NUC121AE"===m||"M0564"===m||"M05641"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC029xGE"===m||"NUC029KGE"===m||"NUC400"===m||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"AX58200"===m||0===m.indexOf("M25")||
"NDA102SD2"===m||"M261"===m||0===m.indexOf("M235")||0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||"NANO103"===m||"NUC505"===m||"NUC123AE"===m||"MA35D1"===m)for(e=0,c=a.length;e<c;e+=1)f=8>parseInt(a[e].sliceAfterX("."),10)?"G"+a[e].slicePriorToX(".")+"_MFPL":"G"+a[e].slicePriorToX(".")+"_MFPH",-1===$.inArray(f,d)&&d.push(f);else if("M0A21"===m||0===m.indexOf("M46"))for(e=0,c=a.length;e<c;e+=1)f="G"+a[e].slicePriorToX(".")+"_MFP"+Math.floor(parseInt(a[e].sliceAfterX("."),10)/
4),-1===$.inArray(f,d)&&d.push(f);else if("NANO100AN"===m||"NANO100BN"===m||"NANO112"===m)for(e=0,c=a.length;e<c;e+=1)f=8>parseInt(a[e].sliceAfterX("."),10)?a[e].slicePriorToX(".")+"_L_MFP":a[e].slicePriorToX(".")+"_H_MFP",-1===$.inArray(f,d)&&d.push(f);else if("NM1500"===m||"M0519"===m||"M051DN_DE"===m||"M051BN"===m||"M051AN"===m||"M058S"===m||"MINI51AN"===m||"MINI51DE"===m||"MINI55"===m||"MINI58"===m||"NUC029AE"===m||"NUC029TAE"===m||"NUC029AN"===m||"NM1200"===m)for(e=0,c=a.length;e<c;e+=1)f=a[e].slicePriorToX(".")+
"_MFP",-1===$.inArray(f,d)&&d.push(f);else if(0===m.indexOf("ML5")||0===m.indexOf("MS51"))for(e=0,c=a.length;e<c;e+=1)f=a[e].slicePriorToX(".")+"MF76543210",-1===$.inArray(f,d)&&d.push(f);else if(0===m.indexOf("KM1M7"))for(e=0,c=a.length;e<c;e+=1)f="IO"+a[e].slicePriorToX(".")+"MD",-1===$.inArray(f,d)&&d.push(f);else for(e=0,c=a.length;e<c;e+=1)f="G"+a[e].slicePriorToX(".")+"_MFP",-1===$.inArray(f,d)&&d.push(f);a="ALT_MFP ALT_MFP1 ALT_MFP2 ALT_MFP3 ALT_MFP4 ALT_MFP5 ALT_MFP6 ALT_MFP7 ALT_MFP8 ALT_MFP9".split(" ");
e=0;for(c=a.length;e<c;e+=1)f=a[e],"undefined"!==typeof NUTOOL_PIN.g_cfg_regDescriptions[f]&&-1===$.inArray(f,d)&&d.push(f);e=0;for(c=d.length;e<c;e+=1)L[d[e]]=0;if("MINI55"===m||"NM1200"===m)L.ADCHER=0,L.ADCR=0,L.PIN_SEL=0}function pc(a,d){var c,e;if("NUC400"===m||"M451HD"===m||"M451LD"===m||"M4521"===m||"NUC505"===m||"NUC121AE"===m||"NUC123AE"===m||"NANO103"===m||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"AX58200"===m||0===m.indexOf("M25")||"NDA102SD2"===m||"M261"===m||0===m.indexOf("M235")||
0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||"M0564"===m||"M05641"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC029xGE"===m||"NUC029KGE"===m||"MA35D1"===m){var f=a.slice(0,2);a=parseInt(a.slice(3),10);8>a&&(e=!0);if(e){f="G"+f+"_MFPL";var h=(L[f]&~(15<<4*a>>>0))>>>0;L[f]=(h|d<<4*a>>>0)>>>0}else f="G"+f+"_MFPH",h=(L[f]&~(15<<4*(a-8)>>>0))>>>0,L[f]=(h|d<<4*(a-8)>>>0)>>>0}else if("M0A21"===m||0===m.indexOf("M46"))f=a.slice(0,2),a=parseInt(a.slice(3),10),e=Math.floor(a/4),f=
"G"+f+"_MFP"+e,h=(L[f]&~(255<<8*(a-4*e)>>>0))>>>0,L[f]=(h|d<<8*(a-4*e)>>>0)>>>0;else if("MINI57"===m||"NM1120"===m||"NDA102"===m)f=a.slice(0,2),a=parseInt(a.slice(3),10),f="G"+f+"_MFP",h=(L[f]&~(15<<4*a>>>0))>>>0,L[f]=(h|d<<4*a>>>0)>>>0;else if("NANO100AN"===m||"NANO100BN"===m||"NANO112"===m)f=a.slice(0,2),a=parseInt(a.slice(3),10),8>a&&(e=!0),e?(f+="_L_MFP",h=(L[f]&~(15<<4*a>>>0))>>>0,L[f]=(h|d<<4*a>>>0)>>>0):(f+="_H_MFP",h=(L[f]&~(15<<4*(a-8)>>>0))>>>0,L[f]=(h|d<<4*(a-8)>>>0)>>>0);else if(0===m.indexOf("ML5")||
0===m.indexOf("MS51"))f=a.slice(0,2),a=parseInt(a.slice(3),10),f+="MF76543210",h=(L[f]&~(15<<4*a>>>0))>>>0,L[f]=(h|d<<4*a>>>0)>>>0;else if(0===m.indexOf("KM1M7"))f=a.slice(0,2),a=parseInt(a.slice(3),10),f="IO"+f+"MD",h=(L[f]&~(15<<4*a>>>0))>>>0,L[f]=(h|d<<4*a>>>0)>>>0;else if("ISD9100"===m||"ISD9300"===m)f=a.slice(0,2),a=parseInt(a.slice(3),10),f="G"+f+"_MFP",h=(L[f]&~(3<<2*a>>>0))>>>0,L[f]=(h|d<<2*a>>>0)>>>0;else if("MINI55"===m||"NM1200"===m){var n=0;for(f=NUTOOL_PIN.g_cfg_gpioMatrix.length;n<f;n+=
1)if(a===NUTOOL_PIN.g_cfg_gpioMatrix[n].f[0]){var b=1;for(c=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;b<c;b+=1){h=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[b];f=h.slicePriorToX("[");e=parseInt(h.slice(h.indexOf("[")+1,h.indexOf("]")),10);var g=parseInt(h.sliceAfterX(":"),10);h=1<<e>>>0;var k=0;d&1<<g&&(k=1<<e>>>0);h=(L[f]&~h)>>>0;L[f]=(h|k)>>>0}break}"P3.2"===a&&1===d&&(L.PIN_SEL=0)}else for(n=0,f=NUTOOL_PIN.g_cfg_gpioMatrix.length;n<f;n+=1)if(a===NUTOOL_PIN.g_cfg_gpioMatrix[n].f[0]){b=1;for(c=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;b<
c;b+=1)h=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[b],f=h.slicePriorToX("["),e=parseInt(h.slice(h.indexOf("[")+1,h.indexOf("]")),10),g=parseInt(h.sliceAfterX(":"),10),h=1<<e>>>0,k=0,d&1<<g&&(k=1<<e>>>0),h=(L[f]&~h)>>>0,L[f]=(h|k)>>>0;break}}function gb(a,d){a=a.replace("GP","P");if("M0519"===m||"M051DN_DE"===m||"M051BN"===m||"M051AN"===m||"M058S"===m||"MINI51AN"===m||"MINI51DE"===m||"MINI55"===m||"MINI58"===m||"NUC029AE"===m||"NUC029TAE"===m||"NUC029AN"===m||"NM1200"===m||"NM1500"===m)a=8*parseInt(a.slice(1,
2),16)+parseInt(a.slice(3),10);else if(0===m.indexOf("ML5")||0===m.indexOf("MS51"))a=8*parseInt(a.slice(1,2),16)+d;else if(0===m.indexOf("KM1M7")){var c=a.indexOf("P");a=8*parseInt(a.slice(c+1,c+2),16)+d}else a="MINI57"===m||"NM1120"===m||"NDA102"===m||"M0A21"===m?8*(a.slice(1,2).charCodeAt(0)-65)+d:16*(a.slice(1,2).charCodeAt(0)-65)+d;return a}function mb(a){var d,c,e,f,h,n=$("#moduleTree");var b=f=parseInt(a.toLowerCase().slice(a.indexOf("0x")+2),16);if("NUC400"===m||"M451HD"===m||"M451LD"===m||
"M4521"===m||"NANO100AN"===m||"NANO100BN"===m||"NANO112"===m||"NUC505"===m||"NUC121AE"===m||"NUC123AE"===m||"NANO103"===m||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"AX58200"===m||0===m.indexOf("M25")||"NDA102SD2"===m||"M261"===m||0===m.indexOf("M235")||0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||"M0564"===m||"M05641"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC029xGE"===m||"NUC029KGE"===m||"MINI57"===m||"NM1120"===m||"NDA102"===m||"MA35D1"===m){var g=-1!==a.indexOf("MFPH")||
-1!==a.indexOf("_H_MFP")?!1:!0;for(d=0;8>d;d+=1){var k=15<<4*d>>>0;if(h=(f&k)>>>4*d>>>0){var r=g?d:d+8;var v="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+r.toString();var w=$.inArray(v,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);if(-1!==w){var p="";var q=gb(a,r);r=1;for(c=NUTOOL_PIN.g_cfg_gpios[q].f.length;r<c;r+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[q].f[r].indexOf(":"+h)){p=NUTOOL_PIN.g_cfg_gpios[q].f[r];p=p.slicePriorToX(":");break}if(""===p){b&=~k;continue}h=p;h=x(h);p=p.replaceSpecialCharacters();
-1!==h.indexOf("_")&&(h=h.slicePriorToX("_"));n.jstree("check_node",$("#"+p+"_Pin"+(w+1)));$("#"+p+"_Pin"+(w+1)).hasClass("jstree-checked")||(n.jstree("open_node",$("#"+h+"_Root")),n.jstree("open_node",$("#"+p+"_Intermediate")),n.jstree("check_node",$("#"+p+"_Pin"+(w+1))))}else b&=~k}f&=~k;if(0===f)break}}else if("M0A21"===m||0===m.indexOf("M46"))for(g=parseInt(a.substr(-1),10),d=0;4>d;d+=1){k=255<<8*d>>>0;if(h=(f&k)>>>8*d>>>0)if(r=d+4*g,v="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+r.toString(),
w=$.inArray(v,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==w){p="";q=gb(a,r);r=1;for(c=NUTOOL_PIN.g_cfg_gpios[q].f.length;r<c;r+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[q].f[r].indexOf(":"+h)){p=NUTOOL_PIN.g_cfg_gpios[q].f[r];p=p.slicePriorToX(":");break}if(""===p){b&=~k;continue}h=p;h=x(h);p=p.replaceSpecialCharacters();-1!==h.indexOf("_")&&(h=h.slicePriorToX("_"));n.jstree("check_node",$("#"+p+"_Pin"+(w+1)));$("#"+p+"_Pin"+(w+1)).hasClass("jstree-checked")||(n.jstree("open_node",$("#"+
h+"_Root")),n.jstree("open_node",$("#"+p+"_Intermediate")),n.jstree("check_node",$("#"+p+"_Pin"+(w+1))))}else b&=~k;f&=~k;if(0===f)break}else if(0===m.indexOf("ML5")||0===m.indexOf("MS51")||0===m.indexOf("KM1M7"))for(d=0;8>d;d+=1){k=15<<4*d>>>0;if(h=(f&k)>>>4*d>>>0)if(r=d,v="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+r.toString(),w=$.inArray(v,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==w){p="";q=gb(a,r);r=1;for(c=NUTOOL_PIN.g_cfg_gpios[q].f.length;r<c;r+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[q].f[r].indexOf(":"+
h)){p=NUTOOL_PIN.g_cfg_gpios[q].f[r];p=p.slicePriorToX(":");break}if(""===p){b&=~k;continue}h=p;h=x(h);p=p.replaceSpecialCharacters();-1!==h.indexOf("_")&&(h=h.slicePriorToX("_"));n.jstree("check_node",$("#"+p+"_Pin"+(w+1)));$("#"+p+"_Pin"+(w+1)).hasClass("jstree-checked")||(n.jstree("open_node",$("#"+h+"_Root")),n.jstree("open_node",$("#"+p+"_Intermediate")),n.jstree("check_node",$("#"+p+"_Pin"+(w+1))))}else b&=~k;f&=~k;if(0===f)break}else if("ISD9100"===m||"ISD9300"===m)for(d=0;16>d;d+=1){k=3<<
2*d>>>0;if(h=(f&k)>>>2*d>>>0)if(r=d,v="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+r.toString(),w=$.inArray(v,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==w){q=gb(a,r);p="";r=1;for(c=NUTOOL_PIN.g_cfg_gpios[q].f.length;r<c;r+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[q].f[r].indexOf(":"+h)){p=NUTOOL_PIN.g_cfg_gpios[q].f[r];p=p.slicePriorToX(":");break}if(""===p){b&=~k;continue}h=p;h=x(h);p=p.replaceSpecialCharacters();-1!==h.indexOf("_")&&(h=h.slicePriorToX("_"));n.jstree("check_node",
$("#"+p+"_Pin"+(w+1)));$("#"+p+"_Pin"+(w+1)).hasClass("jstree-checked")||(n.jstree("open_node",$("#"+h+"_Root")),n.jstree("open_node",$("#"+p+"_Intermediate")),n.jstree("check_node",$("#"+p+"_Pin"+(w+1))))}else b&=~k;f&=~k;if(0===f)break}else for(d=0;32>d;d+=1){k=1<<d>>>0;h=(f&k)>>>d>>>0;w=-1;if(h){var t=a.slice(a.indexOf("P"),a.indexOf(":"))+"["+d+"]";r=0;for(c=NUTOOL_PIN.g_cfg_gpioMatrix.length;r<c;r+=1){var l=1;for(e=NUTOOL_PIN.g_cfg_gpioMatrix[r].f.length;l<e;l+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[r].f[l].indexOf(t)){v=
NUTOOL_PIN.g_cfg_gpioMatrix[r].f[0];w=$.inArray(v,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==w){h=0;l=1;for(e=NUTOOL_PIN.g_cfg_gpioMatrix[r].f.length;l<e;l+=1)p=NUTOOL_PIN.g_cfg_gpioMatrix[r].f[l],g=parseInt(p.slice(p.indexOf("[")+1,p.indexOf("]")),10),k=1<<g>>>0,p.slicePriorToX("["),h+=((f&k)>>>g)*Math.pow(2,l-1),f&=~k;q=8*parseInt(v.slice(1,2),16)+parseInt(v.slice(3),10);p="";l=1;for(e=NUTOOL_PIN.g_cfg_gpios[q].f.length;l<e;l+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[q].f[l].indexOf(":"+
h)){p=NUTOOL_PIN.g_cfg_gpios[q].f[l];p=p.slicePriorToX(":");break}if(""===p)for(l=1,e=NUTOOL_PIN.g_cfg_gpioMatrix[r].f.length;l<e;l+=1)p=NUTOOL_PIN.g_cfg_gpioMatrix[r].f[l],g=parseInt(p.slice(p.indexOf("[")+1,p.indexOf("]")),10),k=1<<g>>>0,b&=~k;else{h=p;h=x(h);p=p.replaceSpecialCharacters();-1!==h.indexOf("_")&&(h=h.slicePriorToX("_"));n.jstree("check_node",$("#"+p+"_Pin"+(w+1)));$("#"+p+"_Pin"+(w+1)).hasClass("jstree-checked")||(n.jstree("open_node",$("#"+h+"_Root")),n.jstree("open_node",$("#"+
p+"_Intermediate")),n.jstree("check_node",$("#"+p+"_Pin"+(w+1))));break}}}-1===w&&(b&=~k)}if(0===f)break}return a=a.slice(0,a.indexOf("0x")+2)+hb(b)}function Jc(a){var d,c,e,f=parseInt(a.toLowerCase().slice(a.indexOf("0x")+2),16),h=[];if("NUC400"===m||"M451HD"===m||"M451LD"===m||"M4521"===m||"NANO100AN"===m||"NANO100BN"===m||"NANO112"===m||"NUC505"===m||"NUC121AE"===m||"NUC123AE"===m||"NANO103"===m||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"AX58200"===m||0===m.indexOf("M25")||"NDA102SD2"===
m||"M261"===m||0===m.indexOf("M235")||0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||"M0564"===m||"M05641"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC029xGE"===m||"NUC029KGE"===m||"MINI57"===m||"NM1120"===m||"NDA102"===m||"MA35D1"===m){var n=-1!==a.indexOf("MFPH")||-1!==a.indexOf("_H_MFP")?!1:!0;for(d=0;8>d;d+=1){var b=n?d:d+8;b="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+b.toString();b=$.inArray(b,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);if(-1!==b&&
""!==D[b]){var g=D[b]+"_Pin"+(b+1);g=g.replaceSpecialCharacters();$("#moduleTree").jstree("uncheck_node",$("#"+g));if(!$("#"+g).hasClass("jstree-unchecked")){var k=x(g.slicePriorToX("_"));h[0]=b+1;tb(g,k,h);$("#"+g).addClass("jstree-unchecked");if("undefined"!==typeof B[k]){var r=0;for(c=B[k].length;r<c;r+=1)if(B[k][r]===g){B[k][r]="";break}r=0;for(c=B[k].length;r<c&&""===B[k][r];r+=1)r===c-1&&$("#"+k+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}}}}if("M0A21"===m||0===
m.indexOf("M46"))for(f=parseInt(a.substr(-1),10),d=0;4>d;d+=1){if(b=d+4*f,b="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+b.toString(),b=$.inArray(b,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==b&&""!==D[b]&&(g=D[b]+"_Pin"+(b+1),g=g.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",$("#"+g)),!$("#"+g).hasClass("jstree-unchecked")&&(k=x(g.slicePriorToX("_")),h[0]=b+1,tb(g,k,h),$("#"+g).addClass("jstree-unchecked"),"undefined"!==typeof B[k]))){r=0;for(c=B[k].length;r<
c;r+=1)if(B[k][r]===g){B[k][r]="";break}r=0;for(c=B[k].length;r<c&&""===B[k][r];r+=1)r===c-1&&$("#"+k+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}else if(0===m.indexOf("ML5")||0===m.indexOf("MS51")||0===m.indexOf("KM1M7"))for(d=0;8>d;d+=1){if(b=d,b="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+b.toString(),b=$.inArray(b,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==b&&""!==D[b]&&(g=D[b]+"_Pin"+(b+1),g=g.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",
$("#"+g)),!$("#"+g).hasClass("jstree-unchecked")&&(k=x(g.slicePriorToX("_")),h[0]=b+1,tb(g,k,h),$("#"+g).addClass("jstree-unchecked"),"undefined"!==typeof B[k]))){r=0;for(c=B[k].length;r<c;r+=1)if(B[k][r]===g){B[k][r]="";break}r=0;for(c=B[k].length;r<c&&""===B[k][r];r+=1)r===c-1&&$("#"+k+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}else if("ISD9100"===m||"ISD9300"===m)for(d=0;16>d;d+=1){if(b=d,b="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+b.toString(),b=$.inArray(b,
NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==b&&""!==D[b]&&(g=D[b]+"_Pin"+(b+1),g=g.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",$("#"+g)),!$("#"+g).hasClass("jstree-unchecked")&&(k=x(g.slicePriorToX("_")),h[0]=b+1,tb(g,k,h),$("#"+g).addClass("jstree-unchecked"),"undefined"!==typeof B[k]))){r=0;for(c=B[k].length;r<c;r+=1)if(B[k][r]===g){B[k][r]="";break}r=0;for(c=B[k].length;r<c&&""===B[k][r];r+=1)r===c-1&&$("#"+k+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}else for(d=
0;32>d;d+=1)if(b=1<<d>>>0,n=(f&b)>>>d>>>0,b=-1,n){var v=a.slice(a.indexOf("P"),a.indexOf(":"))+"["+d+"]";n=0;for(e=NUTOOL_PIN.g_cfg_gpioMatrix.length;n<e;n+=1){r=1;for(c=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;r<c;r+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[n].f[r].indexOf(v)){b=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[0];b=$.inArray(b,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==b&&""!==D[b]&&(g=D[b]+"_Pin"+(b+1),g=g.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",
$("#"+g)),!$("#"+g).hasClass("jstree-unchecked")&&(k=x(g.slicePriorToX("_")),h[0]=b+1,tb(g,k,h),$("#"+g).addClass("jstree-unchecked"),"undefined"!==typeof B[k]))){r=0;for(c=B[k].length;r<c;r+=1)if(B[k][r]===g){B[k][r]="";break}r=0;for(c=B[k].length;r<c&&""===B[k][r];r+=1)r===c-1&&$("#"+k+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}}}function cc(a){var d=a;0===a.indexOf("NUC1")?d="NUC100":0===a.indexOf("NUC2")?d="NUC200":0===a.indexOf("NANO1")?d="NANO100":0===a.indexOf("NDA102")?
d="NDA102":0===a.indexOf("M0518")?d="M0518":0===a.indexOf("M0519")?d="M0519":0===a.indexOf("M0564")?d="M0564":0===a.indexOf("M030G")?d="M030G":0===a.indexOf("M030")||0===a.indexOf("M031")?d="M031":0===a.indexOf("M05")?d="M051":0===a.indexOf("M071")?d="M071":0===a.indexOf("MINI5")?d="MINI51":0===a.indexOf("M25")?d="M251":0===a.indexOf("M235")?d="M2351":0===a.indexOf("M45")?d="M451":0===a.indexOf("M46")?d="M460":0===a.indexOf("M48")?d="M480":0===a.indexOf("KM1M7")?d="KM1M7":0===a.indexOf("NUC029")?
d="NUC029":0===a.indexOf("MS51")?d="MS51":0===a.indexOf("ML5")&&(d="ML51");return d}function x(a){var d;if("undefined"===typeof x.specialModuleNames)if(x.specialModuleNames="PA PB PC PD PE PF PG PH PI PI PI PJ PK PL PM PN P0 P1 P2 P3 P4 P5 P6 P7 P8 P9".split(" "),"NUC400"===m)x.specialModuleNames.push("BRAKE"),x.specialModuleNames.push("INT"),x.specialModuleNames.push("TAMPER");else if(0===m.indexOf("M030G"))x.specialModuleNames.push("DAC"),x.specialModuleNames.push("INT");else if(0===m.indexOf("NUC1262"))x.specialModuleNames.push("LLSI"),
x.specialModuleNames.push("INT");else if(0===m.indexOf("M0A21")||0===m.indexOf("M030")||0===m.indexOf("M031")||0===m.indexOf("M231")||0===m.indexOf("MS51")||"M0564"===m||"M05641"===m||"M0515LDE"===m||"M071M"===m||"MINI58"===m||"NUC029KGE"===m||"NUC029xGE"===m||"NUC121AE"===m||0===m.indexOf("NUC126")||"M071QV"===m||"NUC1311"===m)x.specialModuleNames.push("INT");else if("NM1120"===m)x.specialModuleNames.push("TM");else if("MINI57"===m||"NDA102"===m)x.specialModuleNames.push("TM"),x.specialModuleNames.splice(x.specialModuleNames.indexOf("PG"),
1);else if("M0519"===m)x.specialModuleNames.push("TM"),x.specialModuleNames.push("INT");else if(0===m.indexOf("ML5"))x.specialModuleNames.push("TK"),x.specialModuleNames.push("INT");else if("M451LD"===m||"M451HD"===m||"M4521"===m)x.specialModuleNames.push("TK"),x.specialModuleNames.push("INT"),x.specialModuleNames.push("TAMPER");else if(0===m.indexOf("M46")||0===m.indexOf("M47")||"M480MD"===m||"M480LD"===m||"M251"===m||"M253"===m||"M261"===m||"NDA102SD2"===m||0===m.indexOf("M235")||"AX58200"===m)x.specialModuleNames.push("INT"),
x.specialModuleNames.push("TAMPER");else if(0===m.indexOf("KM1M7")){x.specialModuleNames.push("IRQ");x.specialModuleNames.push("AD");var c=0;for(d=26;c<d;c+=1)10>c?x.specialModuleNames.push("TM0"+c):x.specialModuleNames.push("TM"+c)}else"M256D"===m||"M258"===m||"M258G"===m?(x.specialModuleNames.push("INT"),x.specialModuleNames.push("LCD"),x.specialModuleNames.push("TAMPER")):"NANO100AN"===m?(x.specialModuleNames.push("ADC"),x.specialModuleNames.push("DA"),x.specialModuleNames.push("AD"),x.specialModuleNames.push("PWM0"),
x.specialModuleNames.push("PWM1"),x.specialModuleNames.push("SC0"),x.specialModuleNames.push("SC1"),x.specialModuleNames.push("TC"),x.specialModuleNames.push("SPI"),x.specialModuleNames.push("I2C0"),x.specialModuleNames.push("I2C1"),x.specialModuleNames.push("I2S"),x.specialModuleNames.push("TMR"),x.specialModuleNames.push("TX"),x.specialModuleNames.push("RX")):"NANO100BN"===m?(x.specialModuleNames.push("ADC"),x.specialModuleNames.push("DA"),x.specialModuleNames.push("AD"),x.specialModuleNames.push("TC"),
x.specialModuleNames.push("TM")):"NANO103"===m||"NANO112"===m?x.specialModuleNames.push("AD"):"NUC100AN_BN"===m||"NUC100CN"===m||"NUC100DN"===m?(x.specialModuleNames.push("INT"),x.specialModuleNames.push("ADC"),x.specialModuleNames.push("PWM"),x.specialModuleNames.push("I2C0"),x.specialModuleNames.push("I2C1"),x.specialModuleNames.push("TM"),x.specialModuleNames.push("TXD"),x.specialModuleNames.push("RXD"),x.specialModuleNames.push("RTS"),x.specialModuleNames.push("PS2"),x.specialModuleNames.push("SPI"),
x.specialModuleNames.push("SC0"),x.specialModuleNames.push("SC1"),x.specialModuleNames.push("SC2"),x.specialModuleNames.push("nWR"),x.specialModuleNames.push("I2S"),x.specialModuleNames.push("CTS"),x.specialModuleNames.push("CP"),x.specialModuleNames.push("AD")):"NUC200AE"===m||"NUC200AN"===m?(x.specialModuleNames.push("PWM"),x.specialModuleNames.push("ADC"),x.specialModuleNames.push("INT"),x.specialModuleNames.push("AD")):"NUC2201"===m||"M071R1S"===m||"NUC029xEE"===m?(x.specialModuleNames.push("PWM"),
x.specialModuleNames.push("ADC"),x.specialModuleNames.push("INT"),x.specialModuleNames.push("AD"),x.specialModuleNames.push("nWR")):0===m.indexOf("NUC131")||"M0518"===m||"NUC029xDE"===m||"NUC029MDE"===m?(x.specialModuleNames.push("ADC"),x.specialModuleNames.push("INT")):"NUC122AN"===m?x.specialModuleNames.push("PWM"):"NUC123AN"===m||"NUC123AE"===m?(x.specialModuleNames.push("ADC"),x.specialModuleNames.push("I2S")):"M051DN_DE"===m||"M051AN"===m||"M051BN"===m||"M058S"===m||"NUC029AE"===m||"NUC029TAE"===
m||"NUC029AN"===m?(x.specialModuleNames.push("AD"),x.specialModuleNames.push("AIN"),x.specialModuleNames.push("SPI"),x.specialModuleNames.push("PWM"),x.specialModuleNames.push("T0"),x.specialModuleNames.push("T1"),x.specialModuleNames.push("T2"),x.specialModuleNames.push("T3"),x.specialModuleNames.push("nWR"),x.specialModuleNames.push("CTS"),x.specialModuleNames.push("RTS")):"MINI51AN"===m||"MINI51DE"===m||"MINI55"===m?(x.specialModuleNames.push("AIN"),x.specialModuleNames.push("PWM"),x.specialModuleNames.push("T0"),
x.specialModuleNames.push("T1"),x.specialModuleNames.push("T2"),x.specialModuleNames.push("T3")):"NM1200"===m?(x.specialModuleNames.push("AIN"),x.specialModuleNames.push("PWM")):"NM1500"===m?(x.specialModuleNames.push("AINA"),x.specialModuleNames.push("AINB"),x.specialModuleNames.push("PWM"),x.specialModuleNames.push("INT"),x.specialModuleNames.push("TM")):"ISD9100"!==m&&"ISD9300"!==m||x.specialModuleNames.push("CMP");if("undefined"!==typeof a)for(c=0,d=x.specialModuleNames.length;c<d;c+=1)if(0===
a.indexOf(x.specialModuleNames[c])){a=0!==a.indexOf("ADC")?x.specialModuleNames[c]:"ADC";break}return a}function qc(){NUTOOL_PIN.g_pinFunctionString="";nb="undefined"===typeof NUTOOL_PER?"NUC200AE"===m?'#include "NUC230_240.h"\n':"NUC200AN"===m?'#include "NUC200Series.h"\n':"NANO100AN"===m||"NANO100BN"===m?'#include "Nano100Series.h"\n':"NANO103"===m?'#include "Nano103.h"\n':"NANO112"===m?'#include "Nano1X2Series.h"\n':"NUC100AN_BN"===m||"NUC100CN"===m||"NUC100DN"===m?'#include "NUC100Series.h"\n':
"NUC121AE"===m?'#include "NUC121.h"\n':"NUC122AN"===m?'#include "NUC122.h"\n':"NUC123AN"===m||"NUC123AE"===m?'#include "NUC123.h"\n':0===m.indexOf("M030G")?'#include "M030G.h"\n':0===m.indexOf("M030")||0===m.indexOf("M031")?'#include "M031Series.h"\n':0===m.indexOf("M256D")||0===m.indexOf("M258")||0===m.indexOf("M258G")?'#include "M251.h"\n':0===m.indexOf("M460")?'#include "M460.h"\n':0===m.indexOf("M480")?'#include "M480.h"\n':0===m.indexOf("KM1M7")?'#include "NuMicro.h"\n':"NUC505"===m?'#include "NUC505Series.h"\n':
"M051DN_DE"===m||"M051BN"===m||"M051AN"===m?'#include "M051Series.h"\n':"M451LD"===m||"M451HD"===m?'#include "M451Series.h"\n':"MINI51AN"===m?'#include "Mini51.h"\n':"MINI51DE"===m?'#include "Mini51Series.h"\n':"MINI55"===m?'#include "Mini55Series.h"\n':"MINI57"===m||"NM1120"===m?'#include "Mini57Series.h"\n':"MINI58"===m?'#include "Mini58Series.h"\n':"ML5156"===m?'#include "Function_Define_ML56.h"\n':0===m.indexOf("ML51")?'#include "Function_Define_ML51.h"\n':0===m.indexOf("ML56")?'#include "Function_Define_ML56.h"\n':
0===m.indexOf("MS51_8K")?'#include "MS51_8K.h"\n':"NUC029AN"===m||"NUC029TAE"===m?'#include "NUC029xAN.h"\n':"NUC029AE"===m?'#include "NUC029FAE.h"\n':"NUC029KGE"===m||"NUC029xGE"===m?'#include "NUC029xGE.h"\n':"NUC029xDE"===m?'#include "NUC029xDE.h"\n':"NUC029xEE"===m?'#include "NUC029xEE.h"\n':"NM1200"===m?'#include "Mini51.h"\n':"NM1500"===m?'#include "MT500Series.h"\n':"NUC400"===m?'#include "NUC472_442.h"\n':"M0515LDE"===m||"NDA102SD2"===m||"M071M"===m||"M071QV"===m||"M071R1S"===m?'#include "NuMicro.h"\n':
0===m.indexOf("MA35")?'#include "'+m.toLowerCase()+'.dtsi"\n':'#include "'+m+'.h"\n':'#include "NuCodeGenProj.h"\n'}function hb(a,d){a=Number(a).toString(16);for(d="undefined"===typeof d||null===d?d=8:d;a.length<d;)a="0"+a;return a}function rc(){var a,d,c=[],e=[],f={},h=$("#mfpTree"),n=0;c=za(L);c.sort();var b=0;for(a=c.length;b<a;b+=1)n<c[b].length&&(n=c[b].length);b=0;for(a=c.length;b<a;b+=1){var g={};var k={};var r=c[b];if(r.length<n){var v=0;for(d=n-r.length;v<d;v+=1)r+=ac}k.id=c[b];g.data=r+
":0x"+hb(L[c[b]]);g.attr=k;e[b]=g}k={id:"mfp_tree"};sb();f.data="Simplified Chinese"===oa?"MFP\u5bc4\u5b58\u5668":"Traditional Chinese"===oa?"MFP\u6682\u5b58\u5668":"MFP Registers";f.attr=k;f.state="open";f.children=e;db=18*za(L).length+20>Oa/3?Oa/3:18*za(L).length+20;0===h.length&&($("#rootTree_Pin")[0].appendChild($a("div","mfpTree","Loading...")),h=$("#mfpTree"),$("#ChipType").hover(function(){$(this).css("background-color","#FAFAFA");eb()},function(){$(this).css("background-color","#FFFFFF")}),
$("#MCU").hover(function(){$(this).css("background-color","#FAFAFA");eb()},function(){$(this).css("background-color","#FFFFFF")}));h[0].setAttribute("style","background-color: #FFFFFF; float:left; overflow-y: scroll; width:275px; height: "+db+"px; border-bottom: 5px solid #F2F2F2;");-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?Ha?h.hover(function(){$(this).css("background-color","#FAFAFA");eb();$("#pin_side_0").show();$("#NUC_PinConfiguration_Canvas_Lining").hide()},function(){$(this).css("background-color",
"#FFFFFF");$("#pin_side_0").hide();$("#NUC_PinConfiguration_Canvas_Lining").show()}):h.hover(function(){$(this).css("background-color","#FAFAFA");eb();$("#pin_side_0").css("opacity","0.8");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","0")},function(){$(this).css("background-color","#FFFFFF");$("#pin_side_0").css("opacity","0.1");$("#NUC_PinConfiguration_Canvas_Lining").css("opacity","1")}):h.hover(function(){$(this).css("background-color","#FAFAFA");eb()},function(){$(this).css("background-color",
"#FFFFFF")});h.jstree({json_data:{data:f},themes:{theme:"default",icons:!1},core:{animation:0},plugins:["themes","json_data","ui","crrm"]}).bind("hover_node.jstree",function(w,p){w=p.rslt.obj.attr("id");p=w.slicePriorToX(":");var q="";Mb&&NUTOOL_PIN.g_cfg_regDescriptions.hasOwnProperty(p)&&(-1===NUTOOL_PIN.g_cfg_regDescriptions[p].indexOf("nonexistent")&&(q="Simplified Chinese"===oa?"\u4f4d\u5740: ":"Traditional Chinese"===oa?"\u4f4d\u5740: ":"Address: "),q+=NUTOOL_PIN.g_cfg_regDescriptions[p],$("#"+
w).simpletip({fixed:!0,offset:[60,0]}),$("#"+w).eq(0).simpletip().update(q))}).bind("dblclick.jstree",function(w){w=$(w.target).closest("li")[0].id;"mfp_tree"!==w&&("undefined"===typeof L.ALT_MFP&&"MINI55"!==m&&"NM1200"!==m&&h.jstree("rename",$("#"+w)),$("#"+w).eq(0).simpletip().blockShow(),$("#"+w).eq(0).simpletip().hide())}).bind("rename.jstree",function(w,p){w=p.rslt.obj.attr("id");var q=p.rslt.old_name;p=p.rslt.new_name;var t=!1;"NANO100AN"===m||"NANO100BN"===m||"NANO112"===m?8===p.slice(p.toLowerCase().indexOf("0x")+
2).length&&0===p.toLowerCase().indexOf("p")&&4===p.toLowerCase().lastIndexOf("_mfp")&&8===p.toLowerCase().lastIndexOf(":0x")&&(t=!0):"NM1500"===m||"M0519"===m||"M051DN_DE"===m||"M051BN"===m||"M051AN"===m||"M058S"===m||"MINI51AN"===m||"MINI51DE"===m||"MINI55"===m||"MINI58"===m||"NUC029AE"===m||"NUC029TAE"===m||"NUC029AN"===m||"NM1200"===m?8===p.slice(p.toLowerCase().indexOf("0x")+2).length&&0===p.toLowerCase().indexOf("p")&&2===p.toLowerCase().lastIndexOf("_mfp")&&6===p.toLowerCase().lastIndexOf(":0x")&&
(t=!0):0===m.indexOf("ML5")||0===m.indexOf("MS51")?8===p.slice(p.toLowerCase().indexOf("0x")+2).length&&0===p.toLowerCase().lastIndexOf("p")&&2===p.toLowerCase().lastIndexOf("mf")&&12===p.toLowerCase().lastIndexOf(":0x")&&(t=!0):0===m.indexOf("KM1M7")?8===p.slice(p.toLowerCase().indexOf("0x")+2).length&&0===p.toLowerCase().lastIndexOf("iop")&&4===p.toLowerCase().lastIndexOf("md")&&6===p.toLowerCase().lastIndexOf(":0x")&&(t=!0):8!==p.slice(p.toLowerCase().indexOf("0x")+2).length||0!==p.toLowerCase().lastIndexOf("gp")||
3!==p.toLowerCase().lastIndexOf("_mfp")||7!==p.toLowerCase().lastIndexOf(":0x")&&8!==p.toLowerCase().lastIndexOf(":0x")||(t=!0);t?(Jc(q),mb(p),fb()):h.jstree("rename_node",$("#"+w),q)}).bind("destroy.jstree",function(){d=a=v=b=null;c=[];e=[];r=n=h=k=f=g=null});h.css("font-size","16px");h.css("font-family",'Monaco, Consolas, "Lucida Console", monospace;')}function fb(){var a,d,c=0;var e=za(L);var f=0;for(a=e.length;f<a;f+=1)c<e[f].length&&(c=e[f].length);f=0;for(a=e.length;f<a;f+=1){var h=e[f];if(h.length<
c){var n=0;for(d=c-h.length;n<d;n+=1)h+=ac}$("#mfpTree").jstree("rename_node",$("#"+e[f]),h+":0x"+hb(L[e[f]]).toUpperCase())}}function $a(a,d,c,e){e?(e=document.createElement("input"),e.value=c,e.type=a):(e=document.createElement(a),e.innerHTML=c);e.id=d;return e}function za(a){var d=[],c=0,e;for(e in a)a.hasOwnProperty(e)&&(d[c]=e,c+=1);return d}function Kc(){var a,d,c;if("undefined"!==typeof NUTOOL_PIN.g_cfg_addGPIO&&"undefined"!==typeof NUTOOL_PIN.g_cfg_addGPIO[E]){var e="function"==typeof NUTOOL_PIN.g_cfg_addGPIO[E]?
NUTOOL_PIN.g_cfg_addGPIO[E]():NUTOOL_PIN.g_cfg_addGPIO[E];var f=za(e);for(a=0;a<f.length;a+=1){var h=f[a]+":0";var n=0;for(d=NUTOOL_PIN.g_cfg_gpios.length;n<d;n+=1)if(h===NUTOOL_PIN.g_cfg_gpios[n].f[0]){var b=0;for(c=e[f[a]].length;b<c;b+=1){var g=e[f[a]][b];for(d=NUTOOL_PIN.g_cfg_gpios[n].f.length-1;0<=d;--d)if(h=NUTOOL_PIN.g_cfg_gpios[n].f[d],parseInt(h.slice(h.indexOf(":")+1),10)<parseInt(g.slice(g.indexOf(":")+1),10)){NUTOOL_PIN.g_cfg_gpios[n].f.splice(d+1,0,g);break}}break}}}e={};"undefined"!==
typeof NUTOOL_PIN.g_cfg_unusedGPIO&&"undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO[NUTOOL_PIN.g_packageNumberIndex]?e="function"==typeof NUTOOL_PIN.g_cfg_unusedGPIO[NUTOOL_PIN.g_packageNumberIndex]?NUTOOL_PIN.g_cfg_unusedGPIO[NUTOOL_PIN.g_packageNumberIndex]():NUTOOL_PIN.g_cfg_unusedGPIO[NUTOOL_PIN.g_packageNumberIndex]:"undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO&&("undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO[E]?e="function"==typeof NUTOOL_PIN.g_cfg_unusedGPIO[E]?NUTOOL_PIN.g_cfg_unusedGPIO[E]():
NUTOOL_PIN.g_cfg_unusedGPIO[E]:"undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO[E.slicePriorToX("(")]&&(e="function"==typeof NUTOOL_PIN.g_cfg_unusedGPIO[E.slicePriorToX("(")]?NUTOOL_PIN.g_cfg_unusedGPIO[E.slicePriorToX("(")]():NUTOOL_PIN.g_cfg_unusedGPIO[E.slicePriorToX("(")]));f=za(e);for(a=0;a<f.length;a+=1)if("ALL"===f[a])for(n=0,d=NUTOOL_PIN.g_cfg_gpios.length;n<d;n+=1)for(b=0,c=e[f[a]].length;b<c;b+=1)for(g=e[f[a]][b],h=NUTOOL_PIN.g_cfg_gpios[n].f.length-1;0<=h;--h)0===NUTOOL_PIN.g_cfg_gpios[n].f[h].indexOf(g)&&
NUTOOL_PIN.g_cfg_gpios[n].f.splice(h,1);else if("PARTIAL"===f[a])for(n=0,d=NUTOOL_PIN.g_cfg_gpios.length;n<d;n+=1)for(b=0,c=e[f[a]].length;b<c;b+=1)for(g=e[f[a]][b],h=NUTOOL_PIN.g_cfg_gpios[n].f.length-1;0<=h;--h)NUTOOL_PIN.g_cfg_gpios[n].f[h].slicePriorToX(":")===g&&NUTOOL_PIN.g_cfg_gpios[n].f.splice(h,1);else for(h=f[a]+":0",n=0,d=NUTOOL_PIN.g_cfg_gpios.length;n<d;n+=1)if(h===NUTOOL_PIN.g_cfg_gpios[n].f[0]){b=0;for(c=e[f[a]].length;b<c;b+=1)for(g=e[f[a]][b],h=NUTOOL_PIN.g_cfg_gpios[n].f.length-
1;0<=h;--h)0===NUTOOL_PIN.g_cfg_gpios[n].f[h].indexOf(g)&&NUTOOL_PIN.g_cfg_gpios[n].f.splice(h,1);break}b=za(NUTOOL_PIN.g_cfg_regDescriptions);for(a=b.length-1;0<=a;--a)"undefined"===typeof L[b[a]]&&delete NUTOOL_PIN.g_cfg_regDescriptions[b[a]];Na=[];for(a=0;a<Q;a+=1)for(h=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a]+":0",b=0,c=NUTOOL_PIN.g_cfg_gpios.length;b<c;b+=1)if(h===NUTOOL_PIN.g_cfg_gpios[b].f[0]){d=0;for(n=NUTOOL_PIN.g_cfg_gpios[b].f.length;d<n;d+=1)g=c=NUTOOL_PIN.g_cfg_gpios[b].f[d].slicePriorToX(":"),
-1!==g.indexOf("_")&&(g=g.slicePriorToX("_")),g=x(g),"undefined"===typeof Na[g]?(Na[g]=[],Na[g][0]=a+1,ab[g]=[],ab[g][0]=c):(Na[g].push(a+1),ab[g].push(c));break}}function eb(){var a;for(a=0;a<Z.length;a+=1)Z[a].mouseLeave()}function yb(a,d){--a;if(-1!==E.indexOf("SOP")){var c=Math.floor(a/Q*2);var e=a-c*Q/2}else-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?(c=0,e=a):a<K?(c=0,e=a):a>=K&&a<K+ea?(c=1,e=a-K):a>=K+ea&&a<K+ea+Aa?(c=2,e=a-K-ea):a>=K+ea+Aa&&a<Q&&(c=3,e=a-K-ea-Aa);Z[c].lastPinIndex=e;"savedPinPadColor"!==
d&&(Z[c].savedPinPadColor[e]=d);Z[c].mouseLeave()}function X(a){var d=a.toString();if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA"))"string"===typeof a&&(a=parseInt(a,10)),--a,d=NUTOOL_PIN.g_horizontalIndexArray[Math.floor(a/Qa)]+(a%Qa+1);return d}function ya(a){"undefined"!==typeof Ja[a]&&""!==Ja[a].trim()&&(a=Ja[a]);return a}function fc(){var a,d,c,e,f,h,n,b={init:function(g,k,r){b.inner=g;b.stage=k[0];b.whichSide=r;b.pin=[];b.savedPinPadColor=[];b.savedPinName=[];b.x=[];b.y=[];b.currentPinIndex=
-1;b.lastPinIndex=-1;ua.addEvent(b.stage,"click",b.pinClickHandler);ua.addEvent(b.stage,"mousemove",function(v){b.mousePosition=b.getMousePos($("#NUC_PinConfiguration_Canvas")[0],v);b.decideWhichPin()});$("html").hasClass("ie10+")&&ua.addEvent(b.stage,"dblclick",function(){Xb("userDefined")});if(-1!==E.indexOf("SOP")){b.oneSidePinNumber=Q/2;b.pin[0]=1+r*b.oneSidePinNumber;k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][r*Q/2];k=va(k)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=k;b.x[0]=0;b.y[0]=
0;for(g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g+r*Q/2],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1+r*b.oneSidePinNumber,b.savedPinPadColor[g]=k;for(g=0;g<b.oneSidePinNumber;g+=1)b.pin[g]<=Q/2?(b.x[g]=R-40,b.y[g]=V+na+(b.pin[g]-1)*(16+ka)):(b.x[g]=R+A/2,b.y[g]=V+A-na-16-(b.pin[g]-Q/2-1)*(16+ka));switch(r){case 0:b.w=40;b.h=16;b.stage.setAttribute("width",b.w+20);b.stage.setAttribute("height",b.h+b.y[b.oneSidePinNumber-1]-b.y[0]+20);b.stage.setAttribute("style",
"z-index:1; position:absolute; left:"+(b.x[0]-10)+"px; top:"+(b.y[0]-10)+"px;");break;case 1:b.w=40,b.h=16,b.stage.setAttribute("width",b.w+20),b.stage.setAttribute("height",b.h+b.y[0]-b.y[b.oneSidePinNumber-1]+20),b.stage.setAttribute("style","z-index:1; position:absolute; left:"+(b.x[b.oneSidePinNumber-1]-10)+"px; top:"+(b.y[b.oneSidePinNumber-1]-10)+"px;")}}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){b.oneSidePinNumber=Q;b.w=0;b.pin[0]=1;k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][0];
k=va(k)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=k;b.x[0]=0;b.y[0]=0;for(g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1,b.savedPinPadColor[g]=k;for(g=0;g<b.oneSidePinNumber;g+=1)b.x[g]=na+30+Math.floor(g/Qa)*(60+ka),b.y[g]=na+30+(Qa-1-g%Qa)*(60+ka);b.r=30;b.stage.setAttribute("width",A);b.stage.setAttribute("height",A);b.stage.setAttribute("style","z-index:2; opacity:0.1; filter:alpha(opacity=50); position:absolute; left:"+
R+"px; top:"+V+"px;")}else{switch(r){default:case 0:b.oneSidePinNumber=K;b.pin[0]=1;k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][0];k=va(k)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=k;for(g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1,b.savedPinPadColor[g]=k;break;case 1:b.oneSidePinNumber=ea;b.pin[0]=1+K;k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][0+K];k=va(k)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=
k;for(g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g+K],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1+K,b.savedPinPadColor[g]=k;break;case 2:b.oneSidePinNumber=Aa;b.pin[0]=1+K+ea;k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][0+K+ea];k=va(k)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=k;for(g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g+K+ea],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1+K+ea,b.savedPinPadColor[g]=k;
break;case 3:for(b.oneSidePinNumber=lb,b.pin[0]=1+K+ea+Aa,k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][0+K+ea+Aa],k=va(k)?"#FFFFFF":"#9365C9",b.savedPinPadColor[0]=k,g=1;g<b.oneSidePinNumber;g+=1)k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][g+K+ea+Aa],k=va(k)?"#FFFFFF":"#9365C9",b.pin[g]=g+1+K+ea+Aa,b.savedPinPadColor[g]=k}b.x[0]=0;for(g=b.y[0]=0;g<b.oneSidePinNumber;g+=1)switch(r){default:case 0:f=Math.floor((Ra-K)/2);b.x[g]=R+na+(b.pin[g]-1+f)*(16+ka)-1;b.y[g]=V+A;break;
case 1:f=Math.floor((Ra-ea)/2);b.x[g]=R+A;b.y[g]=V+A-na-16-(b.pin[g]-K-1+f)*(16+ka);break;case 2:f=Math.floor((Ra-Aa)/2);b.x[g]=R+A-na-16-(b.pin[g]-K-ea-1+f)*(16+ka)-1;b.y[g]=V-40+1;break;case 3:f=Math.floor((Ra-lb)/2),b.x[g]=R-40,b.y[g]=V+na+(b.pin[g]-K-ea-Aa-1+f)*(16+ka)}switch(r){default:case 0:b.w=16;b.h=40;b.stage.setAttribute("width",b.w+b.x[b.oneSidePinNumber-1]-b.x[0]+20);b.stage.setAttribute("height",b.h+20);b.stage.setAttribute("style","z-index:1; position:absolute; left:"+(b.x[0]-10)+"px; top:"+
(b.y[0]-10)+"px;");break;case 1:b.w=40;b.h=16;b.stage.setAttribute("width",b.w+20);b.stage.setAttribute("height",b.h+b.y[0]-b.y[b.oneSidePinNumber-1]+20);b.stage.setAttribute("style","z-index:1; position:absolute; left:"+(b.x[b.oneSidePinNumber-1]-10)+"px; top:"+(b.y[b.oneSidePinNumber-1]-10)+"px;");break;case 2:b.w=16;b.h=40;b.stage.setAttribute("width",b.w+b.x[0]-b.x[b.oneSidePinNumber-1]+20);b.stage.setAttribute("height",b.h+20);b.stage.setAttribute("style","z-index:1; position:absolute; left:"+
(b.x[b.oneSidePinNumber-1]-10)+"px; top:"+(b.y[b.oneSidePinNumber-1]-10)+"px;");break;case 3:b.w=40,b.h=16,b.stage.setAttribute("width",b.w+20),b.stage.setAttribute("height",b.h+b.y[b.oneSidePinNumber-1]-b.y[0]+20),b.stage.setAttribute("style","z-index:1; position:absolute; left:"+(b.x[0]-10)+"px; top:"+(b.y[0]-10)+"px;")}}b.ctx=ua.getContext(b.stage);k=k=null;return b},draw:function(){var g;b.ctx.strokeStyle="#000000";if(-1!==E.indexOf("SOP"))switch(b.whichSide){case 0:for(g=0;g<b.oneSidePinNumber;g+=
1){b.ctx.strokeRect(11,b.y[g]-b.y[0]+10,b.w,b.h);b.ctx.fillStyle=b.savedPinPadColor[g];b.ctx.fillRect(11,b.y[g]-b.y[0]+10,b.w,b.h);var k=la[b.pin[g]-1];-1!==k.lastIndexOf("/")&&(k=k.slice(k.lastIndexOf("/")+1));!va(k)&&4<k.length&&(k=k.slice(0,4)+"..");b.savedPinName[g]=k;b.ctx.font="12px Arial";b.ctx.fillStyle="black";b.ctx.fillText(k,11,b.y[g]-b.y[0]+22.8)}break;case 1:for(g=0;g<b.oneSidePinNumber;g+=1)b.ctx.strokeRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[g],
b.ctx.fillRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),k=la[b.pin[g]-1],k=k.slicePriorToX("/"),!va(k)&&4<k.length&&(k=k.slice(0,4)+".."),b.savedPinName[g]=k,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(k,11,b.y[g]-b.y[b.oneSidePinNumber-1]+22.8)}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA"))for(g=0;g<b.oneSidePinNumber;g+=1)k=la[b.pin[g]-1],b.savedPinName[g]=k,-1===k.toLowerCase().indexOf("toolnotshow")&&(b.ctx.beginPath(),b.ctx.arc(b.x[g],b.y[g],b.r,0,2*Math.PI,
!0),b.ctx.strokeStyle="white",b.ctx.stroke(),b.ctx.strokeStyle="#000000",b.ctx.fillStyle=b.savedPinPadColor[g],b.ctx.fill(),-1!==k.lastIndexOf("/")&&(k=k.slice(k.lastIndexOf("/")+1)),6<k.length&&(k=k.slice(0,6)+".."),b.savedPinName[g]=k,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(k,b.x[g]-b.ctx.measureText(k).width/2,b.y[g]+parseInt(b.ctx.font,10)/2));else switch(b.whichSide){case 0:for(g=0;g<b.oneSidePinNumber;g+=1){b.ctx.strokeRect(b.x[g]-b.x[0]+10,11,b.w,b.h);b.ctx.fillStyle=
b.savedPinPadColor[g];b.ctx.fillRect(b.x[g]-b.x[0]+10,11,b.w,b.h);k=la[b.pin[g]-1];-1!==k.lastIndexOf("/")&&(k=k.slice(k.lastIndexOf("/")+1));!va(k)&&4<k.length&&(k=k.slice(0,4)+"..");b.savedPinName[g]=k;b.ctx.font="12px Arial";b.ctx.fillStyle="black";var r=b.x[g]-b.x[0]+10;var v=51;b.ctx.save();b.ctx.translate(r,v);b.ctx.rotate(-Math.PI/2);b.ctx.fillText(k,1,12.8);b.ctx.restore()}break;case 1:for(g=0;g<b.oneSidePinNumber;g+=1)b.ctx.strokeRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillStyle=
b.savedPinPadColor[g],b.ctx.fillRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),k=la[b.pin[g]-1],k=k.slicePriorToX("/"),!va(k)&&4<k.length&&(k=k.slice(0,4)+".."),b.savedPinName[g]=k,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(k,11,b.y[g]-b.y[b.oneSidePinNumber-1]+22.8);break;case 2:for(g=0;g<b.oneSidePinNumber;g+=1)b.ctx.strokeRect(b.x[g]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[g],b.ctx.fillRect(b.x[g]-b.x[b.oneSidePinNumber-1]+10,10,b.w,
b.h),k=la[b.pin[g]-1],k=k.slicePriorToX("/"),!va(k)&&4<k.length&&(k=k.slice(0,4)+".."),b.savedPinName[g]=k,b.ctx.font="12px Arial",b.ctx.fillStyle="black",r=b.x[g]-b.x[b.oneSidePinNumber-1]+10,v=50,b.ctx.save(),b.ctx.translate(r,v),b.ctx.rotate(-Math.PI/2),b.ctx.textAlign="end",b.ctx.fillText(k,40,12.8),b.ctx.restore();break;case 3:for(g=0;g<b.oneSidePinNumber;g+=1)b.ctx.strokeRect(11,b.y[g]-b.y[0]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[g],b.ctx.fillRect(11,b.y[g]-b.y[0]+10,b.w,b.h),k=la[b.pin[g]-
1],-1!==k.lastIndexOf("/")&&(k=k.slice(k.lastIndexOf("/")+1)),!va(k)&&4<k.length&&(k=k.slice(0,4)+".."),b.savedPinName[g]=k,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(k,11,b.y[g]-b.y[0]+22.8)}},restore:function(){ua.removeContext($("#"+b.inner));b=null},getMousePos:function(g,k){g=g.getBoundingClientRect();return{x:k.clientX-g.left,y:k.clientY-g.top}},decideWhichPin:function(){var g;if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){var k=b.mousePosition.x-R*N/100;var r=b.mousePosition.y-
V*N/100;for(g=0;g<b.oneSidePinNumber;g+=1){if(k>=(b.x[g]-b.r)*N/100&&k<=(b.x[g]+b.r)*N/100&&r>=(b.y[g]-b.r)*N/100&&r<=(b.y[g]+b.r)*N/100){b.currentPinIndex=g;break}b.currentPinIndex=-1}}else for(g=0;g<b.oneSidePinNumber;g+=1){k=b.x[g]*N/100;if(b.mousePosition.x>=k&&b.mousePosition.x<=k+b.w*N/100&&b.mousePosition.y>=b.y[g]*N/100&&b.mousePosition.y<=(b.y[g]+b.h)*N/100){b.currentPinIndex=g;break}b.currentPinIndex=-1}-1!==b.currentPinIndex?b.mouseEnter():b.mouseLeave()},mouseEnter:function(){var g;var k=
0;for(g=Z.length;k<g;k+=1)Z[k].lastPinIndex!==b.currentPinIndex&&Z[k].mouseLeave();if(b.currentPinIndex!==b.lastPinIndex&&(g=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b.pin[b.currentPinIndex]-1],-1===g.toLowerCase().indexOf("toolnotshow"))){k=b.lastPinIndex=b.currentPinIndex;b.ctx.strokeStyle="#000000";b.ctx.fillStyle="#FC517E";if(-1!==E.indexOf("SOP"))switch(b.whichSide){case 0:Ha&&b.ctx.strokeRect(11,b.y[k]-b.y[0]+10,b.w,b.h);b.ctx.fillRect(11,b.y[k]-b.y[0]+10,b.w,b.h);b.ctx.font="12px Arial";
b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[k],11,b.y[k]-b.y[0]+22.8);break;case 1:Ha&&b.ctx.strokeRect(11,b.y[k]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillRect(11,b.y[k]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[k],11,b.y[k]-b.y[b.oneSidePinNumber-1]+22.8)}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){b.ctx.beginPath();b.ctx.arc(b.x[k],b.y[k],b.r,0,2*Math.PI,!0);b.ctx.fill();var r=g=""!==D[k]?ya(D[k]):
NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b.pin[b.currentPinIndex]-1];6<g.length&&(r=g.slice(0,6)+"..");b.ctx.font="12px Arial";b.ctx.fillStyle="black";b.ctx.fillText(r,b.x[k]-b.ctx.measureText(r).width/2,b.y[k]+parseInt(b.ctx.font,10)/2)}else switch(b.whichSide){case 0:Ha&&b.ctx.strokeRect(b.x[k]-b.x[0]+10,11,b.w,b.h);b.ctx.fillRect(b.x[k]-b.x[0]+10,11,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";r=b.x[k]-b.x[0]+10;var v=51;b.ctx.save();b.ctx.translate(r,v);b.ctx.rotate(-Math.PI/
2);b.ctx.fillText(b.savedPinName[k],1,12.8);b.ctx.restore();break;case 1:Ha&&b.ctx.strokeRect(11,b.y[k]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.fillRect(11,b.y[k]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[k],11,b.y[k]-b.y[b.oneSidePinNumber-1]+22.8);break;case 2:Ha&&b.ctx.strokeRect(b.x[k]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillRect(b.x[k]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle=
"black";r=b.x[k]-b.x[b.oneSidePinNumber-1]+10;v=50;b.ctx.save();b.ctx.translate(r,v);b.ctx.rotate(-Math.PI/2);b.ctx.textAlign="end";b.ctx.fillText(b.savedPinName[k],40,12.8);b.ctx.restore();break;case 3:Ha&&b.ctx.strokeRect(11,b.y[k]-b.y[0]+10,b.w,b.h),b.ctx.fillRect(11,b.y[k]-b.y[0]+10,b.w,b.h),b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[k],11,b.y[k]-b.y[0]+22.8)}if(!va(g)&&(k=g,"unknown"!==k)){a=$("#panel")[0].appendChild($a("canvas",b.inner+"_tooltip_pin"));-1===
k.indexOf("/")||-1===k.indexOf("XT1_IN")&&-1===k.indexOf("XT1_OUT")&&-1===k.indexOf("XTAL1")&&-1===k.indexOf("XTAL2")||(k=-1!==k.indexOf("XTAL1")?k+" (XTAL1":-1!==k.indexOf("XTAL2")?k+" (XTAL2":-1!==k.indexOf("XT1_IN")?k+" (XT1_IN":k+" (XT1_OUT",k="Simplified Chinese"===oa?k+"\u7531User Configuration\u51b3\u5b9a\u3002)":"Traditional Chinese"===oa?k+"\u7531User Configuration\u6c7a\u5b9a\u3002)":k+" is decided by User Configuration.)");if(Ha){d=b.ctx.measureText(k).width;c=16;v="12px Arial";var w=c-
4;-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?(g=(R+b.x[b.currentPinIndex])*N/100,r=(V+b.y[b.currentPinIndex]+10)*N/100):(g=(b.x[b.currentPinIndex]+b.w)*N/100,r=b.y[b.currentPinIndex]*N/100)}else if(100>N?(d=b.ctx.measureText(k).width/N*100,c=16/N*100,v=12/N*100+"px Times Arial",w=c-5/N*100):(d=b.ctx.measureText(k).width,c=16,v="12px Arial",w=c-4),g=b.x[b.currentPinIndex]+b.w,r=b.y[b.currentPinIndex],-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA"))g+=R,r+=V+10;a.setAttribute("style","z-index:2; position:absolute; left:"+
g+"px; top:"+r+"px;");a.setAttribute("width",d+21);a.setAttribute("height",c);e=ua.getContext(a);e.font=v;e.strokeStyle="#000000";e.lineWidth=2;e.strokeRect(0,0,d+21,c);e.fillStyle="#FFF6C0";e.fillRect(1,1,d+21-2,c-2);e.fillStyle="#000000";e.fillText(k,7,w)}}},mouseLeave:function(){var g=b.lastPinIndex;if(-1!==b.lastPinIndex){b.ctx.strokeStyle="#000000";b.ctx.fillStyle=b.savedPinPadColor[g];if(-1!==E.indexOf("SOP"))switch(b.whichSide){case 0:Ha&&b.ctx.strokeRect(11,b.y[g]-b.y[0]+10,b.w,b.h);b.ctx.fillRect(11,
b.y[g]-b.y[0]+10,b.w,b.h);b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[g],11,b.y[g]-b.y[0]+22.8);break;case 1:Ha&&b.ctx.strokeRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[g],11,b.y[g]-b.y[b.oneSidePinNumber-1]+22.8)}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){var k=""!==D[g]?ya(D[g]):b.savedPinName[g];-1===k.toLowerCase().indexOf("toolnotshow")&&(b.ctx.beginPath(),
b.ctx.arc(b.x[g],b.y[g],b.r,0,2*Math.PI,!0),b.ctx.fill(),6<k.length&&(k=k.slice(0,6)+".."),b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(k,b.x[g]-b.ctx.measureText(k).width/2,b.y[g]+parseInt(b.ctx.font,10)/2))}else switch(b.whichSide){case 0:Ha&&b.ctx.strokeRect(b.x[g]-b.x[0]+10,11,b.w,b.h);b.ctx.fillRect(b.x[g]-b.x[0]+10,11,b.w,b.h);b.ctx.fillStyle="black";h=b.x[g]-b.x[0]+10;n=51;b.ctx.save();b.ctx.translate(h,n);b.ctx.rotate(-Math.PI/2);b.ctx.fillText(b.savedPinName[g],1,12.8);
b.ctx.restore();break;case 1:Ha&&b.ctx.strokeRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.fillRect(11,b.y[g]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[g],11,b.y[g]-b.y[b.oneSidePinNumber-1]+22.8);break;case 2:Ha&&b.ctx.strokeRect(b.x[g]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillRect(b.x[g]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillStyle="black";h=b.x[g]-b.x[b.oneSidePinNumber-1]+10;n=50;b.ctx.save();b.ctx.translate(h,
n);b.ctx.rotate(-Math.PI/2);b.ctx.textAlign="end";b.ctx.fillText(b.savedPinName[g],40,12.8);b.ctx.restore();break;case 3:Ha&&b.ctx.strokeRect(11,b.y[g]-b.y[0]+10,b.w,b.h),b.ctx.fillRect(11,b.y[g]-b.y[0]+10,b.w,b.h),b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[g],11,b.y[g]-b.y[0]+22.8)}b.lastPinIndex=-1;ua.removeContext($("#"+b.inner+"_tooltip_pin"))}},pinClickHandler:function(){var g;var k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b.pin[b.currentPinIndex]-1];var r=[],v=0,w=ua.getContext($("#NUC_PinConfiguration_Canvas")[0]);
if(-1!==b.currentPinIndex&&(rb(),va(k))){parseInt(k.sliceAfterX("."),10);k+=":0";var p=gb(k,parseInt(k.sliceAfterX("."),10));if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){var q=b.x[b.currentPinIndex]+R;var t=b.y[b.currentPinIndex]+V+10}else q=b.x[b.currentPinIndex],t=b.y[b.currentPinIndex];k=0;for(g=NUTOOL_PIN.g_cfg_gpios[p].f.length;k<g;k+=1)r[k]=NUTOOL_PIN.g_cfg_gpios[p].f[k].slicePriorToX(":"),w.measureText(r[k]).width>v&&(v=w.measureText(r[k]).width);r.push("Reset");xb=[];k=0;for(g=r.length;k<
g;k+=1)w=!Ha&&100<N?t+20*k:t+20*k/N*100,p="#6495ED",k!==g-1&&r[k]===D[b.pin[b.currentPinIndex]-1]&&(p=-1!==$.inArray(b.pin[b.currentPinIndex],Ga)?"#FAB92D":"#41AF88"),xb[k]=Zc().init(b.pin[b.currentPinIndex],k.toString(),r[k],v,q+b.w,w,p,!0),w=k.toString(),w=w.replaceSpecialCharacters(),$("#Pin_MultiFunction_Selection_"+w).hover(xb[k].mouseEnter,xb[k].mouseLeave),xb[k].draw()}f=null}};return b}function rb(){var a;var d=0;for(a=xb.length;d<a;d+=1)xb[d].restore();xb=[]}function Zc(){var a,d,c,e={init:function(f,
h,n,b,g,k,r,v){e.pin=f;e.label=n;e.color=r;e.inner="Pin_MultiFunction_Selection_"+h;e.stage=$("#panel")[0].appendChild($a("canvas",e.inner));Ha?(e.w=b,e.h=20,f=g*N/100,k=k*N/100,b="12px Arial",e.textYposition=14):(f=g,100>N?(e.w=b/N*100,e.h=20/N*100,b=12/N*100+"px Times Arial",e.textYposition=14/N*100):(e.w=b,e.h=20,b="12px Arial",e.textYposition=14));e.positionX=f;e.positionY=k;e.stage.setAttribute("width",e.w+21);e.stage.setAttribute("height",e.h);e.stage.setAttribute("style","z-index:2; position:absolute; left:"+
f+"px; top:"+k+"px;");e.ctx=ua.getContext(e.stage);e.ctx.font=b;(e.bInstallClickListener=v)&&ua.addEvent(e.stage,"click",e.pinMultiFunctionSelectionsClickHandler);return e},mouseEnter:function(){var f;e.ctx.fillStyle="#B0C4DE";e.ctx.fillRect(1,1,e.w+21-2,e.h-2);e.ctx.fillStyle="#000000";e.ctx.fillText(e.label,7,e.textYposition);if(Mb&&0<NUTOOL_PIN.g_cfg_gpiosDescriptions.length&&!va(e.label)&&"Reset"!==e.label){var h=Ac(e.label,e.pin);if("unknown"!==h){a=$("#panel")[0].appendChild($a("canvas",e.inner+
"_tooltip"));var n=h.split("<br >");h=d=0;for(f=n.length;h<f;h++)e.ctx.measureText(n[h]).width>d&&(d=e.ctx.measureText(n[h]).width);-1!==E.indexOf("SOP")?e.pin>Q/2?a.setAttribute("style","z-index:2; position:absolute; left:"+(e.positionX-d-21-1)+"px; top:"+e.positionY+"px;"):a.setAttribute("style","z-index:2; position:absolute; left:"+(e.positionX+e.w+21+1)+"px; top:"+e.positionY+"px;"):-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?e.pin>Q/2?a.setAttribute("style","z-index:2; position:absolute; left:"+
(e.positionX-d-21-1)+"px; top:"+e.positionY+"px;"):a.setAttribute("style","z-index:2; position:absolute; left:"+(e.positionX+e.w+21+1)+"px; top:"+e.positionY+"px;"):e.pin>K/2&&e.pin<=K+ea+Aa/2?a.setAttribute("style","z-index:2; position:absolute; left:"+(e.positionX-d-21-1)+"px; top:"+e.positionY+"px;"):a.setAttribute("style","z-index:2; position:absolute; left:"+(e.positionX+e.w+21+1)+"px; top:"+e.positionY+"px;");a.setAttribute("width",d+21);a.setAttribute("height",e.h*n.length);c=ua.getContext(a);
c.font=e.ctx.font;c.strokeStyle="#000000";c.lineWidth=2;c.strokeRect(0,0,d+21,e.h*n.length);c.fillStyle="#FFF6C0";c.fillRect(1,1,d+21-2,e.h*n.length-2);c.fillStyle="#000000";h=0;for(f=n.length;h<f;h++)c.fillText(n[h],7,e.textYposition+h*e.h)}}},mouseLeave:function(){e.ctx.fillStyle=e.color;e.ctx.fillRect(1,1,e.w+21-2,e.h-2);e.ctx.fillStyle="#000000";e.ctx.fillText(e.label,7,e.textYposition);ua.removeContext($("#"+e.inner+"_tooltip"))},draw:function(){e.ctx.strokeStyle="#000000";e.ctx.strokeRect(0,
0,e.w+21,e.h);e.ctx.fillStyle=e.color;e.ctx.fillRect(1,1,e.w+21-2,e.h-2);e.ctx.fillStyle="#000000";e.ctx.fillText(e.label,7,e.textYposition)},restore:function(){ua.removeContext($("#"+e.inner+"_tooltip"));ua.removeContext($("#"+e.inner));Ma();e=null},pinMultiFunctionSelectionsClickHandler:function(){var f;eb();if("Reset"===e.label){if(0!==Ga.length){var h=0;for(f=Ga.length;h<f;h+=1)Ga[h]===e.pin&&Ga.splice(h,1)}var n=D[e.pin-1]+"_Pin"+e.pin;n=n.replaceSpecialCharacters();$("#moduleTree").jstree("uncheck_node",
$("#"+n));if(!$("#"+n).hasClass("jstree-unchecked")){var b=x(n.slicePriorToX("_"));h=[];h[0]=e.pin;tb(n,b,h);fb();if("undefined"!==typeof B[b]){h=0;for(f=B[b].length;h<f;h+=1)if(B[b][h]===n){B[b][h]="";break}h=0;for(f=B[b].length;h<f&&""===B[b][h];h+=1)h===f-1&&$("#"+b+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}b=null;h=[]}yb(e.pin,"#FFFFFF");rb()}else{b=!1;n=e.label+"_Pin"+e.pin;if(-1!==$.inArray(n.restorePinTreeNodeName()+"_Intermediate",zb))for(h=0,f=pa.length;h<f;h+=
1)if(pa[h].restorePinTreeNodeName()===n.restorePinTreeNodeName()&&pa[h]!==n&&(!0===$("#"+pa[h]).hasClass("jstree-checked")||0===D[parseInt(pa[h].slice(pa[h].indexOf("_Pin")+4),10)-1].replaceSpecialCharacters().indexOf(pa[h].restorePinTreeNodeName()))){b=!0;var g=pa[h].slice(pa[h].indexOf("_Pin")+4);break}if(b){var k=x(e.label);-1!==k.indexOf("_")&&(k=k.slicePriorToX("_"));"undefined"!==typeof e.pin&&null!==e.pin&&$c(function(){Lc(k,e.pin,e.label)},e.label,X(g))}else Lc(x(n.slicePriorToX("_")),e.pin,
e.label);g=b=null}n=null}};return e}function Lc(a,d,c){var e,f=$("#moduleTree"),h=D[d-1]+"_Pin"+d;h=h.replaceSpecialCharacters();f.jstree("uncheck_node",$("#"+h));if(!$("#"+h).hasClass("jstree-unchecked")){var n=x(h.slicePriorToX("_"));var b=[];b[0]=d;tb(h,n,b);if("undefined"!==typeof B[n]){b=0;for(e=B[n].length;b<e;b+=1)if(B[n][b]===h){B[n][b]="";break}b=0;for(e=B[n].length;b<e&&""===B[n][b];b+=1)b===e-1&&$("#"+n+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}h=(c+"_Pin"+
d).replaceSpecialCharacters();f.jstree("check_node",$("#"+h));$("#"+h).hasClass("jstree-checked")||(f.jstree("open_node",$("#"+a+"_Root")),f.jstree("open_node",$("#"+c+"_Intermediate")),f.jstree("check_node",$("#"+h)));yb(d,"#FAB92D");"undefined"===typeof Ga?Ga[0]=d:Ga.push(d);rb();a=a.replaceSpecialCharacters();c=c.replaceSpecialCharacters();f.jstree("close_all");f.jstree("open_node",$("#"+a+"_Root"));f.jstree("open_node",$("#"+c+"_Intermediate"));d=za(Na);d.sort();f.scrollTop(18*$.inArray(a,d))}
function Ac(a,d){var c,e="",f=!1;var h=0;for(c=NUTOOL_PIN.g_cfg_gpiosDescriptions.length;h<c;h+=1){var n=e=NUTOOL_PIN.g_cfg_gpiosDescriptions[h].replace("Note:","<br >Note:");var b=!1;-1!==e.indexOf("@")&&(n=n.slice(n.indexOf("@")+1,n.indexOf(":")),b=!0);if(0===e.indexOf(a+":")||0===e.indexOf(a+"@"))if(!b||n===NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d-1]){f=!0;break}}return e=f?e.slice(e.indexOf(":")+1):"unknown"}function $c(a,d,c){if($("#rootTree_Pin").is(":visible")){sb();if("Simplified Chinese"===
oa){var e="\u901a\u77e5";d="\u9884\u671f\u7684"+d+"\u5df2\u88ab\u7b2c"+c+"\u811a\u4f4d\u8bbe\u7f6e\u3002\u8bf7\u95ee\u4f60\u8981\u53d6\u6d88\u65e7\u7684\u4e14\u6539\u8bbe\u7f6e\u5230\u73b0\u5728\u7684\u811a\u4f4d\u5417?";c="\u8981";var f="\u4e0d\u8981"}else"Traditional Chinese"===oa?(e="\u901a\u77e5",d="\u9810\u671f\u7684"+d+"\u5df2\u88ab\u7b2c"+c+"\u8173\u4f4d\u8a2d\u7f6e\u3002\u8acb\u554f\u4f60\u8981\u53d6\u6d88\u820a\u7684\u4e14\u6539\u8a2d\u7f6e\u5230\u73fe\u5728\u7684\u8173\u4f4d\u55ce?",c="\u8981",
f="\u4e0d\u8981"):(e="Notice",d="The expected "+d+" has been configured by the pin"+c+". Would you like to cancel the old one and configure to the current pin?",c="Yes",f="No");Ma();$('<div id="noticeForMultipleSelectionsDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:e,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#noticeForMultipleSelectionsDialog").dialog("destroy")},buttons:[{text:c,click:function(){a();
$("#noticeForMultipleSelectionsDialog").dialog("isOpen")&&$("#noticeForMultipleSelectionsDialog").dialog("destroy")}},{text:f,click:function(){rb();$("#noticeForMultipleSelectionsDialog").dialog("isOpen")&&$("#noticeForMultipleSelectionsDialog").dialog("destroy")}}]})}f=c=d=e=null}function sc(){Na=[];xa=[];L=[];ec=[];Va=[];D=[];la=[];Ga=[];"undefined"!==typeof x.specialModuleNames&&delete x.specialModuleNames;fa();rb();$("#panel").unbind("mouseenter mouseleave");ua.removeContext($("#NUC_PinConfiguration_Canvas"));
ua.removeContext($("#NUC_PinConfiguration_Canvas_Lining"));$("#mfpTree").jstree("destroy");$("#supportedModules").jstree("destroy");$("#moduleTree").jstree("destroy");$("#mfpTree").remove();$("#supportedModules").remove();$("#moduleTree").remove();$("div").remove(".tooltip")}function tc(){oc();"undefined"===typeof NUTOOL_PER&&uc();Kc();lc();rc();ta();ra();nc()}function Xa(a,d,c){var e="js"===c?"src":"css"===c?"href":"none",f=window.document.getElementsByTagName("js"===c?"script":"css"===c?"link":
"none");"undefined"!==typeof NUTOOL_PER&&"js"===c&&(a="PinConfigure/"+a,d="PinConfigure/"+d);var h=d;if("js"===c){var n=document.createElement("script");n.setAttribute("type","text/javascript");n.setAttribute("src",h)}else"css"===c&&(n=document.createElement("link"),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",h));h=n;for(c=f.length;0<=c;--c)f[c]&&null!==f[c].getAttribute(e)&&(f[c].getAttribute(e)===a?f[c].parentNode.removeChild(f[c]):f[c].getAttribute(e)===
d&&f[c].parentNode.removeChild(f[c]));f[0].parentNode.appendChild(h)}function uc(){var a,d=$("#MCUselect"),c={},e=[],f=!1;0<d.children().length&&d.children().remove();var h=0;for(a=NUTOOL_PIN.g_cfg_chips.length;h<a;h+=1)try{e.push(NUTOOL_PIN.g_cfg_chips[h].name+"("+NUTOOL_PIN.g_cfg_chips[h].pkg+")")}catch(n){}e.sort(ca);h=0;for(a=e.length;h<a;h+=1)c=document.createElement("option"),c.id=c.innerHTML=c.value=e[h],d[0].appendChild(c);h=0;for(a=NUTOOL_PIN.g_cfg_chips.length;h<a;h+=1)if(NUTOOL_PIN.g_cfg_chips[h].name+
"("+NUTOOL_PIN.g_cfg_chips[h].pkg+")"===E){f=!0;break}f?d.val(E):d.val($("#MCUselect option:first-child").val()).change();$("#ChipTypeSelect").val(cc(m));d.on("change",function(){ib!==$(this).val()&&(ib=$(this).val(),setTimeout(Mc,0))});a=h=null;e=[];d=f=c=null}function ad(){var a,d=$("#ChipTypeSelect"),c;$("#ChipType")[0].setAttribute("style","width:259px; border-right: 16px solid #F2F2F2;");$("#MCU")[0].setAttribute("style","width:259px; border-right: 16px solid #F2F2F2;");var e=0;for(a=dc.length;e<
a;e+=1){var f=document.createElement("option");try{f.id=f.innerHTML=f.value=dc[e]}catch(n){}d[0].appendChild(f)}d.val(cc(m));uc();d.on("change",function(){c="NUC_"+m+"_Content.js";var n=$(this).val();var b=n;"NUC200"===n?b="NUC200AN":"NANO100"===n?b="NANO100BN":"NUC100"===n?b="NUC100DN":"M030G"===n?b="M030G":"M031"===n?b="M031BT":"M051"===n?b="M0515LDE":"M071"===n?b="M071M":"MINI51"===n?b="MINI51DE":"NUC029"===n?b="NUC029AE":"M451"===n?b="M451HD":"M460"===n?b="M460LD":"M480"===n?b="M480LD":"KM1M7"===
n?b="KM1M7AF":"MS51"===n?b="MS51_8K":"ML51"===n&&(b="ML51");m=b;h="NUC_"+m+"_Content.js";Xa(c,h,"js");uc()});var h=c=d=f=a=e=null}function Mc(){$b();if(ib!==E){try{window.external.updateCurrentDialogSize()}catch(d){}var a=m;m=bc(ib);Xa("NUC_"+a+"_Content.js","NUC_"+m+"_Content.js","js");sc();E=ib;NUTOOL_PIN.decidepackageNumber();jc();Gb=!1;Da=[];Fa=[];Ja={};ja=null;tc();N=100;ub();Cb();Ma()}}function Ma(){$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");$("#adjustedModulesDialog").dialog("isOpen")&&
$("#adjustedModulesDialog").dialog("destroy");$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").dialog("destroy");$("#showPinErrorDialog").dialog("isOpen")&&$("#showPinErrorDialog").dialog("destroy");$("#noticeForMultipleSelectionsDialog").dialog("isOpen")&&$("#noticeForMultipleSelectionsDialog").dialog("destroy");$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy");$("#printReportDialog").dialog("isOpen")&&$("#printReportDialog").dialog("destroy");
$("#runAnotherToolDialog").dialog("isOpen")&&$("#runAnotherToolDialog").dialog("destroy");$("#connectToTargetDialog").dialog("isOpen")&&$("#connectToTargetDialog").dialog("destroy");$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}function Vc(){var a,d=ua.getContext($("#NUC_PinConfiguration_Canvas")[0]);d.font="12px Arial";if(-1!==E.indexOf("SOP")){var c=0;for(a=Q/2;c<a;c+=1){var e=R+3;var f=V+na+c*(16+ka)+12.8;d.fillStyle="white";d.fillText((c+1).toString(),e,f);La&&
(e=R-40-3,d.save(),d.fillStyle="black",d.fillText(la[c],e-d.measureText(la[c]).width,f),d.restore());e=R+A/2;f=V+A-na-16-c*(16+ka)+12.8;var h=d.measureText((c+1+Q/2).toString());d.fillStyle="white";d.fillText((c+1+Q/2).toString(),e-h.width-3,f);La&&(e=R+A/2+40+3,d.fillStyle="black",d.fillText(la[c+Q/2],e,f))}}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){c=0;for(a=Qa;c<a;c+=1)e=R+3,f=V+na+30+(Qa-1-c%Qa)*(60+ka)+4,d.fillStyle="white",d.fillText((c+1).toString(),e,f);c=0;for(a=mc;c<a;c+=1)e=
R+na+30+c*(60+ka)-4,f=V+A-5,d.fillStyle="white",d.fillText(NUTOOL_PIN.g_horizontalIndexArray[c],e,f)}else{c=0;for(a=K;c<a;c+=1)f=Math.floor((Ra-K)/2),e=R+na+(c+f)*(16+ka),f=V+A,d.save(),d.translate(e,f),d.rotate(-Math.PI/2),d.fillStyle="white",d.fillText((c+1).toString(),3,12.8),d.restore(),La&&(f=V+A+40,d.save(),d.translate(e,f),d.rotate(-Math.PI/2),d.textAlign="end",d.fillStyle="black",d.fillText(la[c],-3,12.8),d.restore());c=0;for(a=ea;c<a;c+=1)f=Math.floor((Ra-ea)/2),e=R+A,f=V+A-na-16-(c+f)*(16+
ka)+12.8,h=d.measureText((c+1+K).toString()),d.fillStyle="white",d.fillText((c+1+K).toString(),e-h.width-3,f),La&&(e=R+A+40+3,d.fillStyle="black",d.fillText(la[c+K],e,f));c=0;for(a=Aa;c<a;c+=1)f=Math.floor((Ra-Aa)/2),e=R+A-na-16-(c+f)*(16+ka),f=V-40,d.save(),d.translate(e,f),d.rotate(-Math.PI/2),h=d.measureText((c+1+K+ea).toString()),d.fillStyle="white",d.fillText((c+1+K+ea).toString(),-40-h.width-3,12.8),d.restore(),La&&(d.save(),d.translate(e,f),d.rotate(-Math.PI/2),d.fillStyle="black",d.fillText(la[c+
K+ea],6,12.8),d.restore());c=0;for(a=lb;c<a;c+=1)f=Math.floor((Ra-lb)/2),e=R+3,f=V+na+(c+f)*(16+ka)+12.8,d.fillStyle="white",d.fillText((c+1+K+ea+Aa).toString(),e,f),La&&(e=R-40-3,d.save(),d.fillStyle="black",d.fillText(la[c+K+ea+Aa],e-d.measureText(la[c+K+ea+Aa]).width,f),d.restore())}}function gc(){var a=ua.getContext($("#NUC_PinConfiguration_Canvas")[0]),d=0;if("Simplified Chinese"===oa){var c="\u88ab\u82af\u7247\u56fe\u914d\u7f6e";var e="\u88ab\u6811\u72b6\u56fe\u914d\u7f6e";var f="\u6ed1\u9f20\u7126\u70b9";
var h="\u975e\u53ef\u914d\u7f6e\u7684";var n="\u53cc\u51fb\u7528\u6237\u5b9a\u4e49";a.font="12px \u65b0\u7d30\u660e\u9ad4"}else"Traditional Chinese"===oa?(c="\u88ab\u82af\u7247\u5716\u914d\u7f6e",e="\u88ab\u6a39\u72c0\u5716\u914d\u7f6e",f="\u6ed1\u9f20\u7126\u9ede",h="\u975e\u53ef\u914d\u7f6e\u7684",n="\u96d9\u64ca\u7528\u6236\u5b9a\u7fa9",a.font="12px \u65b0\u7d30\u660e\u9ad4"):(c="Configured by ChipView",e="Configured by TreeView",f="Focused by Mouse",h="Not Configurable",n="Dblclicked for UserDefined",
a.font="12px Arial");a.strokeStyle="black";if($("html").hasClass("ie10+")){d+=1;var b=R-20-40-130;var g=V-20-21*d;a.strokeRect(b,g,40,16);a.fillStyle="#404040";a.fillRect(b,g,40,16);a.fillStyle="black";a.fillText(n,b+40+3,g+12.8)}d+=1;b=R-20-40-130;g=V-20-21*d;a.strokeRect(b,g,40,16);a.fillStyle="#FAB92D";a.fillRect(b,g,40,16);a.fillStyle="black";a.fillText(c,b+40+3,g+12.8);d+=1;b=R-20-40-130;g=V-20-21*d;a.strokeRect(b,g,40,16);a.fillStyle="#41AF88";a.fillRect(b,g,40,16);a.fillStyle="black";a.fillText(e,
b+40+3,g+12.8);d+=1;b=R-20-40-130;g=V-20-21*d;a.strokeRect(b,g,40,16);a.fillStyle="#FC517E";a.fillRect(b,g,40,16);a.fillStyle="black";a.fillText(f,b+40+3,g+12.8);b=R-20-40-130;g=V-20-21*(d+1);a.strokeRect(b,g,40,16);a.fillStyle="#9365C9";a.fillRect(b,g,40,16);a.fillStyle="black";a.fillText(h,b+40+3,g+12.8)}function Nc(){var a=5;$("html").hasClass("ie10+")||(a=4);var d=ua.getContext($("#NUC_PinConfiguration_Canvas")[0]);var c=R-20-40-130-3;a=V-20-21*a;d.fillStyle="#FFFFFF";d.fillRect(c,a,190,104)}
function Bb(a,d,c){var e,f;d=d.restorePinTreeNodeName().restoreSpecialCharacters();var h=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a];var n=h+":0";a=0;for(e=NUTOOL_PIN.g_cfg_gpios.length;a<e;a+=1)if(n===NUTOOL_PIN.g_cfg_gpios[a].f[0]){e=0;for(f=NUTOOL_PIN.g_cfg_gpios[a].f.length;e<f;e+=1)if("undefined"===typeof c||!1===c)if("AD"!==d){if(0===NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf(d)){pc(h,NUTOOL_PIN.g_cfg_gpios[a].f[e].slice(NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf(":")+1));break}}else{if(0!==
NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf("ADC")&&0===NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf(d)){pc(h,NUTOOL_PIN.g_cfg_gpios[a].f[e].slice(NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf(":")+1));break}}else if(n=NUTOOL_PIN.g_cfg_gpios[a].f[e],n=n.slicePriorToX(":"),n===d){pc(h,NUTOOL_PIN.g_cfg_gpios[a].f[e].slice(NUTOOL_PIN.g_cfg_gpios[a].f[e].indexOf(":")+1));break}break}}function ub(){var a=$("#panel");Ha?(a.find("canvas").css("zoom"," "+N+"%"),a.width(Ya-275-8),a.height(Ua-8),$("#NUC_PinConfiguration_Canvas").width(Za*
N/100),$("#NUC_PinConfiguration_Canvas").height(qb*N/100),$("#NUC_PinConfiguration_Canvas_Lining").width(Za*N/100),$("#NUC_PinConfiguration_Canvas_Lining").height(qb*N/100),-1!==E.indexOf("SOP")?($("#pin_side_0").width((Z[0].w+20)*N/100),$("#pin_side_0").height((Z[0].h+Z[0].y[Z[0].oneSidePinNumber-1]-Z[0].y[0]+20)*N/100),$("#pin_side_1").width((Z[1].w+20)*N/100),$("#pin_side_1").height((Z[1].h+Z[1].y[0]-Z[1].y[Z[1].oneSidePinNumber-1]+20)*N/100)):-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")?($("#pin_side_0").width(A*
N/100),$("#pin_side_0").height(A*N/100)):($("#pin_side_0").width((Z[0].w+Z[0].x[Z[0].oneSidePinNumber-1]-Z[0].x[0]+20)*N/100),$("#pin_side_0").height((Z[0].h+20)*N/100),$("#pin_side_1").width((Z[1].w+20)*N/100),$("#pin_side_1").height((Z[1].h+Z[1].y[0]-Z[1].y[Z[1].oneSidePinNumber-1]+20)*N/100),$("#pin_side_2").width((Z[2].w+Z[2].x[0]-Z[2].x[Z[2].oneSidePinNumber-1]+20)*N/100),$("#pin_side_2").height((Z[2].h+20)*N/100),$("#pin_side_3").width((Z[3].w+20)*N/100),$("#pin_side_3").height((Z[3].h+Z[3].y[Z[3].oneSidePinNumber-
1]-Z[3].y[0]+20)*N/100)),a.css("border","3px solid white")):($("#parentOfPanel").css("zoom"," "+N+"%"),a.width((Ya-275-8)/N*100),a.height((Ua-8)/N*100),a.css({position:"absolute",left:275/N*100+"px"}));rb()}function vc(){for(var a,d,c,e=[],f,h,n,b,g=0;0<xa.length&&1E3>g;)for(g+=1,a=parseInt(xa[0].slicePriorToX(":"),10),d=la[a-1],h=-1,n=0,b=Va[a-1];h!==n;)h=d.indexOf(b),n=d.lastIndexOf(b),c=d.slice(h),c=c.slicePriorToX("/"),f=c+"_Pin"+a,f=f.replaceSpecialCharacters(),c=x(f.slicePriorToX("_")),e[0]=
a,tb(f,c,e),$("#"+f).removeClass("jstree-checked"),$("#"+f).addClass("jstree-unchecked"),$("#"+c+"_Root").removeClass("jstree-undetermined"),$("#"+c+"_Root").removeClass("jstree-checked"),$("#"+c+"_Root").addClass("jstree-unchecked"),d=d.slice(h+1);fb();$("#moduleTree").find("li").each(function(k,r){$("#"+$(r).attr("id")+" >a").css("color","black")});$("#moduleTree").jstree("close_all");xa=[];e=[];B=[];Ka=[];g=b=n=h=f=c=c=d=a=null}function Jb(a){var d,c,e,f,h=[],n="",b=!0;if(0!==NUTOOL_PIN.g_cfg_shareBits.length){var g=
$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof g&&-1!==g.indexOf("UIlanguage:"))if(g=g.sliceAfterX("UIlanguage:"),g=g.slicePriorToX("\r"),"Simplified Chinese"===g){var k="\u6216";var r="\u5e94\u4e3a";var v="\u3002";var w="(\u518d\u6b21\u914d\u7f6e\u5b83)"}else"Traditional Chinese"===g?(k="\u6216",r="\u61c9\u70ba",v="\u3002",w="(\u518d\u6b21\u914d\u7f6e\u5b83)"):(k=" or ",r=" should be ",v=".",w="(configure it again)");else k=" or ",r=" should be ",v=".",w="(configure it again)";
g=0;for(d=NUTOOL_PIN.g_cfg_shareBits.length;g<d;g+=1){var p=NUTOOL_PIN.g_cfg_shareBits[g];var q=0;for(c=NUTOOL_PIN.g_cfg_gpioMatrix.length;q<c;q+=1){var t=-1;var l=1;for(e=NUTOOL_PIN.g_cfg_gpioMatrix[q].f.length;l<e;l+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[q].f[l].indexOf(p)){var y=NUTOOL_PIN.g_cfg_gpioMatrix[q].f[0];t=$.inArray(y,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==t&&-1===$.inArray(t,h)){h.push(t);var u=0;l=1;for(e=NUTOOL_PIN.g_cfg_gpioMatrix[q].f.length;l<e;l+=
1){var z=NUTOOL_PIN.g_cfg_gpioMatrix[q].f[l];var F=parseInt(z.slice(z.indexOf("[")+1,z.indexOf("]")),10);var J=1<<F>>>0;z=z.slicePriorToX("[");z=L[z];u+=((z&J)>>>F)*Math.pow(2,l-1)}var aa=D[t];F=0;var ba=gb(y,parseInt(y.sliceAfterX("."),10));l=1;for(e=NUTOOL_PIN.g_cfg_gpios[ba].f.length;l<e;l+=1)if(0===NUTOOL_PIN.g_cfg_gpios[ba].f[l].indexOf(aa+":")){F=NUTOOL_PIN.g_cfg_gpios[ba].f[l];F=parseInt(F.slice(F.indexOf(":")+1),10);break}""===aa&&(aa=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][t]);
if(u!==F){b=!1;u=[];l=1;for(e=NUTOOL_PIN.g_cfg_gpioMatrix[q].f.length;l<e;l+=1)if(-1!==$.inArray(NUTOOL_PIN.g_cfg_gpioMatrix[q].f[l].slicePriorToX(":"),NUTOOL_PIN.g_cfg_shareBits)&&(z=NUTOOL_PIN.g_cfg_gpioMatrix[q].f[l],F=parseInt(z.slice(z.indexOf("[")+1,z.indexOf("]")),10),J=1<<F>>>0,z=z.slicePriorToX("["),z=L[z],z&J))for(J=1<<l-1>>>0,z=1,f=NUTOOL_PIN.g_cfg_gpios[ba].f.length;z<f;z+=1)F=NUTOOL_PIN.g_cfg_gpios[ba].f[z],F=parseInt(F.slice(F.indexOf(":")+1),10),F&J&&(0===NUTOOL_PIN.g_cfg_gpios[ba].f[z].indexOf(aa)?
u.push(aa+w):u.push(NUTOOL_PIN.g_cfg_gpios[ba].f[z]));0===u.length&&u.push(NUTOOL_PIN.g_cfg_gpios[ba].f[0].slicePriorToX(":"));J="";l=0;for(e=u.length;l<e;l+=1)0!==l&&l===e-1?J+=k:0!==l&&(J+=", "),J+=u[l].slicePriorToX(":"),l===e-1&&(J+=v);n=n+aa+"(Pin"+(t+1)+")"+r+J+" <br />"}}}}b||a("shareBit",n)}"undefined"!==typeof ab.USB&&(J=D.join(),-1!==J.indexOf("USB_D+")&&-1!==J.indexOf("USB_D-")&&-1===J.indexOf("USB_OTG_ID")&&(b=!1,a("USB_OTG_ID",n)));return b}function Pb(a,d){var c=$.ajax({url:"NuToolSetup.txt",
async:!1}).responseText;if("shareBit"===a)"undefined"!==typeof c&&-1!==c.indexOf("UIlanguage:")?(c=c.sliceAfterX("UIlanguage:"),c=c.slicePriorToX("\r"),"Simplified Chinese"===c?(a="\u5171\u4eab\u4f4d\u5143\u9519\u8bef",d="\u4e00\u4e9b\u6682\u5b58\u5668\u4f4d\u5143\u53ef\u80fd\u88ab\u590d\u6570\u4e2a\u591a\u529f\u80fd\u7ed9\u8bbe\u7f6e\u3002\u8fd9\u4e9b\u4f4d\u5143\u79f0\u4e4b\u4e3a\u5171\u4eab\u4f4d\u5143\u3002\u4e0b\u9762\u5171\u4eab\u4f4d\u5143\u4e0e\u591a\u529f\u80fd\u7ec4\u6210\u7684\u5bf9\u5e94\u5173\u7cfb\u4f1a\u662f\u4e0d\u6b63\u786e\u7684\u3002<br /><br />"+
d+"<br />\u9664\u975e\u5b83\u4eec\u90fd\u88ab\u4fee\u6b63\uff0c\u5426\u5219\u5b58\u6863\u4e36\u4ea7\u751f\u7a0b\u5f0f\u7801\u53ca\u5370\u51fa\u62a5\u544a\u8fd9\u4e9b\u64cd\u4f5c\u5c06\u4e0d\u88ab\u5141\u8bb8\u3002",c="\u786e\u5b9a"):"Traditional Chinese"===c?(a="\u5171\u4eab\u4f4d\u5143\u932f\u8aa4",d="\u4e00\u4e9b\u66ab\u5b58\u5668\u4f4d\u5143\u53ef\u80fd\u88ab\u8907\u6578\u500b\u591a\u529f\u80fd\u7d66\u8a2d\u7f6e\u3002\u9019\u4e9b\u4f4d\u5143\u7a31\u4e4b\u70ba\u5171\u4eab\u4f4d\u5143\u3002\u4e0b\u9762\u5171\u4eab\u4f4d\u5143\u8207\u591a\u529f\u80fd\u7d44\u6210\u7684\u5c0d\u61c9\u95dc\u4fc2\u6703\u662f\u4e0d\u6b63\u78ba\u7684\u3002<br /><br />"+
d+"<br />\u9664\u975e\u5b83\u5011\u90fd\u88ab\u4fee\u6b63\uff0c\u5426\u5247\u5b58\u6a94\u3001\u7522\u751f\u7a0b\u5f0f\u78bc\u53ca\u5370\u51fa\u5831\u544a\u9019\u4e9b\u64cd\u4f5c\u5c07\u4e0d\u88ab\u5141\u8a31\u3002",c="\u78ba\u5b9a"):(a="Shared Bits Error",d="Some bits of GPIO registers would be configured by multiple multi-functions.These bits are called Shared Bits. The following corresponding relations between shared bits and multi-functions are incorrect.<br /><br />"+d+"<br />Unless they are all fixed, the operations of saving configuration, generating code and printing report will not be permitted.",
c="Confirm")):(a="Shared Bits Error",d="Some bits of GPIO registers would be configured by multiple multi-functions.These bits are called Shared Bits. The following corresponding relations between shared bits and multi-functions are incorrect.<br /><br />"+d+"<br />Unless they are all fixed, the operations of saving configuration, generating code and printing report will not be permitted.",c="Confirm");else if("USB_OTG_ID"===a)"undefined"!==typeof c&&-1!==c.indexOf("UIlanguage:")?(c=c.sliceAfterX("UIlanguage:"),
c=c.slicePriorToX("\r"),"Simplified Chinese"===c?(a="\u4e0d\u6b63\u786e\u7684USB\u8bbe\u7f6e",d="\u5f53USB\u5f00\u542f\u65f6\uff0cUSB_OTG_ID\u5fc5\u987b\u88ab\u8bbe\u7f6e\u3002",c="\u786e\u5b9a"):"Traditional Chinese"===c?(a="\u4e0d\u6b63\u78ba\u7684USB\u8a2d\u7f6e",d="\u7576USB\u958b\u555f\u6642\uff0cUSB_OTG_ID\u5fc5\u9808\u88ab\u8a2d\u7f6e\u3002",c="\u78ba\u5b9a"):(a="Incorrect USB Settings",d="USB_OTG_ID must be configured when enabling USB.",c="Confirm")):(a="Incorrect USB Settings",d="USB_OTG_ID must be configured when enabling USB.",
c="Confirm");else return;Ma();$('<div id="showPinErrorDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#showPinErrorDialog").dialog("destroy")},buttons:[{text:c,click:function(){$("#showPinErrorDialog").dialog("isOpen")&&$("#showPinErrorDialog").dialog("destroy")}}]});c=c=d=a=null}function bd(a,d){var c=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;
if("shareBit"===a)if("undefined"!==typeof c&&-1!==c.indexOf("UIlanguage:"))if(c=c.sliceAfterX("UIlanguage:"),c=c.slicePriorToX("\r"),"Simplified Chinese"===c){a="\u5171\u4eab\u4f4d\u5143\u9519\u8bef";d="\u4e00\u4e9b\u6682\u5b58\u5668\u4f4d\u5143\u53ef\u80fd\u88ab\u590d\u6570\u4e2a\u591a\u529f\u80fd\u7ed9\u8bbe\u7f6e\u3002\u8fd9\u4e9b\u4f4d\u5143\u79f0\u4e4b\u4e3a\u5171\u4eab\u4f4d\u5143\u3002\u4e0b\u9762\u5171\u4eab\u4f4d\u5143\u4e0e\u591a\u529f\u80fd\u7ec4\u6210\u7684\u5bf9\u5e94\u5173\u7cfb\u4f1a\u662f\u4e0d\u6b63\u786e\u7684\u3002<br /><br />"+
d+"<br />\u82e5\u4f60\u4ecd\u60f3\u8981\u5173\u6389\u5e94\u7528\u7a0b\u5f0f\uff0c\u8bf7\u6309'\u5173\u95ed'\u3002\u4f46\u6240\u6709\u8bbe\u7f6e\u5c06\u4f1a\u56de\u590d\u5230\u521d\u59cb\u503c\u3002\u82e5\u4f60\u60f3\u8981\u4fee\u6b63\u4ed6\u4eec\uff0c\u8bf7\u6309'\u4fee\u6b63'\u3002";c="\u5173\u95ed";var e="\u4fee\u6b63"}else"Traditional Chinese"===c?(a="\u5171\u4eab\u4f4d\u5143\u932f\u8aa4",d="\u4e00\u4e9b\u66ab\u5b58\u5668\u4f4d\u5143\u53ef\u80fd\u88ab\u8907\u6578\u500b\u591a\u529f\u80fd\u7d66\u8a2d\u7f6e\u3002\u9019\u4e9b\u4f4d\u5143\u7a31\u4e4b\u70ba\u5171\u4eab\u4f4d\u5143\u3002\u4e0b\u9762\u5171\u4eab\u4f4d\u5143\u8207\u591a\u529f\u80fd\u7d44\u6210\u7684\u5c0d\u61c9\u95dc\u4fc2\u6703\u662f\u4e0d\u6b63\u78ba\u7684\u3002<br /><br />"+
d+"<br />\u82e5\u4f60\u4ecd\u60f3\u8981\u95dc\u6389\u61c9\u7528\u7a0b\u5f0f\uff0c\u8acb\u6309'\u95dc\u9589'\u3002\u4f46\u6240\u6709\u8a2d\u7f6e\u5c07\u6703\u56de\u5fa9\u5230\u521d\u59cb\u503c\u3002\u82e5\u4f60\u60f3\u8981\u4fee\u6b63\u4ed6\u5011\uff0c\u8acb\u6309'\u4fee\u6b63'\u3002",c="\u95dc\u9589",e="\u4fee\u6b63"):(a="Shared Bit Error",d="Some bits of GPIO registers would be configured by multiple multi-functions.These bits are called Shared Bits. The following corresponding relations between shared bits and multi-functions are incorrect.<br /><br />"+
d+"<br />If you still want to close the application, please press Close. But all the configuration will be restored to the default.If you want to fix them, please press Fix.",c="Close",e="Fix");else a="Shared Bit Error",d="Some bits of GPIO registers would be configured by multiple multi-functions.These bits are called Shared Bits. The following corresponding relations between shared bits and multi-functions are incorrect.<br /><br />"+d+"<br />If you still want to close the application, please press Close. But all the configuration will be restored to the default.If you want to fix them, please press Fix.",
c="Close",e="Fix";else if("USB_OTG_ID"===a)"undefined"!==typeof c&&-1!==c.indexOf("UIlanguage:")?(c=c.sliceAfterX("UIlanguage:"),c=c.slicePriorToX("\r"),"Simplified Chinese"===c?(a="\u4e0d\u6b63\u786e\u7684USB\u8bbe\u7f6e",d="\u5f53USB\u5f00\u542f\u65f6\uff0cUSB_OTG_ID\u5fc5\u987b\u88ab\u8bbe\u7f6e\u3002",c="\u5173\u95ed",e="\u4fee\u6b63"):"Traditional Chinese"===c?(a="\u4e0d\u6b63\u78ba\u7684USB\u8a2d\u7f6e",d="\u7576USB\u958b\u555f\u6642\uff0cUSB_OTG_ID\u5fc5\u9808\u88ab\u8a2d\u7f6e\u3002",c="\u95dc\u9589",
e="\u4fee\u6b63"):(a="Incorrect USB Settings",d="USB_OTG_ID must be configured when enabling USB.",c="Close",e="Fix")):(a="Incorrect USB Settings",d="USB_OTG_ID must be configured when enabling USB.",c="Close",e="Fix");else return;Ma();$('<div id="showPinErrorDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#showPinErrorDialog").dialog("destroy")},
buttons:[{text:c,click:function(){$("#showPinErrorDialog").dialog("isOpen")&&$("#showPinErrorDialog").dialog("destroy");vc();Bc();window.external.closeFromJS()}},{text:e,click:function(){$("#showPinErrorDialog").dialog("isOpen")&&$("#showPinErrorDialog").dialog("destroy")}}]});c=c=d=a=null}function Tb(a){var d,c=!0,e=[];if($("#rootTree_Pin").is(":visible")){e=za(L);var f=0;for(d=e.length;f<d;f+=1)if(ec[e[f]]!==L[e[f]]){c=!1;break}c?a():(sb(),"Simplified Chinese"===oa?(f="\u8b66\u544a",d="\u914d\u7f6e\u6863\u5df2\u88ab\u4fee\u6539\u8fc7\u3002\u8bf7\u95ee\u4f60\u8981\u50a8\u5b58\u5b83\u5417?",
c="\u8981",e="\u4e0d\u8981"):"Traditional Chinese"===oa?(f="\u8b66\u544a",d="\u914d\u7f6e\u6a94\u5df2\u88ab\u4fee\u6539\u904e\u3002\u8acb\u554f\u4f60\u8981\u5132\u5b58\u5b83\u55ce?",c="\u8981",e="\u4e0d\u8981"):(f="Warning",d="The configuration has been modified.<br />Would you like to save it?",c="Yes",e="No"),Ma(),$('<div id="warningForSavingDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!0,draggable:!1,resizable:!1,title:f,width:500,
height:"auto",show:"fade",hide:"fade",close:function(){$("#warningForSavingDialog").dialog("destroy")},buttons:[{text:c,click:function(){if(Jb(Pb))try{external.saveConfigFromJS("NUC_BROWSE_PROJECT_PATH")}catch(h){}a();$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").dialog("destroy")}},{text:e,click:function(){a();Zb();$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").dialog("destroy")}}]}),e=c=d=f=null);c=null;e=[]}}function Xc(a){var d="";var c=
$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof c&&-1!==c.indexOf("UIlanguage:"))if(c=c.sliceAfterX("UIlanguage:"),c=c.slicePriorToX("\r"),"Simplified Chinese"===c){c="\u51b2\u7a81\u7684\u8c03\u6574";var e="\u4e00\u4e9b\u6a21\u7ec4\u5df2\u88ab\u8c03\u6574\uff0c\u5176\u5b83\u65e0\u6cd5\u8c03\u6574\u7684\u5df2\u88ab\u79fb\u9664\u3002\u5217\u8868\u5982\u4e0b:<hr>";var f="\u7b2c";var h="\u811a\u4f4d";var n="\u4ece";var b="\u5df2\u79fb\u9664";var g="\u590d\u539f";var k="\u786e\u5b9a"}else"Traditional Chinese"===
c?(c="\u885d\u7a81\u7684\u8abf\u6574",e="\u4e00\u4e9b\u6a21\u7d44\u5df2\u88ab\u8abf\u6574\uff0c\u5176\u5b83\u7121\u6cd5\u8abf\u6574\u7684\u5df2\u88ab\u79fb\u9664\u3002\u5217\u8868\u5982\u4e0b:<hr>",f="\u7b2c",h="\u8173\u4f4d",n="\u5f9e",b="\u5df2\u79fb\u9664",g="\u5fa9\u539f",k="\u78ba\u5b9a"):(c="Adjustment of the Conflict",e="Some modules have been adjusted. The others unable to adjust have been removed. Here is the list:<hr>",f=" Pin",h="",n="from",b=" has been removed",g="Undo",k="Confirm");else c=
"Adjustment of the Conflict",e="Some modules have been adjusted. The others unable to adjust have been removed. Here is the list:<hr>",f=" Pin",h="",n="from",g="Undo",k="Confirm";for(;-1!==a.indexOf(";");)d=a.sliceAfterX("/").slicePriorToX(";"),-1!==a.slicePriorToX(";").indexOf("removed")?(d="",a.slicePriorToX(":")!==D[parseInt(a.sliceAfterX(":").slicePriorToX("/"),10)-1]&&(e+="<b><big>"+ya(a.slicePriorToX(":"))+":"+f+X(a.sliceAfterX(":").slicePriorToX("/"))+h+b+"</big></b><br />",e+=ya(D[parseInt(a.sliceAfterX(":").slicePriorToX("/"),
10)-1])+":"+f+X(a.sliceAfterX(":").slicePriorToX("/"))+h+"<hr>")):-1!==a.slicePriorToX(";").indexOf("end")?(d="",e+=ya(a.slicePriorToX(":"))+":"+f+X(a.sliceAfterX(":").slicePriorToX("/"))+h+"<hr>"):e+=ya(a.slicePriorToX(":"))+":"+f+X(a.sliceAfterX(":").slicePriorToX("/"))+h+"("+n+f+X(a.sliceAfterX("/").slicePriorToX(";"))+h+")<br />",a=a.sliceAfterX(";");""!==d&&(e+=ya(D[parseInt(d,10)-1])+":"+f+X(d)+h+"<hr>");Ma();$('<div id="adjustedModulesDialog"><p>'+e+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:c,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#adjustedModulesDialog").dialog("destroy")},buttons:[{text:g,click:function(){var r,v=za(L);Gb=!0;Da=[];var w=0;for(r=v.length;w<r;w+=1)Da[v[w]]=Sb[v[w]];Fa=[];w=0;for(r=Nb.length;w<r;w+=1)Fa[w]=Nb[w];xa=[];L=[];Va=[];D=[];fa();rb();ua.removeContext($("#NUC_PinConfiguration_Canvas"));ua.removeContext($("#NUC_PinConfiguration_Canvas_Lining"));$("#mfpTree").jstree("destroy");$("#supportedModules").jstree("destroy");
$("#moduleTree").jstree("destroy");$("#mfpTree").remove();$("#supportedModules").remove();$("#moduleTree").remove();$("div").remove(".tooltip");oc();0===$("#NUC_PinConfiguration_Canvas").length&&$("#panel")[0].appendChild($a("canvas","NUC_PinConfiguration_Canvas"));rc();ta();ra();Cb();nc();$("#adjustedModulesDialog").dialog("isOpen")&&$("#adjustedModulesDialog").dialog("destroy")}},{text:k,click:function(){$("#adjustedModulesDialog").dialog("isOpen")&&$("#adjustedModulesDialog").dialog("destroy")}}]});
c=k=b=n=h=f=d=e=c=null}function Oc(){var a,d,c=[];Ub="Pin,Current Multi Function\n";var e=0;for(a=1;e<Q;e+=1){var f=""!==D[e]?NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e]+"/"+ya(D[e]).replace(/[.]/g,"").replace(/\s/g,"_").replace(/[`~!@#$%^&*()|+\-=?;:'",<>\{\}\[\]\\\/]/gi,"_"):NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e];-1===f.indexOf("NC_ToolNotShow")&&(Ub+=X(e+1)+","+f+"\n",va(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e])&&""!==D[e]&&(f={},f.id=a,f.pin=X(e+
1)+" ("+NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e]+")",f.pinNumber=e+1,f.description=D[e],"undefined"!==typeof Ja[D[e]]&&""!==Ja[D[e]].trim()?f.userDefined=Ja[D[e]]:f.userDefined="",a+=1,c.push(f)))}Ub+="\nPin,Description\n";for(e=0;e<Q;e+=1){f="";var h=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e];var n=h+":0";a=0;for(d=NUTOOL_PIN.g_cfg_gpios.length;a<d;a+=1)if(n===NUTOOL_PIN.g_cfg_gpios[a].f[0]){d=0;for(n=NUTOOL_PIN.g_cfg_gpios[a].f.length;d<n;d+=1)f+=NUTOOL_PIN.g_cfg_gpios[a].f[d].slicePriorToX(":"),
d!==NUTOOL_PIN.g_cfg_gpios[a].f.length-1&&(f+="/");break}""===f&&(f=h);-1===f.indexOf("NC_ToolNotShow")&&(Ub+=X(e+1)+","+f+"\n")}return c}function Zb(){var a;var d=za(L);ec=[];var c=0;for(a=d.length;c<a;c+=1)ec[d[c]]=L[d[c]]}function Pc(a,d,c){Ja[d]=c.trim();Ab(parseInt(a,10)-1,d.trim(),!1);-1===E.indexOf("WLCSP")&&-1===E.indexOf("BGA")||yb(parseInt(a,10),"savedPinPadColor")}function Xb(a){var d,c,e="checked=true",f="",h=d="",n=[],b="",g="",k="",r="",v="",w=null,p,q=[];var t=$.ajax({url:"NuToolSetup.txt",
async:!1}).responseText;var l="",y="",u="",z="",F=z="";n="";var J=function(H,O){var ma,U='*?"<>|'.split(""),qa=!0;var ha=0;for(ma=U.length;ha<ma;ha+=1){var M=U[ha];if(-1!==O.indexOf(U[ha])){Sa("\u5de5\u7a0b\u8def\u5f84\u4e0d\u5e94\u8be5\u5305\u542b"+M+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u8def\u5f91\u4e0d\u61c9\u8a72\u5305\u542b"+M+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project path should not contain "+M+". Please fix it.");qa=!1;break}}U.push("\\");U.push("/");U.push(":");ha=
0;for(ma=U.length;ha<ma;ha+=1)if(M=U[ha],-1!==H.indexOf(M)){Sa("\u5de5\u7a0b\u540d\u79f0\u4e0d\u5e94\u8be5\u5305\u542b"+M+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u540d\u7a31\u4e0d\u61c9\u8a72\u5305\u542b"+M+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project name should not contain "+M+". Please fix it.");qa=!1;break}O.charAt(0).match(/^[a-zA-Z]/)&&O.charAt(1).match(/^[:]/)&&O.charAt(2).match(/^[\/\\]/)||(Sa("\u5de5\u7a0b\u8def\u5f84\u5f00\u5934\u5e94\u4e3a\u78c1\u789f\u673a\u4ee3\u53f7\u3001\u78c1\u789f\u533a\u5206\u9694\u7b26\u53f7\u548c\u5143\u4ef6\u5206\u9694\u7b26\u53f7(C:)\u3002\u8bf7\u4fee\u6b63\u5b83\u3002",
"\u5c08\u6848\u8def\u5f91\u958b\u982d\u61c9\u70ba\u78c1\u789f\u6a5f\u4ee3\u865f\u3001\u78c1\u789f\u5340\u5206\u9694\u7b26\u865f\u548c\u5143\u4ef6\u5206\u9694\u7b26\u865f(C:)\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project path should begin with a drive letter, a volume separator and a component separator (C:). Please fix it."),qa=!1);H.slice(-1).match(/^[ .]/)&&(Sa("\u5de5\u7a0b\u540d\u79f0\u4e0d\u5e94\u4ee5\u7a7a\u683c\u6216\u53e5\u53f7\u7ed3\u5c3e\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u540d\u7a31\u4e0d\u61c9\u4ee5\u7a7a\u683c\u6216\u53e5\u865f\u7d50\u5c3e\u3002\u8acb\u4fee\u6b63\u5b83\u3002",
"The project name should not end with a space or peroid. Please fix it."),qa=!1);return qa};var aa=function(){-1!==oa.indexOf("Simplified")?(b="\u811a\u4f4d",g="\u63cf\u8ff0",k="\u7528\u6237\u5b9a\u4e49",r="\u4ec5\u9650\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u5e95\u7ebf\u3002\n\u6700\u5927\u8f93\u5165\u957f\u5ea6\u4e3a30\u3002",v="\u6ca1\u6709\u53ef\u7528\u6570\u636e\uff0c\u56e0\u4e3a\u5c1a\u672a\u914d\u7f6e\u3002"):-1!==oa.indexOf("Traditional")?(b="\u8173\u4f4d",g="\u63cf\u8ff0",k="\u7528\u6236\u5b9a\u7fa9",
r="\u50c5\u9650\u82f1\u6587\u5b57\u6bcd\u3001\u6578\u5b57\u548c\u5e95\u7dda\u3002\n\u6700\u5927\u8f38\u5165\u9577\u5ea6\u70ba30\u3002",v="\u6c92\u6709\u53ef\u7528\u6578\u64da\uff0c\u56e0\u70ba\u5c1a\u672a\u914d\u7f6e\u3002"):(b="Pin",g="Description",k="User Defined",r="English letters, digits and underscores only.\nMaximum length of input is 30.",v="No data available because not configured yet.");$("#reviewReportTable")[0]||$("<div id='reviewReportTable'></div>").insertAfter($("#generateCodeDialogMainPart_div"));
q=Oc();p=10<q.length?"282px":"100%";0<q.length?(w=new Tabulator("#reviewReportTable",{height:p,data:q,layout:"fitColumns",columns:[{title:b,field:"pin",headerFilter:!0},{title:g,field:"description",headerFilter:!0},{title:k,field:"userDefined",headerFilter:!0,editor:!0,validator:["regex:^[a-zA-Z0-9 _]+$","maxLength:30"],tooltip:r}],cellEdited:function(H){Pc(H._cell.row.data.pinNumber,H._cell.row.data.description,H._cell.value)},langs:{Simplified:{headerFilters:{"default":"\u8fc7\u6ee4"}},Traditional:{headerFilters:{"default":"\u904e\u6ffe..."}},
English:{headerFilters:{"default":"filter..."}}}}),-1!==oa.indexOf("Simplified")?w.setLocale("Simplified"):-1!==oa.indexOf("Traditional")?w.setLocale("Traditional"):w.setLocale("English")):0===q.length&&(w=new Tabulator("#reviewReportTable",{height:p,placeholder:v}))};if(!1!==Jb(Pb)){if("undefined"!==typeof t&&-1!==t.indexOf("UIlanguage:")){l=t.sliceAfterX("CheckCriteriaPin:");l=l.slicePriorToX("\r");""===l&&(l="Yes");y=t.sliceAfterX("CheckCriteriaModule:");y=y.slicePriorToX("\r");u=t.sliceAfterX("CheckCriteriaGPIO:");
u=u.slicePriorToX("\r");z=t.sliceAfterX("CheckModularizeCode:");z=z.slicePriorToX("\r");if("No"===z||""===z)e="";z=t.sliceAfterX("ProjectName:");z=z.slicePriorToX("\r");F=t.sliceAfterX("ProjectLocation:");F=F.slicePriorToX("\r");n=t.sliceAfterX("ProjectLocationHistory:");n=n.slicePriorToX("\r");t=t.sliceAfterX("UIlanguage:");t=t.slicePriorToX("\r");if("Simplified Chinese"===t){t="\u4ea7\u751f\u7a0b\u5f0f\u7801";var ba="\u7528\u6237\u5b9a\u4e49\u529f\u80fd";var da="\u5de5\u7a0b\u540d\u79f0";var S=
"\u8bf7\u8f93\u5165\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u7528\u4e8e\u5b58\u653e\u751f\u6210\u7684\u4ee3\u7801:";var Ea="\u8bf7\u6ce8\u610f\uff0c\u672c\u8f6f\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u672f\u53c2\u8003\u624b\u518c\u6216\u89c4\u683c\u4e66\u3002\u7528\u6237\u5fc5\u987b\u53c2\u8003\u6700\u65b0\u6587\u6863\u4ee5\u786e\u4fdd\u6b63\u786e\u6027\u3002";d="\u6216\u662f\u60a8\u53ef\u4ee5\u4ece\u6700\u8fd1\u7684\u5de5\u7a0b\u4e2d\u9009\u62e9\u4e00\u4e2a";h="\u6d4f\u89c8";var bb="\u6a21\u7ec4\u5316\u4ee3\u7801";
var wb="\u68c0\u9605\u62a5\u544a";var cb="\u786e\u5b9a"}else"Traditional Chinese"===t?(t="\u7522\u751f\u7a0b\u5f0f\u78bc",ba="\u7528\u6236\u5b9a\u7fa9\u529f\u80fd",da="\u5c08\u6848\u540d\u7a31",S="\u8acb\u8f38\u5165\u8cc7\u6599\u593e\u8def\u5f91\uff0c\u7528\u65bc\u5b58\u653e\u751f\u6210\u7684\u7a0b\u5f0f\u78bc:",Ea="\u8acb\u6ce8\u610f\uff0c\u672c\u8edf\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u8853\u53c3\u8003\u624b\u518a\u6216\u898f\u683c\u66f8\u3002\u7528\u6236\u5fc5\u9808\u53c3\u8003\u6700\u65b0\u6587\u6a94\u4ee5\u78ba\u4fdd\u6b63\u78ba\u6027\u3002",
d="\u6216\u662f\u60a8\u53ef\u4ee5\u5f9e\u6700\u8fd1\u7684\u5c08\u6848\u4e2d\u9078\u64c7\u4e00\u500b",h="\u700f\u89bd",bb="\u6a21\u7d44\u5316\u7a0b\u5f0f\u78bc",wb="\u6aa2\u95b1\u5831\u544a",cb="\u78ba\u5b9a"):(t="Generate Code",ba="User Defined Functions",da="Project Name",S="Please input a folder path for storing the generated code:",Ea="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",
d="Or you can choose a folder from recent projects",h="Browse",bb="Modularize Code",wb="Review Report",cb="Confirm")}else t="Generate Code",ba="User Defined Functions",da="Project Name",S="Please input a folder path for storing the generated code:",Ea="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",d="Or you can choose a folder from recent projects",h="Browse",bb="Modularize Code",
wb="Review Report",cb="Confirm";""===z.trim()&&(z="MyProject");if(""!==n.trim()){n=n.split(">");f='<br /><label><select id="generateCodeDialogSelect" style="width: 450px;height:32px;"><option value="default">'+d+"</option>";d=0;for(c=n.length-1;d<c;d++)f+='<option value="'+n[d]+'">'+n[d]+"</option>";f+="</select></label>"}if(-1==="ML51 ML56 ML5156 MS51_8K MS51_8KDB MS51_16K MS51_32K".split(" ").indexOf(m)&&0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===
NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:"))var Eb="checkbox";else bb="",Eb="hidden",e="";Ma();"undefined"===typeof a?$('<div id="generateCodeDialog"><div id="generateCodeDialogMainPart_div"><label>'+(da+': <input type="text" id="inputText_projectName" value="'+z+'" style="width:250px;height:24px;"></label><br /><br /><label><p>'+S+'</p></label><label><input id="generateCodeDialogInput" type="text" style="width:362px;height:24px;" value="'+F+'"><button id="generateCodeDialogBrowseFolder" style="width:80px;height:28px;">'+
h+"</button></label>"+f+"<br /><br /><p>"+Ea+'</p></div><div id="reviewReportTable"></div></div>')).dialog({modal:!1,resizable:!1,title:t,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},create:function(H,O){H=$(this).dialog("widget").find(".ui-dialog-buttonpane");$("html").hasClass("ie10+")?$("<div class='generateCodeByModule'><input type='"+Eb+"' id='checkbox_ModularizeCode' "+e+"/>"+bb+"<input type='checkbox' id='checkbox_ReviewReport'/>"+
wb+"</div>").prependTo(H):$("<div class='generateCodeByModule'><label><input type='"+Eb+"' id='checkbox_ModularizeCode' "+e+"/>"+bb+" </label></div>").prependTo(H)},buttons:[{id:"generateCodeDialog_buttonOk",text:cb,click:function(){$("#generateCodeDialog_buttonOk").button("disable");""===$("#inputText_projectName").val().trim()&&$("#inputText_projectName").val("MyProject");if(J($("#inputText_projectName").val(),$("#generateCodeDialogInput").val())){try{external.generateCodeFromJS($("#inputText_projectName").val(),
$("#generateCodeDialogInput").val(),"CheckCriteriaPin:"+l+"/CheckCriteriaModule:"+y+"/CheckCriteriaGPIO:"+u+"/CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"))}catch(H){}$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}else $("#generateCodeDialog_buttonOk").button("enable")}}]}):0===a.indexOf("userDefined")&&($('<div id="generateCodeDialog"><div id="reviewReportTable"><input type="text" size="1" style="position:relative;top:-5000px;"/></div></div>').dialog({modal:!1,
resizable:!1,title:ba,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},buttons:[{id:"generateCodeDialog_buttonOk",text:cb,click:function(){-1!==a.indexOf("runAnotherTool")?Qc():$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}}]}),aa());$("#generateCodeDialogInput").keypress(function(H){switch(H.which){case 22:$("#generateCodeDialogInput").val(window.clipboardData.getData("Text"))}});$("#generateCodeDialogBrowseFolder").click(function(){""===
$("#inputText_projectName").val().trim()&&$("#inputText_projectName").val("MyProject");try{external.generateCodeFromJS($("#inputText_projectName").val(),"generateCodeDialogInput:none","CheckCriteriaPin:"+l+"/CheckCriteriaModule:"+y+"/CheckCriteriaGPIO:"+u+"/CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"))}catch(H){}""!==NUTOOL_PIN.g_pinFunctionString&&-1!==NUTOOL_PIN.g_pinFunctionString.indexOf(":")&&$("#generateCodeDialogInput").val(NUTOOL_PIN.g_pinFunctionString);$("#generateCodeDialog").focus()});
$("#generateCodeDialogSelect").change(function(){"default"!==$("#generateCodeDialogSelect").val()&&($("#generateCodeDialogInput").val($("#generateCodeDialogSelect").val()),$("#generateCodeDialogSelect").val($("#generateCodeDialogSelect option:first-child").val()))});$("#checkbox_ReviewReport").change(function(){$("#checkbox_ReviewReport").is(":checked")?(aa(),$("#generateCodeDialogMainPart_div").hide(),$("#generateCodeDialog_buttonOk").button("disable")):($("#reviewReportTable").remove(),$("#generateCodeDialogMainPart_div").show(),
$("#generateCodeDialog_buttonOk").button("enable"))})}}function Qc(){var a="NuCAD";if(!1!==Jb(Pb)){var d=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if($("#rootTree_Pin").is(":visible")){"undefined"!==typeof NUTOOL_PIN.g_anotherNameForNuCAD&&""!==NUTOOL_PIN.g_anotherNameForNuCAD&&(a=NUTOOL_PIN.g_anotherNameForNuCAD);if("undefined"!==typeof d&&-1!==d.indexOf("UIlanguage:"))if(d=d.sliceAfterX("UIlanguage:"),d=d.slicePriorToX("\r"),"Simplified Chinese"===d){a="\u6267\u884c"+a;d="\u9009\u62e9\u4e00\u4e2a\u5de5\u5177\u6765\u6267\u884c\u3002";
var c="\u8bf7\u6ce8\u610f\uff0c\u672c\u8f6f\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u672f\u53c2\u8003\u624b\u518c\u6216\u89c4\u683c\u4e66\u3002\u7528\u6237\u5fc5\u987b\u53c2\u8003\u6700\u65b0\u6587\u6863\u4ee5\u786e\u4fdd\u6b63\u786e\u6027\u3002";var e="\u4f7f\u7528NC\u811a\u4f4d\u6765\u663e\u793a\u672a\u914d\u7f6e\u7684\u811a\u4f4d";var f="\u7528\u6237\u5b9a\u4e49\u529f\u80fd";var h="\u786e\u5b9a"}else"Traditional Chinese"===d?(a="\u57f7\u884c"+a,d="\u9078\u64c7\u4e00\u500b\u5de5\u5177\u4f86\u57f7\u884c\u3002",
c="\u8acb\u6ce8\u610f\uff0c\u672c\u8edf\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u8853\u53c3\u8003\u624b\u518a\u6216\u898f\u683c\u66f8\u3002\u7528\u6236\u5fc5\u9808\u53c3\u8003\u6700\u65b0\u6587\u6a94\u4ee5\u78ba\u4fdd\u6b63\u78ba\u6027\u3002",e="\u4f7f\u7528NC\u8173\u4f4d\u4f86\u986f\u793a\u672a\u914d\u7f6e\u7684\u8173\u4f4d",f="\u7528\u6236\u5b9a\u7fa9\u529f\u80fd",h="\u78ba\u5b9a"):(a="Run "+a,d="Select a tool to run.",c="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",
e="Use NC pins to present unconfigured pins",f="User Defined Functions",h="Confirm");else a="Run "+a,d="Select a tool to run.",c="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",e="Use NC pin to present a unconfigured pin",f="User Defined Functions",h="Confirm";Ma();$('<div id="runAnotherToolDialog"><div id="runAnotherToolDialogMainPart_div"><p>'+d+'</p><input type="radio" id="OrCAD" value="OrCAD" name="RunAnotherTool" Checked><label for="OrCAD">OrCAD</label><br /><input type="radio" id="Protel" value="Protel" name="RunAnotherTool"><label for="Protel">Protel</label><br /><br /><label><input type="checkbox" id="checkbox_useNCpin"/>'+
e+"</label><p>"+c+'</p></div><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,draggable:!0,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#runAnotherToolDialog").dialog("destroy")},create:function(n,b){n=$(this).dialog("widget").find(".ui-dialog-buttonpane");$("html").hasClass("ie10+")&&$("<div class='generateCodeByModule'><label><input type='checkbox' id='checkbox_ReviewReport'/>"+f+"</label></div>").prependTo(n)},
buttons:[{id:"runAnotherToolDialog_buttonOk",text:h,click:function(){$("input").each(function(){"RunAnotherTool"===this.name&&!0===this.checked&&($(this).val(),$("#checkbox_useNCpin").is(":checked")?window.external.runAnotherTool($(this).val()+"_UseNCPin"):window.external.runAnotherTool($(this).val()))});$("#runAnotherToolDialog").dialog("isOpen")&&$("#runAnotherToolDialog").dialog("destroy")}}]});$("#checkbox_ReviewReport").change(function(){$("#checkbox_ReviewReport").is(":checked")&&Xb("userDefined_runAnotherTool")})}}}
function Rc(){Vb?jb.readyState?jb.send("q"):Sa("\u8fde\u7ebf\u5c1a\u672a\u7a33\u5b9a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002","\u9023\u7dda\u5c1a\u672a\u7a69\u5b9a\uff0c\u8acb\u7a0d\u5f8c\u518d\u8a66\u3002","The connection is not stable. Please try it later."):(jb=new WebSocket("ws://127.0.0.1:5555","openocd-nuvoton-protocol"),jb.onopen=function(){Vb=!0;jb.readyState?jb.send("q"):Sa("\u8fde\u7ebf\u5c1a\u672a\u7a33\u5b9a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002","\u9023\u7dda\u5c1a\u672a\u7a69\u5b9a\uff0c\u8acb\u7a0d\u5f8c\u518d\u8a66\u3002",
"The connection is not stable. Please try it later.")},jb.onerror=function(){!1===Vb?Sa("\u8bf7\u68c0\u67e5NuEclipse\u662f\u5426\u8fdb\u5165\u4e86\u8c03\u8bd5\u6a21\u5f0f\u3002\u5982\u679c\u6ca1\u6709\uff0cPinConfig\u5c06\u65e0\u6cd5\u8fde\u63a5\u5230\u76ee\u6807\u82af\u7247\u3002","\u8acb\u6aa2\u67e5NuEclipse\u662f\u5426\u9032\u5165\u4e86\u8abf\u8a66\u6a21\u5f0f\u3002\u5982\u679c\u6c92\u6709\uff0cPinConfig\u5c07\u7121\u6cd5\u9023\u63a5\u5230\u76ee\u6a19\u6676\u7247\u3002","Please check that NuEclipse has entered the debug mode. If not, PinConfig will not be able to connect to a target chip."):
Sa("NuEclipse\u9000\u51fa\u4e86\u8c03\u8bd5\u6a21\u5f0f\u3002","NuEclipse\u9000\u51fa\u4e86\u8abf\u8a66\u6a21\u5f0f\u3002","NuEclipse leaved the debug mode.");Vb=!1;jb=null},jb.onmessage=function(a){if(0===a.data.indexOf("q")){a=a.data;var d;a=a.slice(1);if("UNKNOWN"!==a.toUpperCase()){var c=bc(a);c!==m&&(oldfilename="NUC_"+m+"_Content.js",newfilename="NUC_"+c+"_Content.js",Xa(oldfilename,newfilename,"js"),$("#ChipTypeSelect").val(c),m=c);ib=null;c=0;for(d=NUTOOL_PIN.g_cfg_chips.length;c<d;c+=1)a===
NUTOOL_PIN.g_cfg_chips[c].name&&(ib=NUTOOL_PIN.g_cfg_chips[c].name+"("+NUTOOL_PIN.g_cfg_chips[c].pkg+")");null!==ib&&ib!==E&&($b(),sc(),E=ib,NUTOOL_PIN.decidepackageNumber(),jc(),Gb=!1,Da=[],Fa=[],Ja={},ja=null,tc(),N=100,ub(),Cb(),Ma())}a=jb;c=a.send;var e,f="m";var h=za(NUTOOL_PIN.g_cfg_regDescriptions);d=0;for(e=h.length;d<e;d+=1)0!==d&&(f+=","),f+=NUTOOL_PIN.g_cfg_regDescriptions[h[d]].slice(2);c.call(a,f+",")}else if(0===a.data.indexOf("m")&&(a=a.data,a=a.slice(1),d=a.split(","),f=za(NUTOOL_PIN.g_cfg_regDescriptions),
d.length===f.length)){a=0;for(c=f.length;a<c;a+=1){e=f[a];h=L[e];var n=parseInt(d[a],16);h!==n&&(Jc(e+":0x"+hb(h).toUpperCase()),mb(e+":0x"+hb(n).toUpperCase()))}fb()}})}function Hc(){$("#rootTree_Pin").is(":visible")&&(N=10*Math.ceil(N/10)+5,ub())}function Ic(){$("#rootTree_Pin").is(":visible")&&N>=Hb+5&&(N=10*Math.floor(N/10)-5,ub())}function Sc(){if("undefined"===typeof NUTOOL_PER){if("undefined"!==typeof NUTOOL_PIN.g_toolName&&""!==NUTOOL_PIN.g_toolName)try{external.changeDialogContentFromJS("dialogCaption:"+
NUTOOL_PIN.g_toolName)}catch(a){}if("undefined"!==typeof NUTOOL_PIN.g_toolbarRemovedIndices&&""!==NUTOOL_PIN.g_toolbarRemovedIndices)try{external.changeDialogContentFromJS("dialogToolbarRemovedIndices:"+NUTOOL_PIN.g_toolbarRemovedIndices.replace(/\s/g,""))}catch(a){}"undefined"!==typeof NUTOOL_PIN.g_cfg_chipSeries&&0!==NUTOOL_PIN.g_cfg_chipSeries.length&&(dc=NUTOOL_PIN.g_cfg_chipSeries);"undefined"!==typeof NUTOOL_PIN.g_chipSilkScreenPrint_default&&""!==NUTOOL_PIN.g_chipSilkScreenPrint_default&&(Ta=
NUTOOL_PIN.g_chipSilkScreenPrint_default);"undefined"!==typeof NUTOOL_PIN.g_briefName_default&&""!==NUTOOL_PIN.g_briefName_default&&(Tc=NUTOOL_PIN.g_briefName_default);"undefined"!==typeof NUTOOL_PIN.g_copyrightCompanyName_default&&""!==NUTOOL_PIN.g_copyrightCompanyName_default&&(Uc=NUTOOL_PIN.g_copyrightCompanyName_default)}if(!Ec()){Fc();Gc();Dc()||(Gb=!1);oc();if("undefined"===typeof NUTOOL_PER)try{window.external.updateCurrentDialogSize()}catch(a){Rb=!1}Kc();lc();"undefined"===typeof NUTOOL_PER&&
ad();$("#rootTree_Pin")[0].setAttribute("style","width:275px; height: "+Oa+"px;");rc();ta();$b();ra();nc();Cb();Cc()}}var Q=0,K=0,ea=0,Aa=0,lb=0,Ra=0,mc=0,Qa=0,ka=0,na=24,Qb,Za=0,qb=0,Ya=0,Ua=0,db=0,Oa=0,A=0,R=0,V=0,ib,ua={getContext:null,removeContext:null,addEvent:null},oa="",Ib="",Mb,m,E,Ta="Nuvoton",Tc="NuMicro",Uc=" Nuvoton Technology Corp.",ja,jb=null,nb,ia,Db,ob,Kb,wc,Ub,Wb,xc,yc,zc,W,pb,ac,N=100,ic=100,Hb,Z=[],zb=[],pa=[],la=[],xa=[],Va=[],D=[],Fa=[],Nb=[],Na=[],ab=[],Da=[],L=[],ec=[],Sb=
[],B=[],Ka=[],xb=[],Ga=[],Ja={},dc="NUC400 NUC505 M451 M460 M471 M479 M480 KM1M7 M2351 M251 M261 MA35D1 NUC100 NUC200 NUC029 NDA102 M0A21 M030G M031 M231 M051 M071 M0518 M0519 M0564 MINI51 NANO100 ML51 MS51 NM1120 NM1200 NM1500 ISD9100 ISD9300".split(" "),La=!1,Vb=!1,Ha=!1,Rb=!0,Gb=!0,Fb=!0;window.onload=function(){Sc()};NUTOOL_PIN={getg_userSelectUIlanguage:function(){return oa},getg_partNumber_package:function(){return E},getg_pin_descriptions:function(){return Ub},getg_gpio_MFPsString:function(){return ia},
getg_gpio_MFPsString1:function(){return Db},getg_pinCurrentStateString:function(){return Kb},getg_pinsConfiguredByGPIOstring:function(){return wc},getg_userDefinedPinString:function(){return pb},getg_includeHeadFileString:function(){return nb},getg_generatedCodeByPinString:function(){return Wb},getg_generatedCodeByModuleString:function(){return xc},getg_generatedCodeByGPIOstring:function(){return yc},getg_generatedMFPFunctionList:function(){return zc},getg_toolName:function(){return NUTOOL_PIN.g_toolName},
getg_anotherNameForNuCAD:function(){return NUTOOL_PIN.g_anotherNameForNuCAD},getg_briefName:function(){return Tc},getg_copyrightCompanyName:function(){return Uc},setg_selectedPartNoValue:function(a){ib=a},setReviewReportTable:Pc,loadPinConfigureTool:Sc,loadPinConfigureTool_fromSelectionGuide:function(){Ec()||(sb(),Fc(),Gc(),$("#rootTree_Pin")[0].setAttribute("style","width:275px; height: "+Oa+"px;"),Mc(),Cb(),Cc())},getGeneratedCodeByPin:function(a){var d;Wb="";for(d=1;d<=Q;d+=1)""!==D[d-1]&&(Wb=
"undefined"!==typeof a&&"primitiveDescription"===a?Wb+("Pin"+X(d)+":"+D[d-1]+"\n"):Wb+("Pin"+X(d)+":"+ya(D[d-1])+"\n"))},getGeneratedCodeByModule:function(){var a,d,c=[];for(a=1;a<=Q;a+=1)if(""!==D[a-1]){var e=a;var f=d=D[a-1];-1!==f.indexOf("_")&&(f=f.slicePriorToX("_"));f=x(f);"undefined"===typeof c[f]?(c[f]=[],c[f][0]=ya(d)+"(Pin:"+X(e)+")"):c[f].push(ya(d)+"(Pin:"+X(e)+")")}xc="";var h=za(c);a=0;for(e=h.length;a<e;a+=1)for(c[h[a]].sort(ca),d=0,f=c[h[a]].length;d<f;d+=1)xc+=c[h[a]][d]+"\n"},getGeneratedCodeByGPIO:function(){var a,
d=[];for(a=1;a<=Q;a+=1)if(""!==D[a-1]){var c=a;var e=ya(D[a-1]);var f=x(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]);"undefined"===typeof d[f]?(d[f]=[],d[f][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]+":"+e+"(Pin:"+X(c)+")"):d[f].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]+":"+e+"(Pin:"+X(c)+")")}yc="";var h=za(d).sort(ca);a=0;for(c=h.length;a<c;a+=1)for(d[h[a]].sort(ca),e=0,f=d[h[a]].length;e<f;e+=1)yc+=d[h[a]][e]+"\n"},getGeneratedMFPFunctionList:function(){var a,
d;zc="/";var c=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;c<a;c+=1){var e=0;for(d=NUTOOL_PIN.g_cfg_gpios[c].f.length;e<d;e+=1)zc+=NUTOOL_PIN.g_cfg_gpios[c].f[e]+"/"}},getIncludeHeadFile:qc,getDataUsedToCreateText:function(){var a,d,c,e,f=[],h=[],n="SYS->";"undefined"!==typeof NUTOOL_PER&&qc();"h"!==NUTOOL_PIN.g_pinFunctionString&&"dtsi"!==NUTOOL_PIN.g_pinFunctionString||nb.sliceAfterX(".")===NUTOOL_PIN.g_pinFunctionString||(nb=nb.slicePriorToX(".")+"."+NUTOOL_PIN.g_pinFunctionString+'"\n');ia="";0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&
1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:GPIO_")&&(n="");var b=za(L);b.sort();if(0!==NUTOOL_PIN.g_cfg_gpiosDefines.length){if(-1===nb.indexOf(".dtsi")){var g=0;for(d=b.length;g<d;g+=1)Da[b[g]]=L[b[g]],h[b[g]]=[]}for(g=1;g<=Q;g+=1)if(""!==D[g-1]){var k=g;var r=D[g-1];d=x(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][k-1]);"undefined"===typeof f[d]?(f[d]=[],f[d][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][k-1]+":"+r):
f[d].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][k-1]+":"+r)}var v=za(f).sort(ca);g=0;for(d=v.length;g<d;g+=1)for(f[v[g]].sort(ca),k=0,c=f[v[g]].length;k<c;k+=1){var w=a=f[v[g]][k];a=a.slicePriorToX(":");w=w.sliceAfterX(":");w===a&&(w="GPIO");var p=0;for(e=NUTOOL_PIN.g_cfg_gpiosDefines.length;p<e;p+=1)if(a===NUTOOL_PIN.g_cfg_gpiosDefines[p].f[0]){a=1;for(e=NUTOOL_PIN.g_cfg_gpiosDefines[p].f.length;a<e;a+=1)if(0===NUTOOL_PIN.g_cfg_gpiosDefines[p].f[a].indexOf(w+":")){var q=NUTOOL_PIN.g_cfg_gpiosDefines[p].f[a];
do{if(-1===q.indexOf("/")){var t=q;q=""}else t=q.slicePriorToX("/"),q=q.sliceAfterX("/");a=t;t=-1===nb.indexOf(".dtsi")?t.sliceAfterX("@").slicePriorToX("%"):t.sliceAfterX("@").sliceAfterX("%");a=-1===a.indexOf(":")?a.slicePriorToX("@"):a.slice(a.indexOf(":")+1,a.indexOf("@"));";"===t.slice(-1)&&(t=t.slice(0,-1));w=t.split(";");p=0;for(e=w.length;p<e;p+=1)t=w[p].trim(),"undefined"===typeof h[t]&&(h[t]=[]),h[t].push(a)}while(""!==q);break}break}}if(0===m.indexOf("ML5")){g=0;for(d=b.length;g<d;g+=1)ia+=
"    //"+n+b[g]+" = 0x"+hb(L[b[g]]).toUpperCase()+"UL;\n";ia+="\n";"undefined"===typeof NUTOOL_PER&&(ia+="    /* If the macros do not exist in your project, please refer to the corresponding header file in Header folder of the tool package */\n");g=0;for(d=b.length;g<d;g+=1)if(0<h[b[g]].length)for(k=h[b[g]].length-1;0<=k;--k)ia+="    "+h[b[g]][k]+";\n"}else if(0===m.indexOf("MS51")){g=0;for(d=b.length;g<d;g+=1)ia+="    //"+n+b[g]+" = 0x"+hb(L[b[g]]).toUpperCase()+"UL;\n";ia+="\n";"undefined"===typeof NUTOOL_PER&&
(ia+="    /* If the macros do not exist in your project, please refer to the corresponding header file in Header folder of the tool package */\n");g=0;for(d=b.length;g<d;g+=1)if(0<h[b[g]].length)for(k=0,c=h[b[g]].length;k<c;k+=1)for(w=h[b[g]][k].split(";"),p=0,e=w.length;p<e;p+=1)""!==w[p]&&"NULL"!==w[p].toString().toUpperCase()&&(ia+="    "+w[p]+";\n")}else if(-1!==nb.indexOf(".dtsi")){ia+='/ {\n    model = "Nuvoton '+m+'";\n};\n\n';b=za(h);b.sort();g=0;for(d=b.length;g<d;g+=1)w=b[g].toLowerCase(),
ia+="&"+w+' {\n    pinctrl-names = "default";\n    pinctrl-0 = <&pinctrl_'+w+">;\n};\n\n";ia+="&pinctrl {\n";g=0;for(d=b.length;g<d;g+=1){k=a=0;for(c=h[b[g]].length;k<c;k+=1)h[b[g]][k].length>a&&(a=h[b[g]][k].length);a+=1;w=b[g].toLowerCase();ia+="    "+w+" {\n        pinctrl_"+w+": "+w+"grp {\n            nuvoton,pins =\n";k=0;for(c=h[b[g]].length;k<c;k+=1){ia+="                <"+h[b[g]][k];p=0;for(e=a-h[b[g]][k].length;p<e;p+=1)ia+=" ";ia+="&pcfg_default>";ia=k!==c-1?ia+",\n":ia+";\n"}ia=g!==d-
1?ia+"        };\n    };\n\n":ia+"        };\n    };\n"}ia+="};\n\n"}else{g=0;for(d=b.length;g<d;g+=1)ia+="    //"+n+b[g]+" = 0x"+hb(L[b[g]]).toUpperCase()+"UL;\n";ia+="\n";"undefined"===typeof NUTOOL_PER&&(ia+="    /* If the macros do not exist in your project, please refer to the corresponding header file in Header folder of the tool package */\n");g=0;for(d=b.length;g<d;g+=1)if(0<h[b[g]].length)for(ia+="    "+n+b[g]+" = ",k=h[b[g]].length-1;0<=k;--k)ia=0!==k?ia+(h[b[g]][k]+" | "):ia+(h[b[g]][k]+
";\n");else ia+="    "+n+b[g]+" = 0x00000000;\n"}}else{g=0;for(d=b.length;g<d;g+=1)ia+="    "+n+b[g]+" = 0x"+hb(L[b[g]]).toUpperCase()+"UL;\n";$("#NUC_PinConfiguration_Canvas")[0].setAttribute("innerHTML","")}Kb="";for(g=1;g<=Q;g+=1)""!==D[g-1]?Kb+="Pin"+X(g)+":"+ya(D[g-1])+"\n":(r=la[g-1].slice(la[g-1].indexOf(Va[g-1])),r=r.slicePriorToX("/"),Kb+="Pin"+X(g)+":"+r+"\n");pb="/* User-defined pins */\n";for(r in Ja)Ja.hasOwnProperty(r)&&""!==Ja[r].trim()&&(a=Ja[r].replace(/\s/g,"_").replace(/[`~!@#$%^&*()|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,
"_").toUpperCase(),kc(a.charAt(0))&&(a="_"+a),pb+="#define "+a+" "+r.replace(/[.]/g,"").replace(/\s/g,"_").replace(/[`~!@#$%^&*()|+\-=?;:'",<>\{\}\[\]\\\/]/gi,"_")+"\n");"/* User-defined pins */\n"===pb&&(pb="")},getModularizedDataUsedToCreateText:function(){var a,d,c,e=[],f=[],h=[];var n="";var b=[],g=[],k,r="SYS->",v;var w=function(z,F,J){v=!1;if(-1!==z.indexOf("_"+F)||-1!==z.indexOf(F+":")||0===z.indexOf(F+"_")||-1!==z.indexOf(","+F+"_")||-1!==z.lastIndexOf(F)&&z.lastIndexOf(F)+F.length===z.length||
"GPIO"===F&&-1!==z.indexOf("_MFP_G"+J))v=!0;"GPIO"===F&&-1===z.indexOf("SYS_G"+J)&&-1===z.indexOf("SYS_MFP_"+J)&&-1===z.indexOf("SYS_"+J)&&-1===z.indexOf("MD_"+J)&&(v=!1);return v};var p=function(z){return k=0===z.indexOf("SYS_MFP")?z.substring(0,11)+"_Msk":0===z.indexOf("SYS_GP")&&-1!==z.indexOf("_MFP_")?-1===z.indexOf("_MFPL_")&&-1===z.indexOf("_MFPH_")?z.substring(0,15)+"_Msk":z.slicePriorToX("MFP_")+"MFP_Msk":-1===z.indexOf("SYS_GP")&&z.indexOf("_MFP_")!==z.lastIndexOf("_MFP_")?z.substring(0,
z.lastIndexOf("_MFP_")+5)+"Msk":0===z.indexOf("GPIO_IO")?z.substring(0,z.lastIndexOf("MD_")+3)+"Msk":z.slicePriorToX("MFP_")+"MFP_Msk"};0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:GPIO_")&&(r="");"undefined"!==typeof NUTOOL_PER&&qc();"h"!==NUTOOL_PIN.g_pinFunctionString&&"dtsi"!==NUTOOL_PIN.g_pinFunctionString||nb.sliceAfterX(".")===NUTOOL_PIN.g_pinFunctionString||(nb=nb.slicePriorToX(".")+"."+NUTOOL_PIN.g_pinFunctionString+
'"\n');e=za(L);e.sort();var q=0;for(d=e.length;q<d;q+=1)Da[e[q]]=L[e[q]],g[e[q]]=[];for(q=1;q<=Q;q+=1)if(""!==D[q-1]){var t=q;var l=D[q-1];d=x(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][t-1]);"undefined"===typeof f[d]?(f[d]=[],f[d][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][t-1]+":"+l):f[d].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][t-1]+":"+l)}b=za(f).sort(ca);q=0;for(d=b.length;q<d;q+=1)for(f[b[q]].sort(ca),t=0,n=f[b[q]].length;t<n;t+=1){var y=c=f[b[q]][t];
c=c.slicePriorToX(":");y=y.sliceAfterX(":");var u=x(y.slicePriorToX("_")).toString();-1===h.indexOf(u)&&h.push(u);y===c&&(y="GPIO");u=0;for(a=NUTOOL_PIN.g_cfg_gpiosDefines.length;u<a;u+=1)if(c===NUTOOL_PIN.g_cfg_gpiosDefines[u].f[0]){a=1;for(c=NUTOOL_PIN.g_cfg_gpiosDefines[u].f.length;a<c;a+=1)if(0===NUTOOL_PIN.g_cfg_gpiosDefines[u].f[a].indexOf(y+":")){a=NUTOOL_PIN.g_cfg_gpiosDefines[u].f[a];do-1===a.indexOf("/")?(u=a,a=""):(u=a.slicePriorToX("/"),a=a.sliceAfterX("/")),c=u,u=u.sliceAfterX("@").slicePriorToX("%"),
-1!==c.indexOf(":")&&(y=c.slicePriorToX(":")),c=c.slicePriorToX("@"),"undefined"!==typeof g[u]&&g[u].push(c);while(""!==a);break}break}}h.sort(ca);ob=ia="";u=0;for(a=h.length;u<a;u+=1){n=va(h[u]+".0")?"GPIO":h[u];f="void NuCodeGenProj_init_"+h[u].toLowerCase()+"(void)\n{\n";b=!1;q=0;for(d=e.length;q<d;q+=1)if(0<g[e[q]].length&&w(g[e[q]].join(),n,h[u])){y=!1;b=!0;f+="    "+r+e[q]+" &= ~(";ob+="    "+r+e[q]+" &= ~(";for(t=g[e[q]].length-1;0<=t;--t)w(g[e[q]][t],n,h[u])&&(y&&(f+=" | ",ob+=" | "),c=g[e[q]][t].sliceAfterX(":"),
f+=p(c),ob+=p(c),y=!0);f+=");\n";ob+=");<br />";y=!1;f+="    "+r+e[q]+" |= (";ob+="    "+r+e[q]+" |= (";for(t=g[e[q]].length-1;0<=t;--t)w(g[e[q]][t],n,h[u])&&(y&&(f+=" | ",ob+=" | "),c=g[e[q]][t].sliceAfterX(":"),f+=c,ob+=c,y=!0);f+=");\n";ob+=");<br />"}f+="\n    return;\n}\n\n";b?ia+=f:ob+=h[u]+" did not generate modularized code!!<br />";f="void NuCodeGenProj_deinit_"+h[u].toLowerCase()+"(void)\n{\n";b=!1;q=0;for(d=e.length;q<d;q+=1)if(0<g[e[q]].length&&w(g[e[q]].join(),n,h[u])){y=!1;b=!0;f+="    "+
r+e[q]+" &= ~(";for(t=g[e[q]].length-1;0<=t;--t)w(g[e[q]][t],n,h[u])&&(y&&(f+=" | "),c=g[e[q]][t].sliceAfterX(":"),f+=p(c),y=!0);f+=");\n"}f+="\n    return;\n}\n\n";b&&(ia+=f)}ia="undefined"===typeof NUTOOL_PER?ia+"void NuCodeGenProj_init(void)\n{\n":ia+"void Pin_Init(void)\n{\n";q=0;for(d=e.length;q<d;q+=1)ia+="    //"+r+e[q]+" = 0x"+hb(L[e[q]]).toUpperCase()+"UL;\n";ia+="\n";q=0;for(d=h.length;q<d;q+=1)ia+="    NuCodeGenProj_init_"+h[q].toLowerCase()+"();\n";ia+="\n    return;\n}\n\n";ia="undefined"===
typeof NUTOOL_PER?ia+"void NuCodeGenProj_deinit(void)\n{\n":ia+"void Pin_Deinit(void)\n{\n";q=0;for(d=h.length;q<d;q+=1)ia+="    NuCodeGenProj_deinit_"+h[q].toLowerCase()+"();\n";ia+="\n    return;\n}";Db="";q=0;for(d=h.length;q<d;q+=1)Db+="void NuCodeGenProj_init_"+h[q].toLowerCase()+"(void);\n",Db+="void NuCodeGenProj_deinit_"+h[q].toLowerCase()+"(void);\n";"undefined"===typeof NUTOOL_PER?(Db+="void NuCodeGenProj_init(void);\n",Db+="void NuCodeGenProj_deinit(void);\n"):(Db+="void Pin_Init(void);\n",
Db+="void Pin_Deinit(void);\n");pb="/* User-defined pins */\n";for(l in Ja)Ja.hasOwnProperty(l)&&""!==Ja[l].trim()&&(c=Ja[l].replace(/\s/g,"_").replace(/[`~!@#$%^&*()|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"_").toUpperCase(),kc(c.charAt(0))&&(c="_"+c),pb+="#define "+c+" "+l.replace(/[.]/g,"").replace(/\s/g,"_").replace(/[`~!@#$%^&*()|+\-=?;:'",<>\{\}\[\]\\\/]/gi,"_")+"\n");"/* User-defined pins */\n"===pb&&(pb="");gpio_MFPsDefine=g=b=h=f=e=null},retrieveGenerateCodeContent:function(){return ob},decideNewChipType:bc,
updatePinName:X,closeAPP:function(){null!==jb&&jb.close();Jb(bd)&&Tb(function(){window.external.closeFromJS()})},redrawForResizingDialog:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("DialogSize:")?(a=a.sliceAfterX("DialogSize:X_"),Ya=parseInt(a.slicePriorToX("Y_"),10),Ua=parseInt(a.slice(a.indexOf("Y_")+2,a.indexOf("\r")),10),792>Ya&&(Ya=792),590>Ua&&(Ua=590)):(Ya=Za,Ua=qb);Oa=Ua-10;db=18*za(L).length+20>Oa/3?Oa/3:18*za(L).length+20;
$("#panel").width(Ya-275-8);$("#panel").height(Ua-8);"none"===$("#mfpTree").css("display")?$("#moduleTree").height(Oa-$("#supportedModules").height()):($("#mfpTree").height(db),$("#moduleTree").height(Oa-$("#ChipType").height()-$("#MCU").height()-db-6-$("#supportedModules").height()));N=100;ub();Cb()},triggerSearch:function(){Yb($("#searchInput_Pin").val())},showRegisters:function(){$("#rootTree_Pin").is(":visible")&&("undefined"===typeof NUTOOL_PER?"none"===$("#mfpTree").css("display")?($("#ChipType").show(),
$("#MCU").show(),$("#mfpTree").show(),$("#mfpTree").height(db),$("#moduleTree").height(Oa-$("#ChipType").height()-$("#MCU").height()-db-6-$("#supportedModules").height())):($("#ChipType").hide(),$("#MCU").hide(),$("#mfpTree").hide(),$("#moduleTree").height(Oa-$("#supportedModules").height())):"none"===$("#mfpTree").css("display")?($("#mfpTree").show(),$("#mfpTree").height(db),$("#moduleTree").height(Oa-$("#ChipType").height()-$("#MCU").height()-db-6-$("#supportedModules").height())):($("#mfpTree").hide(),
$("#moduleTree").height(Oa-$("#supportedModules").height())))},loadConfig:function(){$("#rootTree_Pin").is(":visible")&&Tb(function(){window.external.loadConfigFromJS()})},loadConfig_core:function(){try{Fb=!0,Dc()||(Sa("\u914d\u7f6e\u6863\u4e0d\u6b63\u786e\u3002","\u914d\u7f6e\u6a94\u4e0d\u6b63\u78ba\u3002","The config file is incorrect."),Gb=!1),$b(),sc(),tc(),fb(),N=100,ub(),Cb(),$("#MCUselect").val(E),ib=E,Ma(),Fb=!1}catch(a){}},saveConfig:function(){if(Jb(Pb))try{external.saveConfigFromJS("NUC_BROWSE_PROJECT_PATH")}catch(a){}},
generateCode:Xb,connectToTarget:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if(Ha||$("html").hasClass("ie9"))$("#rootTree_Pin").is(":visible")&&("undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:")?(a=a.sliceAfterX("UIlanguage:"),a=a.slicePriorToX("\r"),"Simplified Chinese"===a?(a="\u8fde\u7ebf\u5230\u76ee\u6807\u82af\u7247",d="\u8981\u4f7f\u7528\u6b64\u529f\u80fd\uff0c\u8bf7\u5c06IE\u7248\u672c\u5347\u7ea7\u523010\u6216\u66f4\u9ad8\u7248\u672c\u3002",c="\u786e\u5b9a"):
"Traditional Chinese"===a?(a="\u9023\u7dda\u5230\u76ee\u6a19\u6676\u7247",d="\u8981\u4f7f\u7528\u6b64\u529f\u80fd\uff0c\u8acb\u5c07IE\u7248\u672c\u5347\u7d1a\u523010\u6216\u66f4\u9ad8\u7248\u672c\u3002",c="\u78ba\u5b9a"):(a="Connect to Target Chip",d="To use this feature, please upgrade the IE version to 10 or higher.",c="Confirm")):(a="Connect to Target Chip",d="To use this feature, please upgrade the IE version to 10 or higher.",c="Confirm"),Ma(),$('<div id="connectToTargetDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
draggable:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#connectToTargetDialog").dialog("destroy")},buttons:[{text:c,click:function(){$("#connectToTargetDialog").dialog("isOpen")&&$("#connectToTargetDialog").dialog("destroy")}}]}),a=c=d=a=null);else if(Vb)Rc();else if($("#rootTree_Pin").is(":visible")){if("undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:"))if(a=a.sliceAfterX("UIlanguage:"),a=a.slicePriorToX("\r"),"Simplified Chinese"===a){a="\u8fde\u7ebf\u5230\u76ee\u6807\u82af\u7247";
var d="\u5f53\u8fde\u63a5\u5230\u76ee\u6807\u82af\u7247\u65f6\uff0c\u60a8\u914d\u7f6e\u7684\u5185\u5bb9\u5c06\u4f1a\u6d88\u5931\u3002 \u82e5\u8981\u7ee7\u7eed\uff0c\u8bf7\u70b9\u51fb\u786e\u5b9a\u6309\u94ae\u3002";var c="\u786e\u5b9a"}else"Traditional Chinese"===a?(a="\u9023\u7dda\u5230\u76ee\u6a19\u6676\u7247",d="\u7576\u9023\u63a5\u5230\u76ee\u6a19\u6676\u7247\u6642\uff0c\u60a8\u914d\u7f6e\u7684\u5167\u5bb9\u5c07\u6703\u6d88\u5931\u3002 \u82e5\u8981\u7e7c\u7e8c\uff0c\u8acb\u9ede\u64ca\u78ba\u5b9a\u6309\u9215\u3002",
c="\u78ba\u5b9a"):(a="Connect to Target Chip",d="When connecting to a target chip, what you have configured is going to be gone. To continue, click the Confirm button.",c="Confirm");else a="Connect to Target Chip",d="When connecting to a target chip, what you have configured is going to be gone. To continue, click the Confirm button.",c="Confirm";Ma();$('<div id="connectToTargetDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,draggable:!1,
resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#connectToTargetDialog").dialog("destroy")},buttons:[{text:c,click:function(){Rc();$("#connectToTargetDialog").dialog("isOpen")&&$("#connectToTargetDialog").dialog("destroy")}}]});a=c=d=a=null}},printReport:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if($("#rootTree_Pin").is(":visible")&&Jb(Pb)){if("undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:"))if(a=a.sliceAfterX("UIlanguage:"),
a=a.slicePriorToX("\r"),"Simplified Chinese"===a){var d="\u65b9\u6848\u540d\u79f0";a="\u5370\u51fa\u62a5\u544a";var c="\u9009\u62e9\u7528\u6765\u5c55\u793a\u914d\u7f6e\u8d44\u8baf\u7684\u6807\u51c6\u3002";var e="\u8bf7\u6ce8\u610f\uff0c\u672c\u8f6f\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u672f\u53c2\u8003\u624b\u518c\u6216\u89c4\u683c\u4e66\u3002\u7528\u6237\u5fc5\u987b\u53c2\u8003\u6700\u65b0\u6587\u6863\u4ee5\u786e\u4fdd\u6b63\u786e\u6027\u3002";var f="\u82af\u7247\u56fe\u793a";var h="\u811a\u4f4d";
var n="\u6a21\u7d44";var b="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d";var g="\u6682\u5b58\u5668";var k="\u786e\u5b9a"}else"Traditional Chinese"===a?(d="\u65b9\u6848\u540d\u7a31",a="\u5370\u51fa\u5831\u544a",c="\u9078\u64c7\u7528\u4f86\u5c55\u793a\u914d\u7f6e\u8cc7\u8a0a\u7684\u6a19\u6e96\u3002",e="\u8acb\u6ce8\u610f\uff0c\u672c\u8edf\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u8853\u53c3\u8003\u624b\u518a\u6216\u898f\u683c\u66f8\u3002\u7528\u6236\u5fc5\u9808\u53c3\u8003\u6700\u65b0\u6587\u6a94\u4ee5\u78ba\u4fdd\u6b63\u78ba\u6027\u3002",
f="\u6676\u7247\u5716\u793a",h="\u8173\u4f4d",n="\u6a21\u7d44",b="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d",g="\u66ab\u5b58\u5668",k="\u78ba\u5b9a"):(a="Print Report",d="Project Name",c="Select the criteria by which the configured information is being exhibited.",e="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",f="ChipView",h="Pin",n="Module",b="GPIO",g="Register",k="Confirm");else a=
"Print Report",d="Project Name",c="Select the criteria by which the configured information is being cataloged.",e="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",f="ChipView",h="Pin",n="Module",b="GPIO",g="Register",k="Confirm";Ma();d=Ha?$('<div id="printReportDialog"><label>'+d+': <input type="text" id="inputText_projectName" value=""></label><br /><p>'+c+'</p><input type="checkbox" id="checkbox_byRegister" checked=true/>'+
g+'</label><br /><label><input type="checkbox" id="checkbox_byPin" checked=true/>'+h+'</label><br /><label><input type="checkbox" id="checkbox_byModule" />'+n+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" />'+b+"</label><br /><label><p>"+e+'</p></label><input type="text" size="1" style="position:relative;top:-5000px;"/></div>'):$('<div id="printReportDialog"><label>'+d+': <input type="text" id="inputText_projectName" value=""></label><br /><p>'+c+'</p><label><input type="checkbox" id="checkbox_byChipView" checked=true/>'+
f+'</label><br /><input type="checkbox" id="checkbox_byRegister" checked=true/>'+g+'</label><br /><label><input type="checkbox" id="checkbox_byPin" checked=true/>'+h+'</label><br /><label><input type="checkbox" id="checkbox_byModule" />'+n+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" />'+b+"</label><br /><label><p>"+e+'</p></label><input type="text" size="1" style="position:relative;top:-5000px;"/></div>');d.dialog({modal:!0,draggable:!1,resizable:!1,title:a,width:500,height:"auto",
show:"fade",hide:"fade",close:function(){$("#printReportDialog").dialog("destroy")},buttons:[{text:k,click:function(){$("#checkbox_byChipView").is(":checked")&&(r="checkbox_byChipView/");$("#checkbox_byRegister").is(":checked")&&(r+="checkbox_byRegister/");$("#checkbox_byPin").is(":checked")&&(r+="checkbox_byPin/");$("#checkbox_byModule").is(":checked")&&(r+="checkbox_byModule/");$("#checkbox_byGPIO").is(":checked")&&(r+="checkbox_byGPIO/");var v=$("#inputText_projectName").val(),w=r;sb();if("Simplified Chinese"===
oa){var p="\u65b9\u6848";var q="\u65b9\u6848\u540d\u79f0";var t="\u65b9\u6848\u65e5\u671f";var l="\u578b\u53f7";var y="\u82af\u7247\u7cfb\u5217";var u="\u5fae\u63a7\u5668\u540d\u79f0";var z="\u5fae\u63a7\u5668\u5c01\u88c5";var F="\u82af\u7247\u56fe\u793a";var J="\u811a\u4f4d\u914d\u7f6e";var aa="\u6a21\u7ec4\u914d\u7f6e";var ba="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d\u914d\u7f6e";var da="\u6682\u5b58\u5668\u914d\u7f6e"}else"Traditional Chinese"===oa?(p="\u65b9\u6848",q="\u65b9\u6848\u540d\u7a31",t=
"\u65b9\u6848\u65e5\u671f",l="\u578b\u865f",y="\u6676\u7247\u7cfb\u5217",u="\u5fae\u63a7\u5668\u540d\u7a31",z="\u5fae\u63a7\u5668\u5c01\u88dd",F="\u6676\u7247\u5716\u793a",J="\u8173\u4f4d\u914d\u7f6e",aa="\u6a21\u7d44\u914d\u7f6e",ba="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d\u914d\u7f6e",da="\u66ab\u5b58\u5668\u914d\u7f6e"):(p="Project",q="Project Name",t="Project Date",l="Part No.",y="Chip Series",u="MCU Name",z="MCU Package",F="ChipView",J="Pin Configuration",aa="Module Configuration",ba="GPIO Configuration",
da="Register Configuration");var S="<!DOCTYPE html><html><head><title>Print Report</title></head><body>";var Ea=new Date;Ea=Ea.getMonth()+1+"/"+Ea.getDate()+"/"+Ea.getFullYear()+" "+Ea.getHours()+":"+Ea.getMinutes()+":"+Ea.getSeconds();S+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+p+'</caption><tr> <td style="border: 1px solid black;">'+q+'</td> <td style="border: 1px solid black;">'+
v+'</td> </tr> <tr> <td style="border: 1px solid black;">'+t+'</td> <td style="border: 1px solid black;">'+Ea+"</td> </tr> </table>";v=E.slicePriorToX("(");S+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+l+'</caption><tr> <td style="border: 1px solid black;">'+y+'</td> <td style="border: 1px solid black;">'+m+'</td> </tr> <tr> <td style="border: 1px solid black;">'+u+'</td> <td style="border: 1px solid black;">'+
v+'</td> </tr> <tr> <td style="border: 1px solid black;">'+z+'</td> <td style="border: 1px solid black;">'+NUTOOL_PIN.g_packageNumber+"</td> </tr></table>";S+="<br><br><br><br><br><br><br><hr>";if(null!==w){if(-1!==w.indexOf("checkbox_byChipView")){$("#panel")[0].appendChild($a("canvas","NUC_ChipView_Canvas"));l=$("#NUC_ChipView_Canvas")[0];l.setAttribute("style","z-index:1; position:absolute; left:0px; top:0px; border: 1px solid white;");y=265+A+40+A/4;u=240+A+40+200;l.setAttribute("width",y);l.setAttribute("height",
u);l=ua.getContext(l);l.scale(.85,.85);y=265;if(-1!==E.indexOf("SOP")){y-=30;l.strokeRect(y,240,A/2,A);l.fillStyle="white";l.fillRect(y,240,A/2,A);l.beginPath();l.arc(y+10,250,5,0,2*Math.PI,!0);l.stroke();p=1;do p+=1,l.font=p+"px Arial Black";while(l.measureText(Ta).width<A/2);l.save();l.translate(y+A/4,240+A/2-l.measureText(Ta).width/2);l.rotate(Math.PI/2);l.fillStyle="#FE2E2E";l.fillText(Ta,0,0);l.restore();v=E.slicePriorToX("(");u=0;for(z=NUTOOL_PIN.g_cfg_chips.length;u<z;u+=1)if(NUTOOL_PIN.g_cfg_chips[u].name+
"("+NUTOOL_PIN.g_cfg_chips[u].pkg+")"===E){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[u].display&&(v=NUTOOL_PIN.g_cfg_chips[u].display);break}l.fillStyle="black";u=1;do u+=1,l.font="bold "+u+"px Calibri";while(l.measureText(v).width<A/2);u>p&&(u=p,l.font="bold "+u+"px Calibri");u=u/2+5;l.save();l.translate(y+A/4-u,240+A/2-l.measureText(v).width/2);l.rotate(Math.PI/2);l.fillText(v,0,0);l.restore();p=1;do p+=1,l.font="bold "+p+"px Calibri";while(l.measureText(NUTOOL_PIN.g_packageNumber).width<A/4);
u=u+p/2+5;l.save();l.translate(y+A/4-u,240+A/2-l.measureText(NUTOOL_PIN.g_packageNumber).width/2);l.rotate(Math.PI/2);l.fillText(NUTOOL_PIN.g_packageNumber,0,0);l.restore();l.font="12px Arial";l.fillStyle="black";u=0;for(z=Q/2;u<z;u+=1)p=y+3,q=240+na+u*(16+ka)+12.8,l.strokeText((u+1).toString(),p,q),""!==D[u]&&(t=ya(D[u]),p=y-40-3,l.save(),l.textAlign="end",l.fillText(t,p,q),l.restore()),p=y-40+1,q=240+na+u*(16+ka),l.strokeRect(p,q,40,16),l.fillStyle=Z[0].savedPinPadColor[u],l.fillRect(p,q,40,16),
t=la[u],-1!==t.lastIndexOf("/")&&(t=t.slice(t.lastIndexOf("/")+1)),!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),l.font="12px Arial",l.fillStyle="black",l.fillText(t,p,q+12.8,40,16),p=y+A/2,q=240+A-na-16-u*(16+ka)+12.8,t=l.measureText((u+1+Q/2).toString()),l.strokeText((u+1+Q/2).toString(),p-t.width-3,q),""!==D[u+Q/2]&&(t=ya(D[u+Q/2]),p=y+A/2+40+3,l.fillText(t,p,q)),p=y+A/2,q=240+A-na-16-u*(16+ka),l.strokeRect(p,q,40,16),l.fillStyle=Z[1].savedPinPadColor[u],l.fillRect(p,q,40,16),t=la[u+Q/2],t=t.slicePriorToX("/"),
!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),l.font="12px Arial",l.fillStyle="black",l.fillText(t,p,q+12.8)}else if(-1!==E.indexOf("WLCSP")||-1!==E.indexOf("BGA")){y-=30;l.lineWidth=2;l.strokeRect(y,240,A,A);l.fillStyle="white";l.fillRect(y,240,A,A);l.beginPath();l.arc(y+10,240+A-10,5,0,2*Math.PI,!0);l.stroke();l.font="12px Arial";l.fillStyle="black";u=0;for(z=Qa;u<z;u+=1)p=y+3,q=240+na+30+(Qa-1-u%Qa)*(60+ka),l.fillText((u+1).toString(),p,q);u=0;for(z=mc;u<z;u+=1)p=y+na+30+u*(60+ka)-4,q=240+A-5,l.fillText(NUTOOL_PIN.g_horizontalIndexArray[u],
p,q);for(u=0;u<Q;u+=1)p=y+na+30+Math.floor(u/Qa)*(60+ka),q=y+na+30+(Qa-1-u%Qa)*(60+ka),l.beginPath(),l.arc(p,q,30,0,2*Math.PI,!0),l.strokeStyle="black",l.stroke(),l.fillStyle=Z[0].savedPinPadColor[u],l.fill(),t=""!==D[u]?ya(D[u]):Z[0].savedPinName[u],-1!==t.lastIndexOf("/")&&(t=t.slice(t.lastIndexOf("/")+1)),6<t.length&&(t=t.slice(0,6)+".."),l.font="12px Arial",l.fillStyle="black",l.fillText(t,p-l.measureText(t).width/2,q+parseInt(l.font,10)/2)}else{y-=30;l.strokeRect(y,240,A,A);l.fillStyle="white";
l.fillRect(y,240,A,A);l.beginPath();l.arc(y+10,240+A-10,5,0,2*Math.PI,!0);l.stroke();p=1;do p+=1,l.font=p+"px Arial Black";while(l.measureText(Ta).width<A/2);l.fillStyle="#FE2E2E";l.fillText(Ta,y+A/2-l.measureText(Ta).width/2,240+A/2);v=E.slicePriorToX("(");u=0;for(z=NUTOOL_PIN.g_cfg_chips.length;u<z;u+=1)if(NUTOOL_PIN.g_cfg_chips[u].name+"("+NUTOOL_PIN.g_cfg_chips[u].pkg+")"===E){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[u].display&&(v=NUTOOL_PIN.g_cfg_chips[u].display);break}l.fillStyle="black";
u=1;do u+=1,l.font="bold "+u+"px Calibri";while(l.measureText(v).width<A/2);u>p&&(u=p,l.font="bold "+u+"px Calibri");u=u/2+10;l.fillText(v,y+A/2-l.measureText(v).width/2,240+A/2+u);p=1;do p+=1,l.font="bold "+p+"px Calibri";while(l.measureText(NUTOOL_PIN.g_packageNumber).width<A/4);u=u+p/2+10;l.fillText(NUTOOL_PIN.g_packageNumber,y+A/2-l.measureText(NUTOOL_PIN.g_packageNumber).width/2,240+A/2+u);l.font="12px Arial";l.fillStyle="black";v=Math.floor((Ra-K)/2);u=0;for(z=K;u<z;u+=1)p=y+na+(u+v)*(16+ka),
q=240+A,l.save(),l.translate(p,q),l.rotate(-Math.PI/2),l.strokeText((u+1).toString(),3,12.8),l.restore(),""!==D[u]&&(t=ya(D[u]),q=240+A+40,l.save(),l.translate(p,q),l.rotate(-Math.PI/2),l.textAlign="end",l.fillText(t,-3,12.8),l.restore()),p=y+na+(u+v)*(16+ka)-1,q=240+A,l.strokeRect(p,q,16,40),l.fillStyle=Z[0].savedPinPadColor[u],l.fillRect(p,q,16,40),t=la[u],-1!==t.lastIndexOf("/")&&(t=t.slice(t.lastIndexOf("/")+1)),!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),q+=40,l.font="12px Arial",l.fillStyle="black",
l.save(),l.translate(p,q),l.rotate(-Math.PI/2),l.fillText(t,1,12.8),l.restore();v=Math.floor((Ra-ea)/2);u=0;for(z=ea;u<z;u+=1)p=y+A,q=240+A-na-16-(u+v)*(16+ka)+12.8,t=l.measureText((u+1+K).toString()),l.strokeText((u+1+K).toString(),p-t.width-3,q),""!==D[u+K]&&(t=ya(D[u+K]),p=y+A+40+3,l.fillText(t,p,q)),p=y+A,q=240+A-na-16-(u+v)*(16+ka),l.strokeRect(p,q,40,16),l.fillStyle=Z[1].savedPinPadColor[u],l.fillRect(p,q,40,16),t=la[u+K],t=t.slicePriorToX("/"),!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),l.font=
"12px Arial",l.fillStyle="black",l.fillText(t,p,q+12.8);v=Math.floor((Ra-Aa)/2);u=0;for(z=Aa;u<z;u+=1)p=y+A-na-16-(u+v)*(16+ka)-1,q=200,l.save(),l.translate(p,q),l.rotate(-Math.PI/2),t=l.measureText((u+1+K+ea).toString()),l.strokeText((u+1+K+ea).toString(),-40-t.width-3,12.8),l.restore(),""!==D[u+K+ea]&&(t=ya(D[u+K+ea]),l.save(),l.translate(p,q),l.rotate(-Math.PI/2),l.fillText(t,6,12.8),l.restore()),q=201,l.strokeRect(p,q,16,40),l.fillStyle=Z[2].savedPinPadColor[u],l.fillRect(p,q,16,40),t=la[u+K+
ea],t=t.slicePriorToX("/"),!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),l.font="12px Arial",l.fillStyle="black",q+=40,l.save(),l.translate(p,q),l.rotate(-Math.PI/2),l.textAlign="end",l.fillText(t,40,12.8),l.restore();v=Math.floor((Ra-lb)/2);u=0;for(z=lb;u<z;u+=1)p=y+3,q=240+na+(u+v)*(16+ka)+12.8,l.strokeText((u+1+K+ea+Aa).toString(),p,q),""!==D[u+K+ea+Aa]&&(t=ya(D[u+K+ea+Aa]),p=y-40-3,l.save(),l.textAlign="end",l.fillText(t,p,q),l.restore()),p=y-40+1,q=240+na+(u+v)*(16+ka),l.strokeRect(p,q,40,16),l.fillStyle=
Z[3].savedPinPadColor[u],l.fillRect(p,q,40,16),t=la[u+K+ea+Aa],-1!==t.lastIndexOf("/")&&(t=t.slice(t.lastIndexOf("/")+1)),!va(t)&&4<t.length&&(t=t.slice(0,4)+".."),l.font="12px Arial",l.fillStyle="black",l.fillText(t,p,q+12.8,40,16)}Ha||(l=document.getElementById("NUC_ChipView_Canvas").toDataURL(),S=S+("<h4>"+F+'</h4><img src="')+(l+'"><hr>'));$("#NUC_ChipView_Canvas").remove()}if(-1!==w.indexOf("checkbox_byRegister")){da=S+('<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+
da+"</caption>");l=za(L);l.sort();S=0;for(F=l.length;S<F;S+=1)da+='<tr><td style="border: 1px solid black;">'+l[S]+'</td> <td style="border: 1px solid black;">0x'+hb(L[l[S]]).toUpperCase()+"</td></tr>";S=da+"</table>"}if(-1!==w.indexOf("checkbox_byPin")){S=da=S;F=!0;da+='<table style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="box" rules="all" ><caption style="text-align:left">'+J+"</caption>";for(J=1;J<=Q;J+=1)""!==D[J-1]&&(da+='<tr><td style="border: 1px solid black;">Pin'+
X(J)+'</td> <td style="border: 1px solid black;">'+ya(D[J-1])+"</td></tr>",F=!1);da+="</table>";F&&(da=S);S=da}if(-1!==w.indexOf("checkbox_byModule")){J=S;F=aa;da=J;l=!0;S=[];for(aa=1;aa<=Q;aa+=1)""!==D[aa-1]&&(y=aa,u=l=D[aa-1],-1!==u.indexOf("_")&&(u=u.slicePriorToX("_")),u=x(u),"undefined"===typeof S[u]?(S[u]=[],S[u][0]=ya(l)+"(Pin:"+X(y)+")"):S[u].push(ya(l)+"(Pin:"+X(y)+")"),l=!1);y=za(S);J+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+
F+"</caption>";aa=0;for(u=y.length;aa<u;aa+=1)for(S[y[aa]].sort(ca),F=0,z=S[y[aa]].length;F<z;F+=1)J+='<tr><td style="border: 1px solid black;">'+y[aa]+'</td> <td style="border: 1px solid black;">'+S[y[aa]][F]+"</td></tr>";J+="</table>";l&&(J=da);S=J}if(-1!==w.indexOf("checkbox_byGPIO")){w=S;F=ba;aa=w;da=!0;J=[];for(ba=1;ba<=Q;ba+=1)""!==D[ba-1]&&(S=ba,da=ya(D[ba-1]),l=x(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][S-1]),"undefined"===typeof J[l]?(J[l]=[],J[l][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][S-
1]+": "+da+"(Pin:"+X(S)+")"):J[l].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][S-1]+": "+da+"(Pin:"+X(S)+")"),da=!1);S=za(J).sort(ca);w+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+F+"</caption>";ba=0;for(l=S.length;ba<l;ba+=1)for(J[S[ba]].sort(ca),F=0,y=J[S[ba]].length;F<y;F+=1)u=J[S[ba]][F],w+='<tr><td style="border: 1px solid black;">'+u.slicePriorToX(":")+
'</td> <td style="border: 1px solid black;">'+u.sliceAfterX(": ")+"</td></tr>";w+="</table>";da&&(w=aa);S=w}}S+="</body></html>";ba=window.open("dummy.htm","",[]);ba.document.open();ba.document.write(S);ba.document.close();ba.moveTo(0,0);ba.focus();ba.print();$("#printReportDialog").dialog("isOpen")&&$("#printReportDialog").dialog("destroy")}}]});var r=a=k=b=n=h=e=c=a=d=null}},generatePinDescriptions:function(){if(Jb(Pb))try{external.generatePinDescriptionsFromJS()}catch(a){}},runAnotherTool:Qc,get_pin_descriptions:Oc,
showPinDescriptions:function(){if($("#rootTree_Pin").is(":visible")){La=!La;fa();rb();lc();"none"===$("#mfpTree").css("display")?$("#moduleTree").height(Oa-$("#supportedModules").height()):($("#mfpTree").height(db),$("#moduleTree").height(Oa-$("#ChipType").height()-$("#MCU").height()-db-6-$("#supportedModules").height()));ra();var a;var d=za(D);var c=0;for(a=d.length;c<a;c+=1){var e=d[c];var f=D[e];""!==f&&(e=parseInt(e,10),Ab(e,f,!1),yb(e+1,"#41AF88"))}c=0;for(a=Ga.length;c<a;c+=1)e=Ga[c],yb(e,"#FAB92D");
$("#panel").css("overflow-x","scroll");$("#panel").css("overflow-y","scroll");N=100;ub();Cb()}},zoomIn:Hc,bestFit:function(){$("#rootTree_Pin").is(":visible")&&(N=ic,ub())},zoomOut:Ic,uncheckAllNodes:function(){Tb(function(){vc()});Zb()},uncheckAllNodes_core:vc,settings:function(){var a,d="",c="",e="",f="",h="",n="checked=true",b="checked=true",g="checked=true",k,r,v,w,p;var q=q=q="";var t=a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if($("#rootTree_Pin").is(":visible")){if("undefined"!==
typeof a&&-1!==a.indexOf("UIlanguage:")){q=a.sliceAfterX("CheckCriteriaPin:");q=q.slicePriorToX("\r");"No"===q&&(n="");q=a.sliceAfterX("CheckCriteriaModule:");q=q.slicePriorToX("\r");if("No"===q||""===q)b="";q=a.sliceAfterX("CheckCriteriaGPIO:");q=q.slicePriorToX("\r");if("No"===q||""===q)g="";a=a.sliceAfterX("UIlanguage:").slicePriorToX("\r");if("Simplified Chinese"===a){a="\u8bbe\u5b9a";q="1. \u4ece\u4e0b\u9762\u9009\u53d6\u4e00\u4e2a\u8bed\u8a00\u663e\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002";
var l="2. \u663e\u793a\u63d0\u793a\u6846\u3002";var y="3. \u9009\u62e9\u7528\u6765\u5206\u7c7b\u914d\u7f6e\u8d44\u8baf\u7684\u6807\u51c6\u3002";var u="\u82f1\u6587";var z="\u7b80\u4f53\u4e2d\u6587";var F="\u7e41\u4f53\u4e2d\u6587";var J="\u8981";var aa="\u4e0d\u8981";c="checked";var ba="\u811a\u4f4d";var da="\u6a21\u7d44";var S="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d";var Ea="\u786e\u5b9a"}else"Traditional Chinese"===a?(a="\u8a2d\u5b9a",q="1. \u5f9e\u4e0b\u9762\u9078\u53d6\u4e00\u500b\u8a9e\u8a00\u986f\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002",
l="2. \u986f\u793a\u63d0\u793a\u6846\u3002",y="3. \u9078\u64c7\u7528\u4f86\u5206\u985e\u914d\u7f6e\u8cc7\u8a0a\u7684\u6a19\u6e96\u3002",u="\u82f1\u6587",z="\u7b80\u9ad4\u4e2d\u6587",F="\u7e41\u9ad4\u4e2d\u6587",J="\u8981",aa="\u4e0d\u8981",e="checked",ba="\u8173\u4f4d",da="\u6a21\u7d44",S="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d",Ea="\u78ba\u5b9a"):(a="Settings",q="1. Select one of the following languages displayed in UI.",l="2. Display a tooltip.",y="3. Select the criteria by which the configured information is being cataloged.",
u="English",z="Simplified Chinese",F="Traditional Chinese",J="Yes",aa="No",d="checked",ba="Pin",da="Module",S="GPIO",Ea="Confirm")}else a="Settings",q="1. Select one of the following languages displayed in UI.",l="2. Display a tooltip.",y="3. Select the criteria by which the configured information is being cataloged.",u="English",z="Simplified Chinese",F="Traditional Chinese",J="Yes",aa="No",d="checked",ba="Pin",da="Module",S="GPIO",Ea="Confirm";"undefined"!==typeof t&&-1!==t.indexOf("DisplayTooltip:")&&
(t=t.sliceAfterX("DisplayTooltip:"),t=t.slicePriorToX("\r"),"No"===t?h="checked":f="checked");Ma();$('<div id="languageDialog"><p>'+q+'</p><input type="radio" id="engiish" value="English" name="UIlanguage" '+d+'><label for="engiish">'+u+'</label><br /><input type="radio" id="simplifiedChinese" value="Simplified Chinese" name="UIlanguage" '+c+'><label for="simplifiedChinese">'+z+'</label><br /><input type="radio" id="traditionalChinese" value="Traditional Chinese" name="UIlanguage" '+e+'><label for="traditionalChinese">'+
F+"</label><br /><p>"+l+'</p><input type="radio" id="stringYes" value="Yes" name="DisplayTooltip" '+f+'><label for="stringYes">'+J+'</label><br /><input type="radio" id="stringNo" value="No" name="DisplayTooltip" '+h+'><label for="stringNo">'+aa+"</label><br /><p>"+y+'</p><label><input type="checkbox" id="checkbox_byPin" '+n+"/>"+ba+'</label><br /><label><input type="checkbox" id="checkbox_byModule" '+b+"/>"+da+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" '+g+"/>"+S+'</label><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
draggable:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#languageDialog").dialog("destroy")},buttons:[{text:Ea,click:function(){$("input").each(function(){"UIlanguage"===this.name&&!0===this.checked?(oa=$(this).val(),"Simplified Chinese"===oa?(r="\u82af\u7247\u7cfb\u5217:",v="\u578b\u53f7:",w="MFP\u5bc4\u5b58\u5668",k="\u652f\u63f4\u6a21\u7ec4",p="\u641c\u5bfb.."):"Traditional Chinese"===oa?(r="\u6676\u7247\u7cfb\u5217:",v="\u578b\u865f:",w="MFP\u6682\u5b58\u5668",
k="\u652f\u63f4\u6a21\u7d44",p="\u641c\u5c0b.."):(r="Chip Series:",v="Part No.:",w="MFP Registers",k="Supported Modules",p="Search.."),$("#ChipType_span").text(r),$("#MCU_span").text(v),$("#mfpTree").jstree("rename_node",$("#mfp_tree"),w),$("#supportedModules_span").text(k),$("#searchInput_Pin")[0].setAttribute("style","font-family:Times Arial; position:absolute; left:"+($("#supportedModules_span").width()+10)+"px; width:"+(259-$("#supportedModules_span").width()-10)+"px; height: 16px;"),$("#searchInput_Pin").val(p),
$("#searchInput_Pin").change(function(){Yb(this.value)}),Nc(),gc(),window.external.saveSettings("UIlanguage:"+oa),v=r=p=k=null):"DisplayTooltip"===this.name&&!0===this.checked&&(Ib=$(this).val(),window.external.saveSettings("DisplayTooltip:"+Ib),Mb="No"===$(this).val()?!1:!0)});$("#checkbox_byPin").is(":checked")?window.external.saveSettings("CheckCriteriaPin:Yes"):window.external.saveSettings("CheckCriteriaPin:No");$("#checkbox_byModule").is(":checked")?window.external.saveSettings("CheckCriteriaModule:Yes"):
window.external.saveSettings("CheckCriteriaModule:No");$("#checkbox_byGPIO").is(":checked")?window.external.saveSettings("CheckCriteriaGPIO:Yes"):window.external.saveSettings("CheckCriteriaGPIO:No");$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}}]})}},changeUIlanguage:function(){sb();if("Simplified Chinese"===oa){var a="\u82af\u7247\u7cfb\u5217:";var d="\u578b\u53f7:";var c="MFP\u5bc4\u5b58\u5668";var e="\u652f\u63f4\u6a21\u7ec4";var f="\u641c\u5bfb.."}else"Traditional Chinese"===
oa?(a="\u6676\u7247\u7cfb\u5217:",d="\u578b\u865f:",c="MFP\u6682\u5b58\u5668",e="\u652f\u63f4\u6a21\u7d44",f="\u641c\u5c0b.."):(a="Chip Series:",d="Part No.:",e="Supported Modules",f="Search..",c="MFP Registers");$("#ChipType_span").text(a);$("#MCU_span").text(d);$("#mfpTree").jstree("rename_node",$("#mfp_tree"),c);$("#supportedModules_span").text(e);$("#searchInput_Pin")[0].setAttribute("style","font-family:Times Arial; position:absolute; left:"+($("#supportedModules_span").width()+10)+"px; width:"+
(259-$("#supportedModules_span").width()-10)+"px; height: 16px;");$("#searchInput_Pin").val(f);$("#searchInput_Pin").change(function(){Yb(this.value)});Nc();gc();f=e=c=d=a=null},executePDFfail:function(){Sa("\u60a8\u7684\u7535\u8111\u4e0d\u80fd\u6267\u884cPDF\u6863\u3002\u8bf7\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u6765\u652f\u63f4\u5b83\u3002","\u60a8\u7684\u96fb\u8166\u4e0d\u80fd\u57f7\u884cPDF\u6a94\u3002\u8acb\u5b89\u88dd\u5fc5\u8981\u7684\u8edf\u4ef6\u4f86\u652f\u63f4\u5b83\u3002","Your PC is incapable of executing the PDF files. Please install a necessary software to support it")},
executeNuCADfail:function(){var a="NuCAD";"undefined"!==typeof NUTOOL_PIN.g_anotherNameForNuCAD&&""!==NUTOOL_PIN.g_anotherNameForNuCAD&&(a=NUTOOL_PIN.g_anotherNameForNuCAD);Sa("\u60a8\u7684\u7535\u8111\u4e0d\u80fd\u6267\u884c"+a+"\u56e0\u4e3a\u5b83\u4e0d\u5728Content\u8d44\u6599\u5939\u91cc\u9762\u3002","\u60a8\u7684\u96fb\u8166\u4e0d\u80fd\u57f7\u884c"+a+"\u56e0\u70ba\u5b83\u4e0d\u5728Content\u8cc7\u6599\u593e\u88e1\u9762\u3002","Your PC is incapable of executing "+a+" because it does not exist in the Content folder.")},
get_gpio_MFPsNames:function(){var a,d="SYS->";0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:GPIO_")&&(d="GPIO_MD->");ia="";var c=za(L);c.sort();var e=0;for(a=c.length;e<a;e+=1)ia+=d+c[e]+" = 0x"+hb(L[c[e]]).toUpperCase()+"\n";Kb="";for(e=1;e<=Q;e+=1)if(""!==D[e-1])Kb+="Pin"+X(e)+":"+D[e-1]+"\n";else{var f=la[e-1].slice(la[e-1].indexOf(Va[e-1]));f=f.slicePriorToX("/");Kb+="Pin"+X(e)+":"+f+"\n"}wc="";e=
0;for(a=Fa.length;e<a;e+=1)wc+="GPIOpin:"+Fa[e]+"\n";pb="";for(f in Ja)Ja.hasOwnProperty(f)&&""!==Ja[f].trim()&&(pb+="UserDefined:"+f+"=>"+Ja[f]+"\n")},recordConfig:Zb,g_readConfigFilePath:"",g_pinFunctionString:"",g_bFunctionalTesting:!1,g_bModuleTreeLoaded:!1}})();
