var NUTOOL_PIN={};
(function(){function eb(){var a;var f=0;for(a=D.length;f<a;f+=1)D[f].restore();D.length=0}function Xa(){var a,f=$("#panel");var c=0;f[0].setAttribute("style","width:"+(ja-275-8)+"px; height:"+(ea-8)+"px; border: 1px solid white; position:absolute; left:275px; top:0px;");f.hover(function(){$(this).css("opacity","1");Ma()},function(){$(this).css("opacity",fb)});var d=$("#NUC_PinConfiguration_Canvas")[0];d.setAttribute("style","z-index:1; position:absolute; left:0px; top:0px; border: 1px solid white;");d.setAttribute("width",
na);d.setAttribute("height",za);var e=Q.getContext(d);Q.addEvent(d,"click",ra);e.strokeStyle="#000000";if(-1===G.indexOf("SOP")){e.strokeRect(E,F,l,l);d=e.createLinearGradient(E+l,F+l,0,0);d.addColorStop(0,"#000000");d.addColorStop(1,"#8CA5B9");e.fillStyle=d;e.fillRect(E,F,l,l);e.beginPath();e.arc(E+10,F+l-10,5,0,2*Math.PI,!0);e.strokeStyle="white";e.stroke();e.strokeStyle="#000000";var g=1;do g+=1,e.font=g+'px "Arial Black", "Arial Bold", Gadget, sans-serif;';while(e.measureText("Nuvoton").width<
l/2);e.fillStyle="#FE2E2E";e.fillText("Nuvoton",E+l/2-e.measureText("nuvoTon").width/2,F+l/2);d=G.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+")"===G){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[c].display&&(d=NUTOOL_PIN.g_cfg_chips[c].display);break}e.fillStyle="white";c=1;do c+=1,e.font="bold "+c+"px Calibri";while(e.measureText(d).width<l/2);c>g&&(c=g,e.font="bold "+c+"px Calibri");c=c/2+10;e.fillText(d,
E+l/2-e.measureText(d).width/2,F+l/2+c);g=1;do g+=1,e.font="bold "+g+"px Calibri";while(e.measureText(NUTOOL_PIN.g_packageNumber).width<l/4);c=c+g/2+10;e.fillText(NUTOOL_PIN.g_packageNumber,E+l/2-e.measureText(NUTOOL_PIN.g_packageNumber).width/2,F+l/2+c);D=[];for(c=0;4>c;c+=1)e="pin_side_"+c,f[0].appendChild(oa("canvas",e)),D[c]=zb().init(e,$("#"+e),c),D[c].draw()}else{e.strokeRect(E,F,l/2,l);d=e.createLinearGradient(E+l/2,F+l,0,0);d.addColorStop(0,"#000000");d.addColorStop(1,"#8CA5B9");e.fillStyle=
d;e.fillRect(E,F,l/2,l);e.beginPath();e.arc(E+10,F+10,5,0,2*Math.PI,!0);e.strokeStyle="white";e.stroke();e.strokeStyle="#000000";g=1;do g+=1,e.font=g+'px "Arial Black", "Arial Bold", Gadget, sans-serif;';while(e.measureText("Nuvoton").width<l/2);c=g;e.save();e.translate(E+l/4,F+l/2-e.measureText("nuvoTon").width/2);e.rotate(Math.PI/2);e.fillStyle="#FE2E2E";e.fillText("Nuvoton",0,0);e.restore();d=G.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+")"===G){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[c].display&&(d=NUTOOL_PIN.g_cfg_chips[c].display);break}e.fillStyle="white";c=1;do c+=1,e.font="bold "+c+"px Calibri";while(e.measureText(d).width<l/2);c>g&&(c=g,e.font="bold "+c+"px Calibri");c=c/2+5;e.save();e.translate(E+l/4-c,F+l/2-e.measureText(d).width/2);e.rotate(Math.PI/2);e.fillText(d,0,0);e.restore();g=1;do g+=1,e.font="bold "+g+"px Calibri";while(e.measureText(NUTOOL_PIN.g_packageNumber).width<l/4);c=
c+g/2+5;e.save();e.translate(E+l/4-c,F+l/2-e.measureText(NUTOOL_PIN.g_packageNumber).width/2);e.rotate(Math.PI/2);e.fillText(NUTOOL_PIN.g_packageNumber,0,0);e.restore();D=[];for(c=0;2>c;c+=1)e="pin_side_"+c,f[0].appendChild(oa("canvas",e)),D[c]=zb().init(e,$("#"+e),c),D[c].draw()}Vb();gb();c=g=e=c=d=d=e=d=f=a=c=null}function pa(a,f){var c=0,d;var e=/(\d+)|(\D+)/g;var g=/\d/;if(isFinite(a)&&isFinite(f))return a-f;var b=String(a).toLowerCase();var h=String(f).toLowerCase();if(b===h)return 0;if(!g.test(b)||
!g.test(h))return b>h?1:-1;b=b.match(e);h=h.match(e);for(d=b.length>h.length?h.length:b.length;c<d;)if(e=b[c],g=h[c],c+=1,e!==g)return isFinite(e)&&isFinite(g)?("0"===e.charAt(0)&&(e="."+e),"0"===g.charAt(0)&&(g="."+g),e-g):e>g?1:-1;return b.length-h.length}function hb(){var a=[],f,c,d,e=[],g=[],b=[],h=[],m,v=[],n=[],u=[],Z=$("#rootTree_Pin"),r=$("#moduleTree"),t=$("#ChipType_span"),H=$("#MCU_span");a=T(aa);a.sort(pa);h=[];Aa=[];N=[];u=[];var q=0;for(f=a.length;q<f;q+=1){e=[];b=[];var y=0;for(c=aa[a[q]].length;y<
c;y+=1){var x=sa[a[q]][y];e.push(x+"_Pin"+aa[a[q]][y])}e.sort(pa);g=[];var p=!1;y=0;for(c=e.length;y<c;y+=1)if(!(0<g.length&&-1!==$.inArray(y,g))){x=e[y];var l=!1;if(0===NUTOOL_PIN.g_cfg_shareBits.length&&y!==e.length-1){var A=y+1;for(d=e.length;A<d;A+=1)x.restorePinTreeNodeName()===e[A].restorePinTreeNodeName()?(g.push(A),p=l=!0):x.sliceAfterX("_Pin")===e[A].sliceAfterX("_Pin")&&(p=!0)}var B=x.replaceSpecialCharacters();var z={};var D={};if(l){var G={};D.id=B;G.data="Pin:"+x.sliceAfterX("_Pin");
G.attr=D;n=[];n.push(G);N.push(D.id);A=0;for(d=g.length;A<d;A+=1)x.restorePinTreeNodeName()===e[g[A]].restorePinTreeNodeName()&&(G={},D={},D.id=e[g[A]],D.id=D.id.replaceSpecialCharacters(),G.data="Pin:"+D.id.sliceAfterX("_Pin"),G.attr=D,n.push(G),N.push(D.id));D={};D.id=B.restorePinTreeNodeName()+"_Intermediate";z.data=x.restorePinTreeNodeName();z.attr=D;z.children=n;Aa.push(D.id)}else D.id=B,z.data=x.restorePinTreeNodeName()+"(Pin:"+x.sliceAfterX("_Pin")+")",z.attr=D;b.push(z)}p&&u.push(a[q]+"_Root");
var E={};D={};D.id=a[q]+"_Root";E.data=a[q];E.attr=D;E.state="closed";E.children=b;h[q]=E}if(0===r.length){ta();if("Simplified Chinese"===P){var F="\u652f\u63f4\u6a21\u7ec4";y="\u641c\u5bfb..";A="\u82af\u7247\u7cfb\u5217:";c="\u578b\u53f7:"}else"Traditional Chinese"===P?(F="\u652f\u63f4\u6a21\u7d44",y="\u641c\u5c0b..",A="\u6676\u7247\u7cfb\u5217:",c="\u578b\u865f:"):(F="Supported Modules",y="Search..",A="Chip Series:",c="Part No.:");Z[0].appendChild(oa("div","supportedModules",""));var O=$("#supportedModules");
O.append("<span id=supportedModules_span></span>");var M=$("#supportedModules_span");M.css("vertical-align","text-top");M.css("font-size","16px");M.css("font-weight","bold");O.append("<input id='searchInput_Pin' type='text' value="+y+">");var Q=$("#searchInput_Pin");Z[0].appendChild(oa("div","moduleTree","Loading..."));r=$("#moduleTree");t.text(A);t.css("font-size","16px");t.css("font-weight","bold");H.text(c);H.css("font-size","16px");H.css("font-weight","bold");c=A=y=null}O[0].setAttribute("style",
"background-color: #FFFFFF; border-right: 16px solid #F2F2F2; float:left; width:259px; height: 22px;");M.text(F);Q[0].setAttribute("style","font-family:Times Arial; position:absolute; left:"+(M.width()+10)+"px; width:"+(259-M.width()-10)+"px; height: 16px;");Z.hide();Q.change(function(){Ya(this.value)});r[0].setAttribute("style","background-color: #FFFFFF; overflow-y: scroll; float:left; width:275px; height: "+(ha-Ba-6-$("#supportedModules").height())+"px; font-size:16px;");r.hover(function(){$(this).css("background-color",
"#FAFAFA");Ma()},function(){$(this).css("background-color","#FFFFFF")});r.jstree({themes:{theme:"classic",icons:!1},json_data:{data:h,progressive_render:!0},search:{case_insensitive:!0},core:{animation:0},plugins:"themes json_data types search checkbox ui".split(" ")}).bind("hover_node.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d=!1,f=-1;if(Na&&0<NUTOOL_PIN.g_cfg_gpiosDescriptions.length&&-1===c.indexOf("_dot")){if(-1!==c.indexOf("_Pin")){var h=c.restorePinTreeNodeName();f=parseInt(c.sliceAfterX("_Pin"),
10);d=!0}-1!==c.indexOf("_Intermediate")&&(h=c.restorePinTreeNodeName(),d=!0);d&&(h=h.restorePinTreeNodeName().restoreSpecialCharacters(),h=Ab(h,f),"unknown"!==h&&$("#"+c).simpletip({content:h,fixed:!1,offset:[100,-7]}))}}).bind("check_node.jstree",function(b,a){var c,d=a.rslt.obj.attr("id"),f=d.restorePinTreeNodeName();try{var h=a.inst._get_parent(a.rslt.obj).attr("id")}catch(ec){}v=[];ra();if($("#"+d).hasClass("semi-disabled"))Wb(d);else{if("undefined"===typeof h){h=0;for(c=aa[f].length;h<c;h+=
1)v.push(aa[f][h]);m=f;r.jstree("open_node",$("#"+d))}else v[0]=parseInt(d.sliceAfterX("Pin"),10),m=J(h.slicePriorToX("_"));Ga?ca(d,m,v):Bb(!0,d,m,v)}}).bind("uncheck_node.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d=c.restorePinTreeNodeName();try{var h=a.inst._get_parent(a.rslt.obj).attr("id")}catch(dc){}v=[];if("undefined"===typeof h)v=aa[d],m=J(d);else{if(-1!==c.indexOf("_Intermediate")){q=0;for(f=N.length;q<f;q+=1)N[q].restorePinTreeNodeName()===c.restorePinTreeNodeName()&&(d=N[q],m=J(d.slicePriorToX("_")),
v[0]=parseInt(d.sliceAfterX("_Pin"),10),h=d.restorePinTreeNodeName(),h===C[v[0]-1].replaceSpecialCharacters()&&(xa(d,m,v),ka()));return}v[0]=parseInt(c.sliceAfterX("Pin"),10);m=J(h.slicePriorToX("_"))}Bb(!1,c,m,v)}).bind("open_node.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d=c.restorePinTreeNodeName(),h,e,g;try{var m=a.inst._get_parent(a.rslt.obj).attr("id")}catch(fc){}if("undefined"===typeof m&&-1!==$.inArray(c,u))for(q=0,f=Aa.length;q<f;q+=1)-1!==Aa[q].indexOf(d)&&($("#"+Aa[q]).addClass("semi-disabled"),
$("#"+Aa[q]+" >a").css("background-color","#B0C4DE"));if("undefined"===typeof m&&"undefined"!==typeof w[d]&&0<w[d].length){Ga=!0;q=0;for(f=w[d].length;q<f;q+=1)r.jstree("open_node",$("#"+w[d][q].restorePinTreeNodeName()+"_Intermediate")),r.jstree("check_node",$("#"+w[d][q]));w[d].length=0;Ga=!1;ka()}$(a.rslt.obj).find("li").each(function(b,a){h=$(a).attr("id");m=J(h.slicePriorToX("_"));if(-1!==h.indexOf("_Pin"))if(g=da[parseInt(h.sliceAfterX("_Pin"),10)-1],0!==h.indexOf(g)&&(0!==g.indexOf("P")||2!==
g.indexOf("."))||-1!==h.indexOf(g)&&!1===$("#"+h).hasClass("jstree-checked"))$("#"+h+" >a").css("color","red"),$("#"+c+" >a").css("color","red");else{if("undefined"===typeof w[m]||"undefined"!==typeof w[m]&&0===w[m].length)k=$.inArray(h,V),-1!==k&&($("#"+h+" >a").css("color","blue"),V.splice(k,1))}else r.jstree("open_node",$("#"+h)),$("#"+h).find("li").each(function(b,a){e=$(a).attr("id");m=J(e.slicePriorToX("_"));g=da[parseInt(e.sliceAfterX("_Pin"),10)-1];if(-1===e.indexOf(g)&&(0!==g.indexOf("P")||
2!==g.indexOf("."))||-1!==e.indexOf(g)&&!1===$("#"+e).hasClass("jstree-checked"))$("#"+e+" >a").css("color","red"),$("#"+h+" >a").css("color","red"),$("#"+c+" >a").css("color","red");else if("undefined"===typeof w[m]||"undefined"!==typeof w[m]&&0===w[m].length)b=$.inArray(e,V),-1!==b&&($("#"+e+" >a").css("color","blue"),V.splice(b,1))}),r.jstree("close_node",$("#"+h))});var k=g=e=h=m=d=c=null}).bind("select_node.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d;r.jstree("open_node",$("#"+c));$("#"+
c).find("li").each(function(b,a){d=$(a).attr("id");-1!==d.indexOf("_Pin")?r.jstree("open_node",$("#"+d)):(r.jstree("open_node",$("#"+d)),$("#"+d).find("li").each(function(b,a){f=$(a).attr("id");r.jstree("open_node",$("#"+f))}))});var f=d=c=null}).bind("loaded.jstree",function(){q=0;for(f=u.length;q<f;q+=1)$("#"+u[q]).addClass("semi-disabled"),$("#"+u[q]+" >a").css("background-color","#B0C4DE");if(Ha){Ga=!0;var b,a,c,d,h=[];var e=K;var g=T(U);if("NUC400"===k||"M451HD"===k||"M451LD"===k||"M4521"===
k||"NANO100AN"===k||"NANO100BN"===k||"NANO112"===k||"NUC505"===k||"NUC121AE"===k||"NUC123AE"===k||"NANO103"===k||"M480"===k||"M480LD"===k||"M251"===k||"M261"===k||"M2351"===k||"M031"===k||"M0564"===k||"M05641"===k||"NUC126"===k||"NUC1261"===k||"NUC029xGE"===k||"NUC029KGE"===k||"MINI57"===k||"NM1120"===k||"NDA102"===k){var m=0;for(a=g.length;m<a;m+=1)if(0!==U[g[m]]){var r=U[g[m]];var n=-1!==g[m].indexOf("MFPH")||-1!==g[m].indexOf("_H_MFP")?!1:!0;for(b=0;8>b;b+=1){var t=15<<4*b>>>0;var v=(r&t)>>>0;
if(v=v>>>4*b>>>0){var x=n?b:b+8;var Z="P"+g[m].slice(g[m].indexOf("P")+1,g[m].indexOf("P")+2)+"."+x.toString();var y=$.inArray(Z,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);if(-1!==y){var H=ua(g[m],x);x=1;for(c=NUTOOL_PIN.g_cfg_gpios[H].f.length;x<c;x+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+v)){var p=NUTOOL_PIN.g_cfg_gpios[H].f[x];p=p.slicePriorToX(":");x+=1;if(x<c&&-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+v))if(-1!==K.indexOf("Pin"+(y+1))){var l=K.slice(K.indexOf("Pin"+
(y+1)));l=l.sliceBetweenXandX(":","\r").trim();p!==l&&(p=l)}else-1!==K.indexOf("Pin "+(y+1))&&(l=K.slice(K.indexOf("Pin "+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l));break}v=p;v=J(v);p=p.replaceSpecialCharacters();-1!==v.indexOf("_")&&(v=v.slicePriorToX("_"));h[0]=y+1;ca(p+"_Pin"+(y+1),v,h);"undefined"===typeof w[v]?(w[v]=[],w[v][0]=p+"_Pin"+(y+1)):w[v].push(p+"_Pin"+(y+1))}}r=(r&~t)>>>0;if(0===r)break}}}else if("ML51"===k||0===k.indexOf("MS51"))for(m=0,a=g.length;m<a;m+=1){if(0!==
U[g[m]])for(r=U[g[m]],b=0;8>b;b+=1){t=15<<4*b>>>0;v=(r&t)>>>0;if(v=v>>>4*b>>>0)if(x=b,Z="P"+g[m].slice(g[m].indexOf("P")+1,g[m].indexOf("P")+2)+"."+x.toString(),y=$.inArray(Z,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==y){H=ua(g[m],x);x=1;for(c=NUTOOL_PIN.g_cfg_gpios[H].f.length;x<c;x+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+v)){p=NUTOOL_PIN.g_cfg_gpios[H].f[x];p=p.slicePriorToX(":");x+=1;x<c&&-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+v)&&(-1!==K.indexOf("Pin"+
(y+1))?(l=K.slice(K.indexOf("Pin"+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)):-1!==K.indexOf("Pin "+(y+1))&&(l=K.slice(K.indexOf("Pin "+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)));break}v=p;v=J(v);p=p.replaceSpecialCharacters();-1!==v.indexOf("_")&&(v=v.slicePriorToX("_"));h[0]=y+1;ca(p+"_Pin"+(y+1),v,h);"undefined"===typeof w[v]?(w[v]=[],w[v][0]=p+"_Pin"+(y+1)):w[v].push(p+"_Pin"+(y+1))}r=(r&~t)>>>0;if(0===r)break}}else if("ISD9100"===k||"ISD9300"===k)for(m=0,a=
g.length;m<a;m+=1){if(0!==U[g[m]])for(r=U[g[m]],b=0;16>b;b+=1){t=3<<2*b>>>0;v=(r&t)>>>0;if(v=v>>>2*b>>>0)if(x=b,Z="P"+g[m].slice(g[m].indexOf("P")+1,g[m].indexOf("P")+2)+"."+x.toString(),y=$.inArray(Z,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==y){H=ua(g[m],x);x=1;for(c=NUTOOL_PIN.g_cfg_gpios[H].f.length;x<c;x+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+v)){p=NUTOOL_PIN.g_cfg_gpios[H].f[x];p=p.slicePriorToX(":");x+=1;x<c&&-1!==NUTOOL_PIN.g_cfg_gpios[H].f[x].indexOf(":"+
v)&&(-1!==K.indexOf("Pin"+(y+1))?(l=K.slice(K.indexOf("Pin"+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)):-1!==K.indexOf("Pin "+(y+1))&&(l=K.slice(K.indexOf("Pin "+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)));break}v=p;v=J(v);p=p.replaceSpecialCharacters();-1!==v.indexOf("_")&&(v=v.slicePriorToX("_"));h[0]=y+1;ca(p+"_Pin"+(y+1),v,h);"undefined"===typeof w[v]?(w[v]=[],w[v][0]=p+"_Pin"+(y+1)):w[v].push(p+"_Pin"+(y+1))}r=(r&~t)>>>0;if(0===r)break}}else if("NUC200AE"===
k||"NUC2201"===k||"NUC029xEE"===k||"NUC100AN_BN"===k||"NUC100CN"===k||"NUC100DN"===k)for(m=0,a=g.length;m<a;m+=1){if(-1===g[m].indexOf("ALT")&&0!==U[g[m]])for(b=0;32>b;b+=1){r=U[g[m]];t=1<<b>>>0;v=(r&t)>>>b>>>0;y=-1;if(v)for(l=g[m]+"["+b+"]",x=0,c=NUTOOL_PIN.g_cfg_gpioMatrix.length;x<c;x+=1){n=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[x].f.length;n<d;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[x].f[n].indexOf(l)){Z=NUTOOL_PIN.g_cfg_gpioMatrix[x].f[0];y=$.inArray(Z,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);
break}if(-1!==y){v=0;n=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[x].f.length;n<d;n+=1){p=NUTOOL_PIN.g_cfg_gpioMatrix[x].f[n];var I=parseInt(p.slice(p.indexOf("[")+1,p.indexOf("]")),10);t=1<<I>>>0;H=p.slicePriorToX("[");r=U[H];v+=((r&t)>>>I)*Math.pow(2,n-1);H=p.slicePriorToX(":");-1===$.inArray(H,NUTOOL_PIN.g_cfg_shareBits)&&(U[H]=r&~t)}p="";H=ua(Z,parseInt(Z.sliceAfterX("."),10));n=1;for(d=NUTOOL_PIN.g_cfg_gpios[H].f.length;n<d;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[H].f[n].indexOf(":"+v)){p=NUTOOL_PIN.g_cfg_gpios[H].f[n];
p=p.slicePriorToX(":");n+=1;n<d&&-1!==NUTOOL_PIN.g_cfg_gpios[H].f[n].indexOf(":"+v)&&(-1!==K.indexOf("Pin"+(y+1))?(l=K.slice(K.indexOf("Pin"+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)):-1!==K.indexOf("Pin "+(y+1))&&(l=K.slice(K.indexOf("Pin "+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)));break}if(""!==p){v=p;v=J(v);p=p.replaceSpecialCharacters();-1!==v.indexOf("_")&&(v=v.slicePriorToX("_"));h[0]=y+1;ca(p+"_Pin"+(y+1),v,h);"undefined"===typeof w[v]?(w[v]=[],w[v][0]=
p+"_Pin"+(y+1)):w[v].push(p+"_Pin"+(y+1));break}}}if(0===U[g[m]])break}}else for(m=0,a=g.length;m<a;m+=1)if(0!==U[g[m]])for(b=0;32>b;b+=1){r=U[g[m]];t=1<<b>>>0;v=(r&t)>>>b>>>0;y=-1;if(v)for(l=g[m]+"["+b+"]",x=0,c=NUTOOL_PIN.g_cfg_gpioMatrix.length;x<c;x+=1){n=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[x].f.length;n<d;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[x].f[n].indexOf(l)){Z=NUTOOL_PIN.g_cfg_gpioMatrix[x].f[0];y=$.inArray(Z,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==y){v=0;
n=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[x].f.length;n<d;n+=1)p=NUTOOL_PIN.g_cfg_gpioMatrix[x].f[n],I=parseInt(p.slice(p.indexOf("[")+1,p.indexOf("]")),10),t=1<<I>>>0,H=p.slicePriorToX("["),r=U[H],v+=((r&t)>>>I)*Math.pow(2,n-1),U[H]=r&~t;p="";H=ua(Z,parseInt(Z.sliceAfterX("."),10));n=1;for(d=NUTOOL_PIN.g_cfg_gpios[H].f.length;n<d;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[H].f[n].indexOf(":"+v)){p=NUTOOL_PIN.g_cfg_gpios[H].f[n];p=p.slicePriorToX(":");n+=1;n<d&&-1!==NUTOOL_PIN.g_cfg_gpios[H].f[n].indexOf(":"+
v)&&(-1!==K.indexOf("Pin"+(y+1))?(l=K.slice(K.indexOf("Pin"+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)):-1!==K.indexOf("Pin "+(y+1))&&(l=K.slice(K.indexOf("Pin "+(y+1))),l=l.sliceBetweenXandX(":","\r").trim(),p!==l&&(p=l)));break}if(""!==p){v=p;v=J(v);p=p.replaceSpecialCharacters();-1!==v.indexOf("_")&&(v=v.slicePriorToX("_"));h[0]=y+1;ca(p+"_Pin"+(y+1),v,h);"undefined"===typeof w[v]?(w[v]=[],w[v][0]=p+"_Pin"+(y+1)):w[v].push(p+"_Pin"+(y+1));break}}}if(0===U[g[m]])break}for(;-1!==
e.indexOf("IN_ICE_MODE");){g=!0;m=e.indexOf("IN_ICE_MODE");for(a=1;" "!==e.charAt(m-a);)if(a+=1,0>m-a||30<a){g=!1;break}if(g)p=e.slice(m-a+1,m)+"IN_ICE_MODE",v=p=p.replaceSpecialCharacters(),-1!==v.indexOf("_")&&(v=v.slicePriorToX("_")),v=J(v);else break;g=!0;m-=a;for(a=1;" "!==e.charAt(m-a);)if(a+=1,0>m-a||30<a){g=!1;break}if(g)m=e.slice(m-a+1).slicePriorToX(":"),m=parseInt(m,10),h[0]=m,ca(p+"_Pin"+(y+1),v,h),"undefined"===typeof w[v]?(w[v]=[],w[v][0]=p+"_Pin"+m):w[v].push(p+"_Pin"+m);else break;
e=e.slice(e.indexOf("IN_ICE_MODE")+1)}m=0;for(a=R.length;m<a;m+=1)if(""===C[R[m]]){e=L[R[m]];for(e=e.slice(e.indexOf("P"));-1!==e.indexOf(".")&&2!==e.indexOf(".");)e=e.slice(1),e=e.slice(e.indexOf("P"));e=e.slicePriorToX("/");y=e.replaceSpecialCharacters()+"_Pin"+(R[m]+1);e=J(e);h[0]=R[m]+1;ca(y,e,h);"undefined"===typeof w[e]?(w[e]=[],w[e][0]=y):w[e].push(y)}h=T(w);m=0;for(a=h.length;m<a;m+=1)$("#"+h[m]+"_Root").addClass("jstree-undetermined");U=[];ka();K=null}else Ha=!0,Qa&&Cb();Ga=!1;Qa?($("#ChipType").show(),
$("#MCU").show(),$("#MCU").height(),$("#moduleTree").height(ha-$("#ChipType").height()-$("#MCU").height()-Ba-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");Za();"undefined"!==typeof NUTOOL_PER&&"PinConfigure"!==
NUTOOL_PER.getg_currentTool()&&($("#parentOfPanel").hide(),$("#ChipType").hide(),$("#MCU").hide(),$("#rootTree_Pin").hide())}).bind("destroy.jstree",function(){a=[];e=[];g=[];b=[];h=[];v=[];n=[];u=[];w=[];V=[];F=Q=M=O=H=t=r=Z=D=E=G=z=m=p=l=B=x=null})}function Bb(a,f,c,d){function e(b,a){if($("#"+$(a).attr("id")).hasClass("jstree-checked")||$("#"+$(a).attr("id")).hasClass("jstree-undetermined"))return w=!0,!1}function g(b,a){if($("#"+$(a).attr("id")).hasClass("jstree-checked"))return $("#"+f.restorePinTreeNodeName()+
"_Intermediate").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),$("#"+J(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1}var b;var h=!1;var m=[],v=[],k=[],u=M.length,p="",r;var t="#41AF88";var H=$("#moduleTree");var q=0;for(b=M.length;q<b;q+=1)m[q]=M[q].slicePriorToX(":");if(a){ta();for(q=0;q<u;q+=1)-1!==$.inArray(parseInt(m[q],10),d)&&(1!==d.length&&M[q]!==m[q]+":"+c||1===d.length&&C[m[q]-1].replaceSpecialCharacters()!==
f.restorePinTreeNodeName())&&(p="Simplified Chinese"===P?p+("\u7b2c"+m[q]+"\u811a\u4f4d\u5df2\u88ab"+C[m[q]-1]+"\u4f7f\u7528\u3002<br />"):"Traditional Chinese"===P?p+("\u7b2c"+m[q]+"\u8173\u4f4d\u5df2\u88ab"+C[m[q]-1]+"\u4f7f\u7528\u3002<br />"):p+("Pin"+m[q]+" has been asserted by "+C[m[q]-1]+".<br />"),h=!0);if(h){if("Simplified Chinese"===P){u="\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 x="\u8981";var l="\u4e0d\u8981"}else"Traditional Chinese"===P?(u="\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?",x="\u8981",l="\u4e0d\u8981"):(u="Conflict Occurred",y="The expected "+c+" conflicts with other modules. Would you like to adjust the old modules and configure to the current one?",x="Yes",l="No");ia();$('<div id="conflictDialog"><p>'+
y+"<br />"+p+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!1,resizable:!1,title:u,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#conflictDialog").dialog("destroy")},buttons:[{text:x,click:function(){k=T(A);Ra=[];q=0;for(b=k.length;q<b;q+=1)Ra[k[q]]=A[k[q]];Oa=[];q=0;for(b=R.length;q<b;q+=1)Oa[q]=R[q];K="";q=0;for(b=C.length;q<b;q+=1)""!==C[q]&&(K+="Pin"+(q+1)+":"+C[q]+"\r");B="";Db(f,c,d,m);$("#conflictDialog").dialog("isOpen")&&
$("#conflictDialog").dialog("destroy")}},{text:l,click:function(){q=0;for(b=d.length;q<b;q+=1)-1===$.inArray(d[q].toString(),m)&&v.push(d[q]);$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");q=0;for(b=v.length;q<b;q+=1)r=sa[c][$.inArray(v[q],aa[c])]+"_Pin"+v[q],r=r.replaceSpecialCharacters(),$("#moduleTree").jstree("check_node",$("#"+r))}}]});$("#conflictDialog").dialog("widget").draggable("option","axis","x y");$("#conflictDialog").dialog("widget").draggable({containment:"window",
scroll:!1});l=x=y=u=null}}if(h&&a)if(1===d.length&&-1!==f.indexOf("_Pin")){if($("#"+f).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),-1!==f.indexOf("_")){$("#"+f.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");var w=!1;$("#"+J(c)+"_Root").find("li").each(function(b,a){if($("#"+$(a).attr("id")).hasClass("jstree-checked")||$("#"+$(a).attr("id")).hasClass("jstree-undetermined"))return w=!0,$("#"+
J(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1});w||($("#"+f.slicePriorToX("_")).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+J(c)+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"));$("#"+f.restorePinTreeNodeName()+"_Intermediate").find("li").each(function(b,a){if($("#"+$(a).attr("id")).hasClass("jstree-checked"))return $("#"+f.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),
$("#"+J(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"),!1})}}else for(q=0,b=d.length;q<b;q+=1){a=sa[c][q];f=a+"_Pin"+d[q];f=f.replaceSpecialCharacters();w=!1;H=0;for(h=M.length;H<h;H+=1)d[q]===parseInt(M[H].slicePriorToX(":"),10)&&0===f.indexOf(M[H].sliceAfterX(":"))&&(w=!0);w||($("#"+f).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+J(c)+"_Root").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined"));
-1!==f.indexOf("_")&&($("#"+f.restorePinTreeNodeName()+"_Intermediate").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),w=!1,$("#"+J(c)+"_Root").find("li").each(e),w||($("#"+f.slicePriorToX("_")).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),$("#"+J(c)+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")),$("#"+f.restorePinTreeNodeName()+"_Intermediate").find("li").each(g))}else{if(a){if(-1!==$.inArray(f.restorePinTreeNodeName()+
"_Intermediate",Aa))for(q=0,b=N.length;q<b;q+=1)N[q].restorePinTreeNodeName()===f.restorePinTreeNodeName()&&f!==N[q]&&H.jstree("uncheck_node",$("#"+N[q]));if(1===d.length&&0===f.indexOf("EBI")&&(h=L[parseInt(f.sliceAfterX("_Pin"),10)-1],h.indexOf("EBI")!==h.lastIndexOf("EBI")))for(;-1!==h.indexOf("EBI");)h=h.slice(h.indexOf("EBI")),-1!==h.indexOf("/")?(f.restorePinTreeNodeName()!==h.slice(h.indexOf("EBI"),h.indexOf("/"))&&H.jstree("uncheck_node",$("#"+h.slice(h.indexOf("EBI"),h.indexOf("/"))+"_Pin"+
f.sliceAfterX("_Pin"))),h=h.slice(h.indexOf("/")+1)):(f.restorePinTreeNodeName()!==h.slice(h.indexOf("EBI"))&&H.jstree("uncheck_node",$("#"+h.slice(h.indexOf("EBI"))+"_Pin"+f.sliceAfterX("_Pin"))),h=h.slice(1))}u=d.length;if(a){if(0<ya.length)t="#FAB92D";else if(0!==S.length)for(H=0,h=S.length;H<h;H+=1)S[H]===d[q]&&S.splice(H,1);for(q=0;q<u;q+=1){p=!1;H=0;for(h=M.length;H<h;H+=1)if(d[q]===parseInt(M[H].slicePriorToX(":"),10)){M[H]=d[q]+":"+c;p=!0;break}p||M.push(d[q]+":"+c);1!==d.length?Ca(d[q]-1,
c):-1!==f.indexOf("_Pin")?Ca(d[q]-1,f.restorePinTreeNodeName(),!0):Ca(d[q]-1,f);Da(d[q],t);da[d[q]-1]=c}}else for(q=0;q<u;q+=1)if(t=$.inArray(d[q]+":"+c,M),-1!==t&&(M.splice(t,1),Ca(d[q]-1,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d[q]-1]),Da(d[q],"#FFFFFF"),da[d[q]-1]="",0!==S.length))for(H=0,h=S.length;H<h;H+=1)S[H]===d[q]&&S.splice(H,1);ka();if(a)if(1===d.length&&-1!==f.indexOf("_Pin"))Ia(d[0]-1,f.restorePinTreeNodeName(),!1),Pa(f,d[0],!0);else for(q=0,b=d.length;q<b;q+=1)a=sa[c][q],
Ia(d[q]-1,a,!1),Pa(a+"_Pin"+d[q],d[q],!0);else for(q=0,b=d.length;q<b;q+=1){if(c===da[d[q]-1]||""===da[d[q]-1])da[d[q]-1]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d[q]-1],Ia(d[q]-1,"",!0);a=sa[c][q];Pa(a+"_Pin"+d[q],d[q],!1)}h=null;m=[];v=[];k=[];w=t=p=u=H=a=r=p=u=null}}function Db(a,f,c,d){function e(b,a){x=$(a).attr("id");if("red"===$("#"+x+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+x+" >a").css("color")||y)$("#"+x).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
else{y=!0;l=[];l[0]=parseInt(x.sliceAfterX("Pin"),10);""!==B&&(A=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),A!==l[0].toString()&&"removed"!==A&&"end"!==A&&(B+=C[parseInt(A,10)-1]+":"+A+"/end;"));B+=x.restorePinTreeNodeName()+":"+l[0];q=0;for(h=v.length;q<h;q+=1)if(0===v[q].indexOf(x.restorePinTreeNodeName()+"_Pin")){B+="/"+v[q].sliceAfterX("Pin");v.splice(q,1);break}B+=";";ca(x,t,l);$("#"+x).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");$("#"+x+" >a").css("color",
"blue")}}function g(b,a){x=$(a).attr("id");p=parseInt(x.sliceAfterX("Pin"),10);-1===$.inArray(p,c)&&(I=ib(x,c,0,v));if(I)return!1}var b,h;var m=$("#moduleTree");var v=[],k=[];var u=0;for(b=c.length;u<b;u+=1){var p=c[u];if(-1!==$.inArray(p.toString(),d)){var r=C[p-1]+"_Pin"+p;r=r.replaceSpecialCharacters();m.jstree("uncheck_node",$("#"+r));v.push(r);if(!$("#"+r).hasClass("jstree-unchecked")){var t=J(r.slicePriorToX("_"));var l=[];l[0]=p;xa(r,t,l);if("undefined"!==typeof w[t]){var q=0;for(h=w[t].length;q<
h;q+=1)if(w[t][q]===r){w[t][q]="";break}q=0;for(h=w[t].length;q<h&&""===w[t][q];q+=1)q===h-1&&$("#"+t+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}m.jstree("close_node",$("#"+t+"_Root"))}-1!==$.inArray(r,N)&&k.push(r.restorePinTreeNodeName()+"_Intermediate")}}if(1===c.length&&-1!==a.indexOf("_Pin"))m.jstree("check_node",$("#"+a));else for(u=0,b=c.length;u<b;u+=1)for(q=0,h=aa[f].length;q<h;q+=1)aa[f][q]===c[u]&&(a=sa[f][q].replaceSpecialCharacters(),m.jstree("check_node",
$("#"+a+"_Pin"+c[u])));if(0<k.length){u=0;for(b=k.length;u<b;u+=1){var y=!1;t=J(k[u].slicePriorToX("_"));if(0<$("#"+k[u]).find("li").length)$("#"+k[u]).find("li").each(e);else{var x=k[u].restorePinTreeNodeName();q=0;for(h=N.length;q<h;q+=1)if(0===N[q].indexOf(x+"_Pin")){p=N[q].sliceAfterX("_Pin");var I=!1;f=0;for(m=M.length;f<m;f+=1)if(M[f].slicePriorToX(":")===p){I=!0;break}if(!I){y=!0;x=N[q];l=[];l[0]=parseInt(x.sliceAfterX("Pin"),10);if(""!==B){var A=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";");
A!==l[0].toString()&&"removed"!==A&&"end"!==A&&(B+=C[parseInt(A,10)-1]+":"+A+"/end;")}B+=x.restorePinTreeNodeName()+":"+l[0];q=0;for(h=v.length;q<h;q+=1)if(0===v[q].indexOf(x.restorePinTreeNodeName()+"_Pin")){B+="/"+v[q].sliceAfterX("Pin");v.splice(q,1);break}B+=";";ca(x,t,l);f=0;for(m=V.length;f<m;f+=1)if(0===V[f].indexOf(x.restorePinTreeNodeName()+"_Pin")){V.splice(f,1);break}V.push(x);"undefined"===typeof w[t]?(w[t]=[],w[t][0]=x):w[t].push(x);break}}}if(y)$("#"+t+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
$("#"+k[u]).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");else{I=!1;if(0<$("#"+k[u]).find("li").length)$("#"+k[u]).find("li").each(g);else for(x=k[u].restorePinTreeNodeName(),q=0,h=N.length;q<h&&(0!==N[q].indexOf(x+"_Pin")||(p=parseInt(N[q].sliceAfterX("_Pin"),10),-1===$.inArray(p,c)&&(I=ib(N[q],c,0,v)),!I));q+=1);I||$("#"+k[u]).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}}ka()}""!==B&&(A=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),
"removed"!==A&&"end"!==A&&(B+=C[parseInt(A,10)-1]+":"+A+"/end;"));q=0;for(h=v.length;q<h;q+=1)B+=v[q].restorePinTreeNodeName().restoreSpecialCharacters()+":"+v[q].sliceAfterX("_Pin")+"/removed;";""!==B&&Xb(B);t=m=a=x=r=a=A=p=m=f=h=q=b=u=null;l=[];v=[];k=[];I=y=null}function ib(a,f,c,d){function e(b,c){l=$(c).attr("id");l!==a&&$("#"+l).hasClass("jstree-checked")&&(p=!0,""!==B&&(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+
":"+x+"/end;")),B+=a.restorePinTreeNodeName()+":"+h[0]+"/"+l.sliceAfterX("Pin")+";");l!==a&&$("#"+l).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}var g,b,h=[],m=[];$("#moduleTree");var k;var n=parseInt(a.sliceAfterX("Pin"),10);var u=C[n-1].replaceSpecialCharacters();if(-1===$.inArray(u+"_Pin"+n,N)||-1!==$.inArray(n,f)||10<=c)return!1;f.push(n);c+=1;var p=k=!1;m=[];var r=J(u.slicePriorToX("_"));var t=u+"_Intermediate";if(0<$("#"+t).find("li").length)$("#"+t).find("li").each(function(b,
a){l=$(a).attr("id");"red"===$("#"+l+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+l+" >a").css("color")||l.sliceAfterX("_Pin")===n.toString()||k?l.sliceAfterX("_Pin")!==n.toString()&&(m.push(l),$("#"+l).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):(k=!0,h=[],h[0]=parseInt(l.sliceAfterX("Pin"),10),""!==B&&(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+":"+x+"/end;")),B+=l.restorePinTreeNodeName()+
":"+h[0]+"/"+n+";",ca(l,r,h),$("#"+l).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),$("#"+l+" >a").css("color","blue"))});else for(t=0,g=N.length;t<g;t+=1)if(0===N[t].indexOf(u+"_Pin")){var l=N[t];var q=l.sliceAfterX("_Pin");if(q===n.toString())p=!0;else{p=!1;var y=0;for(b=M.length;y<b;y+=1)if(M[y].slicePriorToX(":")===q){p=!0;break}}if(p||k)l.sliceAfterX("_Pin")!==n.toString()&&m.push(l);else{k=!0;h=[];h[0]=parseInt(l.sliceAfterX("Pin"),10);if(""!==B){var x=B.slice(B.lastIndexOf("/")+
1).slicePriorToX(";");x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+":"+x+"/end;")}B+=l.restorePinTreeNodeName()+":"+h[0]+"/"+n+";";ca(l,r,h);y=0;for(b=V.length;y<b;y+=1)if(0===V[y].indexOf(l.restorePinTreeNodeName()+"_Pin")){V.splice(y,1);break}V.push(l);"undefined"===typeof w[r]?(w[r]=[],w[r][0]=l):w[r].push(l);if("undefined"!==typeof w[r]){t=0;for(g=w[r].length;t<g;t+=1)if(w[r][t]===u+"_Pin"+n){w[r][t]="";break}t=0;for(g=w[r].length;t<g&&""===w[r][t];t+=1)t===g-1&&$("#"+
r+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}break}}if(k){$("#"+u+"_Pin"+n).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");h=[];h[0]=parseInt(a.sliceAfterX("Pin"),10);r=J(a.slicePriorToX("_"));if(0<$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length)$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").each(function(b,c){l=$(c).attr("id");l===a||!$("#"+l).hasClass("jstree-checked")&&-1===$.inArray(l,d)||(""!==B&&
(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+":"+x+"/end;")),B+=a.restorePinTreeNodeName()+":"+h[0]+"/"+l.sliceAfterX("Pin")+";");l!==a&&$("#"+l).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")});else for(t=0,g=N.length;t<g;t+=1)if(0===N[t].indexOf(a.restorePinTreeNodeName()+"_Pin")&&(l=N[t],l!==a&&(l.restorePinTreeNodeName()===C[parseInt(l.sliceAfterX("Pin"),10)-1]||-1!==$.inArray(l,d)))){""!==
B&&(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+":"+x+"/end;"));B+=a.restorePinTreeNodeName()+":"+h[0]+"/"+l.sliceAfterX("Pin")+";";break}t=0;for(g=d.length;t<g;t+=1)if(0===d[t].indexOf(a.restorePinTreeNodeName()+"_Pin")){d.splice(t,1);break}ca(a,r,h);$("#"+r+"_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(b=V.length;y<b;y+=1)if(0===V[y].indexOf(a.restorePinTreeNodeName()+"_Pin")){V.splice(y,1);break}V.push(a);"undefined"===typeof w[r]?(w[r]=[],w[r][0]=a):w[r].push(a);if("undefined"!==typeof w[r]){t=0;for(g=w[r].length;t<g;t+=1)if(w[r][t]===l){w[r][t]="";break}t=0;for(g=w[r].length;t<g&&""===w[r][t];t+=
1)t===g-1&&$("#"+r+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}return!0}if(0<m.length){for(t=0;t<m.length;t+=1)if(p=ib(m[t],f,c,d)){h=[];h[0]=parseInt(a.sliceAfterX("Pin"),10);r=J(a.slicePriorToX("_"));p=!1;if(0<$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").length)$("#"+a.restorePinTreeNodeName()+"_Intermediate").find("li").each(e);else for(t=0,g=N.length;t<g;t+=1)if(0===N[t].indexOf(a.restorePinTreeNodeName()+"_Pin")&&(l=N[t],l!==a&&l.restorePinTreeNodeName()===
C[parseInt(l.sliceAfterX("Pin"),10)-1])){p=!0;""!==B&&(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,10)-1]+":"+x+"/end;"));B+=a.restorePinTreeNodeName()+":"+h[0]+"/"+l.sliceAfterX("Pin")+";";break}if(p)for(t=0,g=d.length;t<g;t+=1){if(0===d[t].indexOf(a.restorePinTreeNodeName()+"_Pin")){d.splice(t,1);break}}else{""!==B&&(x=B.slice(B.lastIndexOf("/")+1).slicePriorToX(";"),x!==h[0].toString()&&"removed"!==x&&"end"!==x&&(B+=C[parseInt(x,
10)-1]+":"+x+"/end;"));B+=a.restorePinTreeNodeName()+":"+h[0];t=0;for(g=d.length;t<g;t+=1)if(0===d[t].indexOf(a.restorePinTreeNodeName()+"_Pin")){B+="/"+d[t].sliceAfterX("Pin");l=d[t];d.splice(t,1);break}B+=";"}ca(a,r,h);$("#"+r+"_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(b=V.length;y<b;y+=1)if(0===V[y].indexOf(a.restorePinTreeNodeName()+"_Pin")){V.splice(y,1);break}V.push(a);"undefined"===typeof w[r]?(w[r]=[],w[r][0]=a):w[r].push(a);if("undefined"!==typeof w[r]){t=0;for(g=w[r].length;t<g;t+=1)if(w[r][t]===l){w[r][t]="";break}t=0;for(g=w[r].length;t<g&&""===w[r][t];t+=1)t===g-1&&$("#"+r+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}return!0}return!1}t=
r=x=n=q=b=y=g=t=g=t=null;h=[];m=[];p=k=l=u=null}function ca(a,f,c){var d,e,g=c.length;$("#moduleTree");if(0!==S.length){var b=0;for(e=S.length;b<e;b+=1)S[b]===c[d]&&S.splice(b,1)}for(d=0;d<g;d+=1){var h=!1;b=0;for(e=M.length;b<e;b+=1)if(c[d]===parseInt(M[b].slicePriorToX(":"),10)){M[b]=c[d]+":"+f;h=!0;break}h||M.push(c[d]+":"+f);1!==c.length?Ca(c[d]-1,f):-1!==a.indexOf("_Pin")?Ca(c[d]-1,a.restorePinTreeNodeName(),!0):Ca(c[d]-1,a,!0);Da(c[d],"#41AF88");da[c[d]-1]=f}if(1===c.length&&-1!==a.indexOf("_Pin"))Ia(c[0]-
1,a.restorePinTreeNodeName(),!1),Pa(a,c[0],!0);else for(d=0,a=c.length;d<a;d+=1)b=sa[f][d],Ia(c[d]-1,b,!1),Pa(b+"_Pin"+c[d],c[d],!0);c.length=null}function Wb(a){var f,c,d=$("#moduleTree"),e=[],g=[],b=[],h=[],m=[],k=[],n=[],u;var l=!0;h=[];m=[];k=[];n=[];var r=J(a.slicePriorToX("_"));var t=u=!1;var p=0;d.jstree("open_node",$("#"+a));$("#"+a).find("li").each(function(b,c){y=$(c).attr("id");if(-1===$.inArray(y,h))if(h.push(y),-1===$.inArray(y,N))-1!==y.indexOf("_Pin")?(I=C[parseInt(y.sliceAfterX("_Pin"),
10)-1].replaceSpecialCharacters(),I!==y.restorePinTreeNodeName()?(l=!1,$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):t=!0,"red"!==$("#"+y+" >a").css("color")&&"rgb(255, 0, 0)"!==$("#"+y+" >a").css("color")||-1!==$.inArray(y.sliceAfterX("Pin"),k)||(m.push(y),k.push(y.sliceAfterX("Pin")))):(u=!1,p=0,d.jstree("open_node",$("#"+y)),$("#"+y).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),$("#"+y).find("li").each(function(b,a){E=
$(a).attr("id");h.push(E);I=C[parseInt(E.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();I===E.restorePinTreeNodeName()?t=u=!0:$("#"+E).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if("red"===$("#"+E+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+E+" >a").css("color"))p+=1;b+1===$("#"+y).find("li").length&&!1===u&&(l=!1,p===$("#"+y).find("li").length&&n.push(y),$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"))}));else{I=
C[parseInt(y.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();I===y.restorePinTreeNodeName()?t=u=!0:$("#"+y).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if("red"===$("#"+y+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+y+" >a").css("color"))p+=1;if(b+1===$("#"+a).find("li").length&&!1===u){l=!1;if(p===$("#"+a).find("li").length)for(q=0,f=$("#"+a).find("li").length;q<f;q+=1)if(I=$("#"+a).find("li")[q].id,-1===$.inArray(I.sliceAfterX("Pin"),k)){m.push(I);k.push(I.sliceAfterX("Pin"));
break}$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");q=0;for(f=M.length;q<f;q+=1)if(M[q].sliceAfterX(":")===r){u=!0;break}u?$("#"+r+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+r+"_Root").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}}});if(0<n.length){var q=0;for(f=n.length;q<f;q+=1){var y=n[q];var x=0;for(c=$("#"+y).find("li").length;x<c;x+=1){var I=$("#"+y).find("li")[x].id;
if(-1===$.inArray(I.sliceAfterX("Pin"),k)){m.push(I);k.push(I.sliceAfterX("Pin"));break}}}}t?$("#"+a).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(l)"undefined"!==typeof w[r]&&0<w[r].length&&(w[r].length=0),d.jstree("uncheck_node",$("#"+a));else if(0<m.length){var D="";for(q=0;q<m.length;q+=1)I=m[q].sliceAfterX("Pin"),D="Simplified Chinese"===P?D+("\u7b2c"+I+"\u811a\u4f4d\u5df2\u88ab"+
C[parseInt(I,10)-1]+"\u4f7f\u7528\u3002<br />"):"Traditional Chinese"===P?D+("\u7b2c"+I+"\u8173\u4f4d\u5df2\u88ab"+C[parseInt(I,10)-1]+"\u4f7f\u7528\u3002<br />"):D+("Pin"+I+" has been asserted by "+C[parseInt(I,10)-1]+".<br />");if("Simplified Chinese"===P){x="\u51b2\u7a81\u53d1\u751f";c="\u9810\u671f\u7684"+r+"\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 z="\u8981";var G="\u4e0d\u8981"}else"Traditional Chinese"===
P?(x="\u885d\u7a81\u767c\u751f",c="\u9810\u671f\u7684"+r+"\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?",z="\u8981",G="\u4e0d\u8981"):(x="Conflict Occurred",c="The expected "+r+" conflicts with other modules. Would you like to adjust the old modules and configure to the current one?",z="Yes",G="No");ia();$('<div id="conflictDialog"><p>'+c+"<br />"+D+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!1,
resizable:!1,title:x,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#conflictDialog").dialog("destroy")},buttons:[{text:z,click:function(){b=T(A);Ra=[];q=0;for(f=b.length;q<f;q+=1)Ra[b[q]]=A[b[q]];Oa=[];q=0;for(f=R.length;q<f;q+=1)Oa[q]=R[q];K="";q=0;for(f=C.length;q<f;q+=1)""!==C[q]&&(K+="Pin"+(q+1)+":"+C[q]+"\r");jb(a);B="";e=[];g=[];for(q=0;q<m.length;q+=1)e.push(parseInt(m[q].sliceAfterX("Pin"),10)),g.push(m[q].sliceAfterX("Pin"));r=J(m[0].slicePriorToX("_"));Db(m[0],r,e,g)}},
{text:G,click:function(){$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");jb(a)}}]});$("#conflictDialog").dialog("widget").draggable("option","axis","x y");$("#conflictDialog").dialog("widget").draggable({containment:"window",scroll:!1});G=z=c=x=null}else jb(a);ka();var E=y=r=d=c=x=f=q=null;h=[];b=[];t=l=u=null}function jb(a){function f(b,a){t=$(a).attr("id");k=C[parseInt(t.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();if(k===t.restorePinTreeNodeName())return u=
n=!0,!1}function c(a,c){t=$(c).attr("id");"red"===$("#"+t+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+t+" >a").css("color")||u||(b=t.restorePinTreeNodeName()+"_Intermediate",g=[],g[0]=parseInt(t.sliceAfterX("Pin"),10),ca(t,l,g),u=n=!0);k=C[parseInt(t.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();k===t.restorePinTreeNodeName()?$("#"+t).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"):$("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}
var d,e=$("#moduleTree"),g=[],b,h,m=[],k,n;var u=n=!1;m=[];var l=J(a.slicePriorToX("_"));$("#"+a).find("li").each(function(a,c){h=$(c).attr("id");-1!==h.indexOf("_Pin")&&-1===$.inArray(h.restorePinTreeNodeName()+"_Intermediate",m)?("red"===$("#"+h+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+h+" >a").css("color")||u||(-1===$.inArray(h,N)?(g=[],g[0]=parseInt(h.sliceAfterX("Pin"),10),ca(h,l,g),n=!0):(n=!1,b=h.restorePinTreeNodeName()+"_Intermediate",e.jstree("open_node",$("#"+b)),$("#"+b).find("li").each(function(b,
a){t=$(a).attr("id");k=C[parseInt(t.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters();if(k===t.restorePinTreeNodeName())return n=!0,!1}),n||(g=[],g[0]=parseInt(h.sliceAfterX("Pin"),10),ca(h,l,g)),u=n=!0)),k=C[parseInt(h.sliceAfterX("_Pin"),10)-1].replaceSpecialCharacters(),k===h.restorePinTreeNodeName()?$("#"+h).removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"):$("#"+h).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")):-1!==h.indexOf("_Intermediate")&&
m.push(h)});var r=0;for(d=m.length;r<d;r+=1)u=!1,e.jstree("open_node",$("#"+m[r])),$("#"+m[r]).find("li").each(f),$("#"+m[r]).find("li").each(c),u?$("#"+m[r]).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"):$("#"+m[r]).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");n?($("#"+a).removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),$("#"+l+"_Root").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined")):
$("#"+a).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");ka();l=e=d=r=null;g=[];var t=h=b=null;m=[];u=n=k=null}function xa(a,f,c){var d,e;var g=c.length;for(d=0;d<g;d+=1){var b=$.inArray(c[d]+":"+f,M);if(-1!==b&&(M.splice(b,1),Ca(c[d]-1,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c[d]-1]),Da(c[d],"#FFFFFF"),da[c[d]-1]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c[d]-1],0!==S.length))for(b=0,e=S.length;b<e;b+=1)S[b]===c[d]&&S.splice(b,1)}d=0;for(g=
c.length;d<g;d+=1)f!==da[c[d]-1]&&(Ia(c[d]-1,"",!0),Pa(a+"_Pin"+c[d],c[d],!1))}function Ia(a,f,c){var d,e=$("#NUC_PinConfiguration_Canvas")[0];e=Q.getContext(e);c||-1===f.indexOf("_dot")&&2!==f.indexOf(".")||-1!==$.inArray(a,R)||("undefined"===typeof R?R[0]=a:R.push(a));if(c&&0!==R.length){var g=0;for(d=R.length;g<d;g+=1)R[g]===a&&R.splice(g,1)}f=f.restorePinTreeNodeName().restoreSpecialCharacters();C[a]=c?"":f;e.font="12px Arial";-1===G.indexOf("SOP")?(d=a-Math.floor(a/p*4)*p/4,a<p/4?(g=E+20+d*(16+
O),d=F+l+40,e.save(),e.translate(g,d),e.rotate(-Math.PI/2),e.textAlign="end",e.fillStyle="#FFFFFF",e.fillRect(-za/2-3,-3,za/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],-3,12.8),c||e.fillText(f,-3,12.8),e.restore()):a>=p/4&&a<p/2?(g=E+l+40+3,d=F+l-20-16-d*(16+O)+12.8,e.fillStyle="#FFFFFF",e.fillRect(g,d-12.8-2-1,na/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],g,d),c||e.fillText(f,g,d)):a>=p/2&&a<3*p/4?(g=E+l-20-16-d*(16+O),d=F-40,e.save(),e.translate(g,d),e.rotate(-Math.PI/2),e.fillStyle=
"#FFFFFF",e.fillRect(4,-3,za/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],6,12),c||e.fillText(f,6,12),e.restore()):a>=3*p/4&&a<p&&(g=E-40-3,d=F+20+d*(16+O)+12.8,e.save(),e.fillStyle="#FFFFFF",e.fillRect(g-na/2+1,d-12.8-2-1,na/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],g-e.measureText(L[a]).width,d),c||e.fillText(f,g-e.measureText(f).width,d),e.restore())):(d=a-Math.floor(a/p*2)*p/2,a<=p/2-1?(g=E-40-3,d=F+20+d*(16+O)+12.8,e.save(),e.fillStyle="#FFFFFF",e.fillRect(g-na/2+1,d-12.8-2-1,
na/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],g-e.measureText(L[a]).width,d),c||e.fillText(f,g-e.measureText(f).width,d),e.restore()):(g=E+l/2+40+3,d=F+l-20-16-d*(16+O)+12.8,e.fillStyle="#FFFFFF",e.fillRect(g,d-12.8-2-1,na/2,20),e.fillStyle="#000000",c&&ba&&e.fillText(L[a],g,d),c||e.fillText(f,g,d)))}function Pa(a,f,c){function d(b,a){if("red"===$("#"+$(a).attr("id")+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+$(a).attr("id")+" >a").css("color"))return $("#"+h[n]+" >a").css("color","red"),
!1}function e(b,a){if("red"===$("#"+$(a).attr("id")+" >a").css("color")||"rgb(255, 0, 0)"===$("#"+$(a).attr("id")+" >a").css("color"))return $("#"+m[n]+" >a").css("color","red"),!1}var g,b=L[f-1],h=[],m=[];if(c)for(;""!==b;){if(-1!==b.indexOf("/")){c=b.slicePriorToX("/")+"_Pin"+f;var k=b.slicePriorToX("/")+"_Intermediate"}else c=b+"_Pin"+f,k=b+"_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("_")&&$("#"+J(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,h)&&h.push(k),-1!==c.indexOf("_")&&(c=J(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,m)&&m.push(c)));b=-1!==b.indexOf("/")?b.sliceAfterX("/"):""}else for(;""!==b;){-1!==b.indexOf("/")?(c=b.slicePriorToX("/")+"_Pin"+f,k=b.slicePriorToX("/")+"_Intermediate"):(c=b+"_Pin"+f,k=b+"_Intermediate");c=c.replaceSpecialCharacters();k=k.replaceSpecialCharacters();if(c.restorePinTreeNodeName()===C[f-1].replaceSpecialCharacters()||""===C[f-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,h)&&h.push(k),-1!==c.indexOf("_")&&(c=J(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,m)&&m.push(c);else{c=c.restorePinTreeNodeName();var n=0;for(k=aa[c].length;n<k;n+=1)for(a=0,g=
M.length;a<g;a+=1)if(aa[c][n]===parseInt(M[a].slicePriorToX(":"),10)&&c!==M[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("_")&&$("#"+J(c.slicePriorToX("_"))+"_Root >a").css("color","red");b=-1!==b.indexOf("/")?b.sliceAfterX("/"):""}n=0;for(k=h.length;n<k;n+=1)$("#"+h[n]).find("li").each(d);n=0;for(k=m.length;n<
k;n+=1)$("#"+m[n]).find("li").each(e);g=k=a=n=c=k=c=b=null}function Ya(a){function f(b,a){return b-a}var c,d,e,g=$("#moduleTree"),b=$("#searchInput_Pin"),h=a,m=[],k=[],n=[];if(/^\d+$/.test(a)||2>a.length||15<a.length||0===a.toLowerCase().indexOf("pin:")&&4===a.length)g.jstree("close_all"),g.jstree("clear_search"),""!==a&&(ta(),2>a.length?fa("\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."):fa("\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.")),b.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)>p)return;var u=L[parseInt(a,10)-1];n=[];var l=0;for(c=u.length;l<c;l+=1)"/"===u[l]&&n.push(l);if(0===n.length){var r=u;r=J(r);-1!==r.indexOf("_")&&(r=r.slicePriorToX("_"));-1===$.inArray(r,m)&&m.push(r)}else for(l=0,c=n.length+1;l<c;l+=1)r=0===l?u.slice(0,n[0]):l===c-1?u.slice(n[c-2]+1):u.slice(n[l-1]+1,n[l]),r=J(r),-1!==r.indexOf("_")&&(r=r.slicePriorToX("_")),-1===$.inArray(r,m)&&m.push(r)}else for(l=
0;l<p;l+=1)if(u=L[l],-1!==u.toLowerCase().indexOf(a.toLowerCase())){k=[];var t=0;for(d=u.length;t<d;t+=1)0===u.slice(t).toLowerCase().indexOf(a.toLowerCase())&&k.push(t);n=[];t=0;for(d=u.length;t<d;t+=1)"/"===u[t]&&n.push(t);t=0;for(d=k.length;t<d;t+=1)if(0===n.length)r=u;else{n.push(k[t]);n.sort(f);var w=0;for(e=n.length;w<e;w+=1)if(n[w]===k[t]){var q=w;break}r=0===q?u.slice(0,n[1]):q===n.length-1?u.slice(n[n.length-2]+1):u.slice(n[q-1]+1,n[q+1]);n.splice(q,1);r=J(r);-1!==r.indexOf("_")&&(r=r.slicePriorToX("_"));
-1===$.inArray(r,m)&&m.push(r)}}l=0;for(c=m.length;l<c;l+=1)g.jstree("open_node",$("#"+m[l]+"_Root"));g.jstree("close_all");g.jstree("search",h)}catch(y){}r=b=g=h=d=t=c=l=null;m=[];q=u=null;k=[];n=[]}}function $a(){$("#ChipType").hide();$("#MCU").hide();$("#panel").css("overflow","hidden");$("#ChipType").css("border","white");$("#MCU").css("border","white")}function Ea(){var a=$("#panel").height(),f=$("#NUC_PinConfiguration_Canvas").height();Qa?a<f?(z=10*Math.floor(a/f*100/10)-5,0<Ja&&z<Ja&&(z=Ja),
kb=z,va()):kb=100:(z=Ja=100,va())}function Eb(){$(document).mousedown(function(a){a=a||window.event;a=(a.target||a.srcElement).id;if("panel"===a||"NUC_PinConfiguration_Canvas"===a)return!1;"ChipTypeSelect"===a&&Sa(function(){$("#ChipTypeSelect").focus()});"MCUselect"===a&&Sa(function(){$("#MCUselect").focus()});"searchInput_Pin"===a&&$("#searchInput_Pin").val("");a=0;return this})}function fa(a,f,c){ta();"Simplified Chinese"===P?window.alert(a):"Traditional Chinese"===P?window.alert(f):window.alert(c)}
function Fb(){var a=!0;Yb(NUTOOL_PIN.g_readConfigFilePath)||(a=!1);NUTOOL_PIN.decidepackageNumber();p=parseInt(NUTOOL_PIN.g_packageNumber.slice(NUTOOL_PIN.g_packageNumber.indexOf(NUTOOL_PIN.g_packageNumber.match(/\d/))),10);33===p&&(p=32);return a}function Gb(){var a=!1;!1===jQuery.support.leadingWhitespace?(Y=!0,Ja=25,fb=.5,ab="\f",$("#panel").scroll(function(){$(this).css("border","3px solid white")}),Q.getContext=function(a){G_vmlCanvasManager.initElement(a);return a.getContext("2d")},Q.removeContext=
function(a){"undefined"!==typeof a[0]&&(G_vmlCanvasManager.uninitElement(a[0]),a.remove())},Q.addEvent=function(a,d,f){a.attachEvent("on"+d,f)}):(Y=!1,Ja=30,O=2,fb=.95,ab="\f",Q.getContext=function(a){return a.getContext("2d")},Q.removeContext=function(a){a.remove()},Q.addEvent=function(a,d,f){a.addEventListener(d,f,!1)});if($("html").hasClass("ie7")||$("html").hasClass("ie6")){a=!0;var f=$('<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:-500px;"/></div>');
f.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 ta(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:")?(P=a.sliceAfterX("UIlanguage:"),P=P.slicePriorToX("\r")):P="English"}function Hb(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("DisplayTooltip:")?
(Ka=a.sliceAfterX("DisplayTooltip:"),Ka=Ka.slicePriorToX("\r"),Na="No"===Ka?!1:!0):(Ka="Yes",Na=!0)}function Ib(){var a=document.body,f=function(a){a=a?a:window.event;if(a.ctrlKey)return a.preventDefault?a.preventDefault():a.returnValue=!1,!1};$("#panel").mousewheel(function(a){!0===window.external.getCtrlState()&&(0<a.deltaY?Jb():0>a.deltaY&&Kb())});a.addEventListener?(a.addEventListener("DOMMouseScroll",f,!1),a.addEventListener("mousewheel",f,!1)):a.onmousewheel=f}function lb(){var a,f,c=0,d=0,
e=0,g=0;0===$("#NUC_PinConfiguration_Canvas").length&&$("#panel")[0].appendChild(oa("canvas","NUC_PinConfiguration_Canvas"));var b=$("#NUC_PinConfiguration_Canvas")[0];var h=Q.getContext(b);h.font="12px Arial";if(-1===G.indexOf("SOP")){b=0;for(f=p/4;b<f;b+=1){var m="";var k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b];var n=k+":0";var u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[u].f.length-1;0<=a;--a)m+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),
0!==a&&(m+="/");break}""===m&&(m=k);L[b]=m;var w="";k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b+p/4];n=k+":0";u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){a=0;for(n=NUTOOL_PIN.g_cfg_gpios[u].f.length;a<n;a+=1)w+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[u].f.length-1&&(w+="/");break}""===w&&(w=k);L[b+p/4]=w;var r="";k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b+p/2];n=k+":0";u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<
a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){a=0;for(n=NUTOOL_PIN.g_cfg_gpios[u].f.length;a<n;a+=1)r+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[u].f.length-1&&(r+="/");break}""===r&&(r=k);L[b+p/2]=r;var t="";k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b+p/4*3];n=k+":0";u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[u].f.length-1;0<=a;--a)t+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),
0!==a&&(t+="/");break}""===t&&(t=k);L[b+p/4*3]=t;ba&&(h.measureText(t).width>c&&(c=h.measureText(t).width),h.measureText(m).width>d&&(d=h.measureText(m).width),h.measureText(w).width>e&&(e=h.measureText(w).width),h.measureText(r).width>g&&(g=h.measureText(r).width))}l=p/4*(16+O)-O+40}else{b=0;for(f=p/2;b<f;b+=1){t="";k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b];n=k+":0";u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){for(a=NUTOOL_PIN.g_cfg_gpios[u].f.length-
1;0<=a;--a)t+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),0!==a&&(t+="/");break}""===t&&(t=k);L[b]=t;w="";k=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b+p/2];n=k+":0";u=0;for(a=NUTOOL_PIN.g_cfg_gpios.length;u<a;u+=1)if(n===NUTOOL_PIN.g_cfg_gpios[u].f[0]){a=0;for(n=NUTOOL_PIN.g_cfg_gpios[u].f.length;a<n;a+=1)w+=NUTOOL_PIN.g_cfg_gpios[u].f[a].slicePriorToX(":"),a!==NUTOOL_PIN.g_cfg_gpios[u].f.length-1&&(w+="/");break}""===w&&(w=k);L[b+p/2]=w;ba&&(h.measureText(t).width>c&&(c=h.measureText(t).width),
h.measureText(w).width>e&&(e=h.measureText(w).width))}l=p/2*(16+O)-O+40}ba?(130>c&&(c=130),130>g&&(g=130),E=c+40+l/4,F=g+40+l/4):F=E=195;ba?(na=E+l+e+40+l/4,za=F+l+d+40+l/4):(na=E+l+40+25+130,za=F+l+40+25+130);Qa?(c=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText,"undefined"!==typeof c&&-1!==c.indexOf("DialogSize:")?(c=c.sliceAfterX("DialogSize:X_"),ja=parseInt(c.slicePriorToX("Y_"),10),ea=parseInt(c.slice(c.indexOf("Y_")+2,c.indexOf("\r")),10),792>ja&&(ja=792),590>ea&&(ea=590)):(ja=792,ea=
590)):(ja=screen.availWidth,ea=screen.availHeight);ha=ea-10}function mb(){var a;var f=0;for(a=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;f<a;f+=1)da[f]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][f],C[f]=""}function Cb(){"NUC400"===k&&"undefined"!==typeof A.GPG_MFPH?qa("GPG_MFPH:0x00001100"):"M451HD"!==k&&"M451LD"!==k&&"M4521"!==k||"undefined"===typeof A.GPF_MFPL?"M480"!==k&&"M480LD"!==k&&"M251"!==k&&"M261"!==k&&"M2351"!==k&&"M031"!==k||"undefined"===typeof A.GPF_MFPL?
"NUC121AE"===k&&"undefined"!==typeof A.GPF_MFPL?qa("GPF_MFPL:0x00110011"):"NANO100AN"!==k&&"NANO100BN"!==k||"undefined"===typeof A.PF_L_MFP?"NANO112"===k&&"undefined"!==typeof A.PF_L_MFP?qa("PF_L_MFP:0x00FFFFFF"):"NUC123AE"===k&&"undefined"!==typeof A.GPF_MFPL?qa("GPF_MFPL:0x00001100"):"NANO103"===k&&"undefined"!==typeof A.GPF_MFPL?qa("GPF_MFPL:0x77777777"):"M051AN"!==k&&"M051BN"!==k&&"M051DN_DE"!==k&&"M058S"!==k&&"MINI51AN"!==k&&"MINI51DE"!==k&&"MINI55"!==k&&"MINI58"!==k&&"NUC029AE"!==k&&"NUC029TAE"!==
k&&"NUC029AN"!==k&&"NM1200"!==k||"undefined"===typeof A.P4_MFP?$("#moduleTree").jstree("check_node",$("#ICE_Root")):qa("P4_MFP:0x000000C0"):qa("PF_L_MFP:0x00007777"):qa("GPF_MFPL:0x000000EE"):qa("GPF_MFPL:0x01100000")}function nb(a){-1===a.indexOf("(")&&(a+="(");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("M48")?-1!==a.indexOf("8AE")||-1!==a.indexOf("CAE")?"M480LD":"M480":0===a.indexOf("M251")||0===a.indexOf("M252")?"M251":0===a.indexOf("M26")?"M261":0===a.indexOf("M235")?"M2351":0===a.indexOf("M031")||0===a.indexOf("M032")?"M031":0===a.indexOf("M0518")?"M0518":0===a.indexOf("ML51")?"ML51":0!==a.indexOf("MS51")||-1===a.indexOf("C0AE(")&&-1===a.indexOf("C0BE(")?0!==a.indexOf("MS51")||-1===a.indexOf("B9AE(")&&-1===a.indexOf("B9BE(")?0===a.indexOf("MS51")&&
-1!==a.indexOf("A9AE(")?"MS51_8K":0===a.indexOf("M0519")?"M0519":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("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("NUC13")?"NUC131":0===a.indexOf("NUC1261")?"NUC1261":0===a.indexOf("NUC126")?"NUC126":0===a.indexOf("NUC505")?"NUC505":0===a.indexOf("I91")?"ISD9100":0===a.indexOf("I93")?"ISD9300":"NUC400":"NUC100AN_BN":"NUC123AE":"NUC123AN":"NANO100BN":"NANO100AN":"M051DN_DE":"MS51_16K":"MS51_32K";return a}function Yb(a){var f,c=!1,d="",e="",g=!1,b=[],h=[];K="";var m=a=$.ajax({url:""===a?"Nu_config.cfg ":"file:///"+
a,async:!1}).responseText;if(!a||/^\s*$/.test(a))return K=a,"undefined"!==typeof k&&"NUC400"!==k&&(d="NUC_"+k+"_Content.js",Fa(d,"NUC_NUC400_Content.js","js")),G="NUC472VI8AE(LQFP100)",k="NUC400",c;for(;-1!==a.indexOf("\r")&&a.indexOf("\r")<a.indexOf("MCU:");)a=a.sliceAfterX("\r");var v=a.sliceBetweenXandX("MCU:","\r");v=v.trim();var n=nb(v);if(-1===$.inArray(bb(n),ob))return fa("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u82af\u7247\u578b\u53f7 "+n+" \u4e0d\u6b63\u786e\u3002","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u6676\u7247\u578b\u865f "+
n+" \u4e0d\u6b63\u78ba\u3002","The chip type of "+n+" read from the config file is incorrect."),null;"undefined"!==typeof k?(d="NUC_"+k+"_Content.js",e="NUC_"+n+"_Content.js",Fa(d,e,"js")):"undefined"===typeof k&&(d="NUC_NUC400_Content.js",e="NUC_"+n+"_Content.js",Fa(d,e,"js"));var u=0;for(f=NUTOOL_PIN.g_cfg_chips.length;u<f;u+=1)if(NUTOOL_PIN.g_cfg_chips[u].name+"("+NUTOOL_PIN.g_cfg_chips[u].pkg+")"===v){c=!0;break}if(c){if("undefined"!==typeof G)var l=G;else l="NUC472VI8AE(LQFP100)",k="NUC400";
G=v;NUTOOL_PIN.decidepackageNumber();u=0;for(f=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;u<f;u+=1){var r=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][u];"undefined"!==typeof r&&0===r.indexOf("P")&&2===r.indexOf(".")&&b.push(r)}if("M451HD"===n||"M451LD"===n||"M4521"===n||"NUC121AE"===n||"M0564"===n||"M05641"===n||"NUC126"===n||"NUC1261"===n||"NUC029xGE"===n||"NUC029KGE"===n||"NUC400"===n||"M480"===n||"M480LD"===n||"M251"===n||"M261"===n||"M2351"===n||"M031"===n||"NANO103"===
n||"NUC505"===n||"NUC123AE"===n)for(u=0,f=b.length;u<f;u+=1)r=8>parseInt(b[u].sliceAfterX("."),10)?"G"+b[u].slicePriorToX(".")+"_MFPL":"G"+b[u].slicePriorToX(".")+"_MFPH",-1===$.inArray(r,h)&&h.push(r);else if("NANO100AN"===n||"NANO100BN"===n||"NANO112"===n)for(u=0,f=b.length;u<f;u+=1)r=8>parseInt(b[u].sliceAfterX("."),10)?b[u].slicePriorToX(".")+"_L_MFP":b[u].slicePriorToX(".")+"_H_MFP",-1===$.inArray(r,h)&&h.push(r);else if("NM1500"===n||"M0519"===n||"M051DN_DE"===n||"M051BN"===n||"M051AN"===n||
"M058S"===n||"MINI51AN"===n||"MINI51DE"===n||"MINI55"===n||"MINI58"===n||"NUC029AE"===n||"NUC029TAE"===n||"NUC029AN"===n||"NM1200"===n)for(u=0,f=b.length;u<f;u+=1)r=b[u].slicePriorToX(".")+"_MFP",-1===$.inArray(r,h)&&h.push(r);else if("ML51"===n||0===n.indexOf("MS51"))for(u=0,f=b.length;u<f;u+=1)r=b[u].slicePriorToX(".")+"MF76543210",-1===$.inArray(r,h)&&h.push(r);else for(u=0,f=b.length;u<f;u+=1)r="G"+b[u].slicePriorToX(".")+"_MFP",-1===$.inArray(r,h)&&h.push(r);if("NUC200AE"===n||"NUC100DN"===n)h.push("ALT_MFP"),
h.push("ALT_MFP1"),h.push("ALT_MFP2");else if("NUC123AN"===n||"NUC200AN"===n)h.push("ALT_MFP"),h.push("ALT_MFP1");else if("NUC2201"===n||"NUC029xEE"===n)h.push("ALT_MFP"),h.push("ALT_MFP2");else if("NUC122AN"===n||"NUC100AN_BN"===n||"NUC100CN"===n)h.push("ALT_MFP");else if("NUC131"===n||"M0518"===n||"NUC029xDE"===n)h.push("ALT_MFP"),h.push("ALT_MFP2"),h.push("ALT_MFP3"),h.push("ALT_MFP4");else if("MINI55"===n||"NM1200"===n)h.push("ADCHER"),h.push("ADCR"),h.push("PIN_SEL");u=0;for(f=h.length;u<f;u+=
1)if(-1===a.indexOf(h[u])){r=h[u];g=!0;G=l;break}for(;-1!==a.indexOf("SYS->GP");){b=a.slice(a.indexOf("SYS->GP")+5);-1!==b.indexOf(" = ")&&(b=b.slicePriorToX(" = "));if(-1===$.inArray(b,h)){G=l;break}a=a.slice(1)}}if(c)if(g)fa("\u5728\u914d\u7f6e\u6863\u91cc\u627e\u4e0d\u5230\u5fc5\u9700\u7684MFP\u6682\u5b58\u5668 "+r+"\u3002","\u5728\u914d\u7f6e\u6a94\u88e1\u627e\u4e0d\u5230\u5fc5\u9700\u7684MFP\u66ab\u5b58\u5668 "+r+"\u3002","The prerequisite MFP register of "+r+" is missing in the config file."),
""!==e&&""!==d&&Fa(e,d,"js"),c=!1;else{if(K=m,G=v,k=n,$("#ChipTypeSelect").val(bb(k)),d=e=K,""!==e&&"undefined"!==typeof e){for(R=[];-1!==e.indexOf("GPIOpin:");)e=e.slice(e.indexOf("GPIOpin:")),g=e.slice(e.indexOf("GPIOpin:")+8,e.indexOf("\r")),h=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][parseInt(g,10)],0===h.indexOf("P")&&2===h.indexOf(".")&&("undefined"===typeof R?R[0]=parseInt(g,10):R.push(parseInt(g,10))),e=e.slice(1);for(e=d;-1!==e.indexOf("SYS->");)e=e.sliceAfterX("SYS->"),g=e.slice(e.indexOf(" = ")+
3,e.indexOf("\r")),isNaN(parseInt(g.slice(2),16))?fa("\u6682\u5b58\u5668\u7684\u503c"+e.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"+e.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u932f\u8aa4\uff0c\u8acb\u66f4\u6b63\u5b83\u4e26\u91cd\u8f09\u914d\u7f6e\u6a94\u3002","The register value of "+e.slicePriorToX("\r")+" in the config file is incorrect.Please correct it and re-load the config file again."):
U[e.slicePriorToX(" = ")]=parseInt(g.slice(2),16),e=e.slice(1);for(e=d;-1!==e.indexOf("ALT_MFP");)e=e.slice(e.indexOf("ALT_MFP")),g=e.slice(e.indexOf(" = ")+3,e.indexOf("\r")),isNaN(parseInt(g.slice(2),16))?fa("\u6682\u5b58\u5668\u7684\u503c"+e.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"+e.slicePriorToX("\r")+"\u5b58\u5728\u4e00\u4e9b\u932f\u8aa4\uff0c\u8acb\u66f4\u6b63\u5b83\u4e26\u91cd\u8f09\u914d\u7f6e\u6a94\u3002",
"The register value of "+e.slicePriorToX("\r")+" in the config file is incorrect.Please correct it and re-load the config file again."):U[e.slicePriorToX(" = ")]=parseInt(g.slice(2),16),e=e.slice(1)}}else fa("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u5c01\u88c5\u540d\u79f0 "+v+" \u4e0d\u6b63\u786e","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u5c01\u88dd\u540d\u7a31 "+v+" \u4e0d\u6b63\u78ba\u3002","The package name "+v+" read from the config file is incorrect."),""!==e&&""!==d&&Fa(e,d,"js"),G="NUC472VI8AE(LQFP100)";
return c}function pb(){var a=[],f=[],c;var d=0;for(c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex].length;d<c;d+=1){var e=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d];"undefined"!==typeof e&&0===e.indexOf("P")&&2===e.indexOf(".")&&a.push(e)}if("M451HD"===k||"M451LD"===k||"M4521"===k||"NUC121AE"===k||"M0564"===k||"M05641"===k||"NUC126"===k||"NUC1261"===k||"NUC029xGE"===k||"NUC029KGE"===k||"NUC400"===k||"M480"===k||"M480LD"===k||"M251"===k||"M261"===k||"M2351"===k||"M031"===k||
"NANO103"===k||"NUC505"===k||"NUC123AE"===k)for(d=0,c=a.length;d<c;d+=1)e=8>parseInt(a[d].sliceAfterX("."),10)?"G"+a[d].slicePriorToX(".")+"_MFPL":"G"+a[d].slicePriorToX(".")+"_MFPH",-1===$.inArray(e,f)&&f.push(e);else if("NANO100AN"===k||"NANO100BN"===k||"NANO112"===k)for(d=0,c=a.length;d<c;d+=1)e=8>parseInt(a[d].sliceAfterX("."),10)?a[d].slicePriorToX(".")+"_L_MFP":a[d].slicePriorToX(".")+"_H_MFP",-1===$.inArray(e,f)&&f.push(e);else if("NM1500"===k||"M0519"===k||"M051DN_DE"===k||"M051BN"===k||"M051AN"===
k||"M058S"===k||"MINI51AN"===k||"MINI51DE"===k||"MINI55"===k||"MINI58"===k||"NUC029AE"===k||"NUC029TAE"===k||"NUC029AN"===k||"NM1200"===k)for(d=0,c=a.length;d<c;d+=1)e=a[d].slicePriorToX(".")+"_MFP",-1===$.inArray(e,f)&&f.push(e);else if("ML51"===k||0===k.indexOf("MS51"))for(d=0,c=a.length;d<c;d+=1)e=a[d].slicePriorToX(".")+"MF76543210",-1===$.inArray(e,f)&&f.push(e);else for(d=0,c=a.length;d<c;d+=1)e="G"+a[d].slicePriorToX(".")+"_MFP",-1===$.inArray(e,f)&&f.push(e);d=0;for(c=f.length;d<c;d+=1)A[f[d]]=
0;if("NUC200AE"===k||"NUC100DN"===k)A.ALT_MFP=0,A.ALT_MFP1=0,A.ALT_MFP2=0;else if("NUC123AN"===k||"NUC200AN"===k)A.ALT_MFP=0,A.ALT_MFP1=0;else if("NUC2201"===k||"NUC029xEE"===k)A.ALT_MFP=0,A.ALT_MFP2=0;else if("NUC122AN"===k||"NUC100AN_BN"===k||"NUC100CN"===k)A.ALT_MFP=0;else if("NUC131"===k||"M0518"===k||"NUC029xDE"===k)A.ALT_MFP=0,A.ALT_MFP2=0,A.ALT_MFP3=0,A.ALT_MFP4=0;else if("MINI55"===k||"NM1200"===k)A.ADCHER=0,A.ADCR=0,A.PIN_SEL=0}function qb(a,f){var c,d;if("NUC400"===k||"M451HD"===k||"M451LD"===
k||"M4521"===k||"NUC505"===k||"NUC121AE"===k||"NUC123AE"===k||"NANO103"===k||"M480"===k||"M480LD"===k||"M251"===k||"M261"===k||"M2351"===k||"M031"===k||"M0564"===k||"M05641"===k||"NUC126"===k||"NUC1261"===k||"NUC029xGE"===k||"NUC029KGE"===k){var e=a.slice(0,2);var g=parseInt(a.slice(3),10);8>g&&(c=!0);if(c){e="G"+e+"_MFPL";var b=(A[e]&~(15<<4*g>>>0))>>>0;A[e]=(b|f<<4*g>>>0)>>>0}else e="G"+e+"_MFPH",b=(A[e]&~(15<<4*g>>>0))>>>0,A[e]=(b|f<<4*(g-8)>>>0)>>>0}else if("MINI57"===k||"NM1120"===k||"NDA102"===
k)e=a.slice(0,2),g=parseInt(a.slice(3),10),e="G"+e+"_MFP",b=(A[e]&~(15<<4*g>>>0))>>>0,A[e]=(b|f<<4*g>>>0)>>>0;else if("NANO100AN"===k||"NANO100BN"===k||"NANO112"===k)e=a.slice(0,2),g=parseInt(a.slice(3),10),8>g&&(c=!0),c?(e+="_L_MFP",b=(A[e]&~(15<<4*g>>>0))>>>0,A[e]=(b|f<<4*g>>>0)>>>0):(e+="_H_MFP",b=(A[e]&~(15<<4*g>>>0))>>>0,A[e]=(b|f<<4*(g-8)>>>0)>>>0);else if("ML51"===k||0===k.indexOf("MS51"))e=a.slice(0,2),g=parseInt(a.slice(3),10),e+="MF76543210",b=(A[e]&~(15<<4*g>>>0))>>>0,A[e]=(b|f<<4*g>>>
0)>>>0;else if("ISD9100"===k||"ISD9300"===k)e=a.slice(0,2),g=parseInt(a.slice(3),10),e="G"+e+"_MFP",b=(A[e]&~(3<<2*g>>>0))>>>0,A[e]=(b|f<<2*g>>>0)>>>0;else if("MINI55"===k||"NM1200"===k){g=0;for(e=NUTOOL_PIN.g_cfg_gpioMatrix.length;g<e;g+=1)if(a===NUTOOL_PIN.g_cfg_gpioMatrix[g].f[0]){c=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[g].f.length;c<d;c+=1){var h=NUTOOL_PIN.g_cfg_gpioMatrix[g].f[c];e=h.slicePriorToX("[");b=parseInt(h.slice(h.indexOf("[")+1,h.indexOf("]")),10);var m=parseInt(h.sliceAfterX(":"),10);
var v=1<<b>>>0;h=0;f&1<<m&&(h=1<<b>>>0);b=(A[e]&~v)>>>0;A[e]=(b|h)>>>0}break}"P3.2"===a&&1===f&&(A.PIN_SEL=0)}else for(g=0,e=NUTOOL_PIN.g_cfg_gpioMatrix.length;g<e;g+=1)if(a===NUTOOL_PIN.g_cfg_gpioMatrix[g].f[0]){c=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[g].f.length;c<d;c+=1)h=NUTOOL_PIN.g_cfg_gpioMatrix[g].f[c],e=h.slicePriorToX("["),b=parseInt(h.slice(h.indexOf("[")+1,h.indexOf("]")),10),m=parseInt(h.sliceAfterX(":"),10),v=1<<b>>>0,h=0,f&1<<m&&(h=1<<b>>>0),b=(A[e]&~v)>>>0,A[e]=(b|h)>>>0;break}}function ua(a,
f){a=a.replace("GP","P");return"NM1500"===k||"M0519"===k||"M051DN_DE"===k||"M051BN"===k||"M051AN"===k||"M058S"===k||"MINI51AN"===k||"MINI51DE"===k||"MINI55"===k||"MINI58"===k||"NUC029AE"===k||"NUC029TAE"===k||"NUC029AN"===k||"NM1200"===k?8*parseInt(a.slice(1,2),16)+parseInt(a.slice(3),10):"ML51"===k||0===k.indexOf("MS51")?8*parseInt(a.slice(1,2),16)+f:"MINI57"===k||"NM1120"===k||"NDA102"===k?8*(a.slice(1,2).charCodeAt(0)-65)+f:16*(a.slice(1,2).charCodeAt(0)-65)+f}function qa(a){var f,c,d,e,g,b=$("#moduleTree");
var h=e=parseInt(a.toLowerCase().slice(a.indexOf("0x")+2),16);if("NUC400"===k||"M451HD"===k||"M451LD"===k||"M4521"===k||"NANO100AN"===k||"NANO100BN"===k||"NANO112"===k||"NUC505"===k||"NUC121AE"===k||"NUC123AE"===k||"NANO103"===k||"M480"===k||"M480LD"===k||"M251"===k||"M261"===k||"M2351"===k||"M031"===k||"M0564"===k||"M05641"===k||"NUC126"===k||"NUC1261"===k||"NUC029xGE"===k||"NUC029KGE"===k||"MINI57"===k||"NM1120"===k||"NDA102"===k){var m=-1!==a.indexOf("MFPH")||-1!==a.indexOf("_H_MFP")?!1:!0;for(f=
0;8>f;f+=1){var v=15<<4*f>>>0;if(g=(e&v)>>>4*f>>>0){var n=m?f:f+8;var u="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+n.toString();var l=$.inArray(u,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);if(-1!==l){var r="";var t=ua(a,n);n=1;for(c=NUTOOL_PIN.g_cfg_gpios[t].f.length;n<c;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[t].f[n].indexOf(":"+g)){r=NUTOOL_PIN.g_cfg_gpios[t].f[n];r=r.slicePriorToX(":");break}if(""===r){h&=~v;continue}g=r;g=J(g);r=r.replaceSpecialCharacters();-1!==g.indexOf("_")&&
(g=g.slicePriorToX("_"));b.jstree("check_node",$("#"+r+"_Pin"+(l+1)));$("#"+r+"_Pin"+(l+1)).hasClass("jstree-checked")||(b.jstree("open_node",$("#"+g+"_Root")),b.jstree("open_node",$("#"+r+"_Intermediate")),b.jstree("check_node",$("#"+r+"_Pin"+(l+1))))}else h&=~v}e&=~v;if(0===e)break}}else if("ML51"===k||0===k.indexOf("MS51"))for(f=0;8>f;f+=1){v=15<<4*f>>>0;if(g=(e&v)>>>4*f>>>0)if(n=f,u="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+n.toString(),l=$.inArray(u,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),
-1!==l){r="";t=ua(a,n);n=1;for(c=NUTOOL_PIN.g_cfg_gpios[t].f.length;n<c;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[t].f[n].indexOf(":"+g)){r=NUTOOL_PIN.g_cfg_gpios[t].f[n];r=r.slicePriorToX(":");break}if(""===r){h&=~v;continue}g=r;g=J(g);r=r.replaceSpecialCharacters();-1!==g.indexOf("_")&&(g=g.slicePriorToX("_"));b.jstree("check_node",$("#"+r+"_Pin"+(l+1)));$("#"+r+"_Pin"+(l+1)).hasClass("jstree-checked")||(b.jstree("open_node",$("#"+g+"_Root")),b.jstree("open_node",$("#"+r+"_Intermediate")),b.jstree("check_node",
$("#"+r+"_Pin"+(l+1))))}else h&=~v;e&=~v;if(0===e)break}else if("ISD9100"===k||"ISD9300"===k)for(f=0;16>f;f+=1){v=3<<2*f>>>0;if(g=(e&v)>>>2*f>>>0)if(n=f,u="P"+a.slice(a.indexOf("P")+1,a.indexOf("P")+2)+"."+n.toString(),l=$.inArray(u,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]),-1!==l){t=ua(a,n);r="";n=1;for(c=NUTOOL_PIN.g_cfg_gpios[t].f.length;n<c;n+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[t].f[n].indexOf(":"+g)){r=NUTOOL_PIN.g_cfg_gpios[t].f[n];r=r.slicePriorToX(":");break}if(""===r){h&=~v;continue}g=
r;g=J(g);r=r.replaceSpecialCharacters();-1!==g.indexOf("_")&&(g=g.slicePriorToX("_"));b.jstree("check_node",$("#"+r+"_Pin"+(l+1)));$("#"+r+"_Pin"+(l+1)).hasClass("jstree-checked")||(b.jstree("open_node",$("#"+g+"_Root")),b.jstree("open_node",$("#"+r+"_Intermediate")),b.jstree("check_node",$("#"+r+"_Pin"+(l+1))))}else h&=~v;e&=~v;if(0===e)break}else for(f=0;32>f;f+=1){v=1<<f>>>0;g=(e&v)>>>f>>>0;l=-1;if(g){var p=a.slice(a.indexOf("P"),a.indexOf(":"))+"["+f+"]";n=0;for(c=NUTOOL_PIN.g_cfg_gpioMatrix.length;n<
c;n+=1){m=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;m<d;m+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[n].f[m].indexOf(p)){u=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[0];l=$.inArray(u,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==l){g=0;m=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;m<d;m+=1)r=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[m],t=parseInt(r.slice(r.indexOf("[")+1,r.indexOf("]")),10),v=1<<t>>>0,r.slicePriorToX("["),g+=((e&v)>>>t)*Math.pow(2,m-1),e&=~v;t=8*parseInt(u.slice(1,2),16)+
parseInt(u.slice(3),10);r="";m=1;for(d=NUTOOL_PIN.g_cfg_gpios[t].f.length;m<d;m+=1)if(-1!==NUTOOL_PIN.g_cfg_gpios[t].f[m].indexOf(":"+g)){r=NUTOOL_PIN.g_cfg_gpios[t].f[m];r=r.slicePriorToX(":");break}if(""===r)for(m=1,d=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;m<d;m+=1)r=NUTOOL_PIN.g_cfg_gpioMatrix[n].f[m],t=parseInt(r.slice(r.indexOf("[")+1,r.indexOf("]")),10),v=1<<t>>>0,h&=~v;else{g=r;g=J(g);r=r.replaceSpecialCharacters();-1!==g.indexOf("_")&&(g=g.slicePriorToX("_"));b.jstree("check_node",$("#"+
r+"_Pin"+(l+1)));$("#"+r+"_Pin"+(l+1)).hasClass("jstree-checked")||(b.jstree("open_node",$("#"+g+"_Root")),b.jstree("open_node",$("#"+r+"_Intermediate")),b.jstree("check_node",$("#"+r+"_Pin"+(l+1))));break}}}-1===l&&(h&=~v)}if(0===e)break}return a=a.slice(0,a.indexOf("0x")+2)+wa(h)}function Lb(a){var f,c,d,e=parseInt(a.toLowerCase().slice(a.indexOf("0x")+2),16),g=[];if("NUC400"===k||"M451HD"===k||"M451LD"===k||"M4521"===k||"NANO100AN"===k||"NANO100BN"===k||"NANO112"===k||"NUC505"===k||"NUC121AE"===
k||"NUC123AE"===k||"NANO103"===k||"M480"===k||"M480LD"===k||"M251"===k||"M261"===k||"M2351"===k||"M031"===k||"M0564"===k||"M05641"===k||"NUC126"===k||"NUC1261"===k||"NUC029xGE"===k||"NUC029KGE"===k||"MINI57"===k||"NM1120"===k||"NDA102"===k)for(e=-1!==a.indexOf("MFPH")||-1!==a.indexOf("_H_MFP")?!1:!0,f=0;8>f;f+=1){var b=e?f:f+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&&""!==C[b]){var h=C[b]+"_Pin"+
(b+1);h=h.replaceSpecialCharacters();$("#moduleTree").jstree("uncheck_node",$("#"+h));if(!$("#"+h).hasClass("jstree-unchecked")){var m=J(h.slicePriorToX("_"));g[0]=b+1;xa(h,m,g);$("#"+h).addClass("jstree-unchecked");if("undefined"!==typeof w[m]){var l=0;for(c=w[m].length;l<c;l+=1)if(w[m][l]===h){w[m][l]="";break}l=0;for(c=w[m].length;l<c&&""===w[m][l];l+=1)l===c-1&&$("#"+m+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}}}else if("ML51"===k||0===k.indexOf("MS51"))for(f=0;8>
f;f+=1){if(b=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&&""!==C[b]&&(h=C[b]+"_Pin"+(b+1),h=h.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",$("#"+h)),!$("#"+h).hasClass("jstree-unchecked")&&(m=J(h.slicePriorToX("_")),g[0]=b+1,xa(h,m,g),$("#"+h).addClass("jstree-unchecked"),"undefined"!==typeof w[m]))){l=0;for(c=w[m].length;l<c;l+=1)if(w[m][l]===h){w[m][l]="";break}l=0;for(c=w[m].length;l<
c&&""===w[m][l];l+=1)l===c-1&&$("#"+m+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}else if("ISD9100"===k||"ISD9300"===k)for(f=0;16>f;f+=1){if(b=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&&""!==C[b]&&(h=C[b]+"_Pin"+(b+1),h=h.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",$("#"+h)),!$("#"+h).hasClass("jstree-unchecked")&&(m=J(h.slicePriorToX("_")),g[0]=
b+1,xa(h,m,g),$("#"+h).addClass("jstree-unchecked"),"undefined"!==typeof w[m]))){l=0;for(c=w[m].length;l<c;l+=1)if(w[m][l]===h){w[m][l]="";break}l=0;for(c=w[m].length;l<c&&""===w[m][l];l+=1)l===c-1&&$("#"+m+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}else for(f=0;32>f;f+=1){b=1<<f>>>0;var n=(e&b)>>>f>>>0;b=-1;if(n){var u=a.slice(a.indexOf("P"),a.indexOf(":"))+"["+f+"]";n=0;for(d=NUTOOL_PIN.g_cfg_gpioMatrix.length;n<d;n+=1){l=1;for(c=NUTOOL_PIN.g_cfg_gpioMatrix[n].f.length;l<
c;l+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[n].f[l].indexOf(u)){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&&""!==C[b]&&(h=C[b]+"_Pin"+(b+1),h=h.replaceSpecialCharacters(),$("#moduleTree").jstree("uncheck_node",$("#"+h)),!$("#"+h).hasClass("jstree-unchecked")&&(m=J(h.slicePriorToX("_")),g[0]=b+1,xa(h,m,g),$("#"+h).addClass("jstree-unchecked"),"undefined"!==typeof w[m]))){l=0;for(c=w[m].length;l<c;l+=1)if(w[m][l]===h){w[m][l]=
"";break}l=0;for(c=w[m].length;l<c&&""===w[m][l];l+=1)l===c-1&&$("#"+m+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}}}}function bb(a){var f=a;0===a.indexOf("NUC1")?f="NUC100":0===a.indexOf("NUC2")?f="NUC200":0===a.indexOf("NANO1")?f="NANO100":0===a.indexOf("M0518")?f="M0518":0===a.indexOf("M0519")?f="M0519":0===a.indexOf("M0564")?f="M0564":0===a.indexOf("M05")?f="M051":0===a.indexOf("MINI5")?f="MINI51":0===a.indexOf("M45")?f="M451":0===a.indexOf("M48")?f="M480":0===a.indexOf("NUC029")?
f="NUC029":0===a.indexOf("MS51")&&(f="MS51");return f}function J(a){var f,c="PA PB PC PD PE PF PG PH PI P0 P1 P2 P3 P4 P5 P6 P7 P8 P9".split(" ");"NUC400"===k?(c.push("BRAKE"),c.push("INT"),c.push("TAMPER")):"M451HD"===k?(c.push("TK"),c.push("INT"),c.push("TAMPER")):"M480"===k?(c.push("INT"),c.push("TAMPER")):"M480LD"===k?(c.push("INT"),c.push("TAMPER")):"NANO100AN"===k||"NANO100BN"===k?(c.push("ADC"),c.push("DA"),c.push("AD")):"NANO103"===k?c.push("AD"):"NANO112"===k?c.push("AD"):"NUC100AN_BN"===
k||"NUC100CN"===k||"NUC100DN"===k?(c.push("INT"),c.push("ADC"),c.push("PWM"),c.push("I2C0"),c.push("I2C1"),c.push("TM"),c.push("TXD"),c.push("RXD"),c.push("RTS"),c.push("PS2"),c.push("SPI"),c.push("SC0"),c.push("SC1"),c.push("SC2"),c.push("nWR"),c.push("I2S"),c.push("CTS"),c.push("CP"),c.push("AD")):"NUC200AE"===k||"NUC200AN"===k?(c.push("PWM"),c.push("ADC"),c.push("INT"),c.push("AD")):"NUC2201"===k||"NUC029xEE"===k?(c.push("PWM"),c.push("ADC"),c.push("INT"),c.push("AD"),c.push("nWR")):"NUC131"===
k||"M0518"===k||"NUC029xDE"===k?(c.push("ADC"),c.push("INT")):"NUC122AN"===k?c.push("PWM"):"NUC123AN"===k||"NUC123AE"===k?(c.push("ADC"),c.push("I2S")):"M051DN_DE"===k||"M051AN"===k||"M051BN"===k||"M058S"===k||"NUC029AE"===k||"NUC029TAE"===k||"NUC029AN"===k?(c.push("AD"),c.push("AIN"),c.push("SPI"),c.push("PWM"),c.push("T0"),c.push("T1"),c.push("T2"),c.push("T3"),c.push("nWR"),c.push("CTS"),c.push("RTS")):"MINI51AN"===k||"MINI51DE"===k||"MINI55"===k?(c.push("AIN"),c.push("PWM"),c.push("T0"),c.push("T1"),
c.push("T2"),c.push("T3")):"NM1200"===k?(c.push("AIN"),c.push("PWM")):"NM1500"===k?(c.push("AINA"),c.push("AINB"),c.push("PWM"),c.push("INT"),c.push("TM")):"ISD9100"!==k&&"ISD9300"!==k||c.push("CMP");if("undefined"!==typeof a){var d=0;for(f=c.length;d<f;d+=1)if(0===a.indexOf(c[d])){a=0!==a.indexOf("ADC")?c[d]:"ADC";break}}return a}function wa(a,f){var c=Number(a).toString(16);for(f="undefined"===typeof f||null===f?f=8:f;c.length<f;)c="0"+c;return c}function rb(){var a,f,c=[],d=[],e={},g=$("#mfpTree"),
b=0;c=T(A);c.sort();var h=0;for(a=c.length;h<a;h+=1)b<c[h].length&&(b=c[h].length);h=0;for(a=c.length;h<a;h+=1){var m={};var l={};var n=c[h];if(n.length<b){var u=0;for(f=b-n.length;u<f;u+=1)n+=ab}l.id=c[h];m.data=n+":0x"+wa(A[c[h]]);m.attr=l;d[h]=m}l={id:"mfp_tree"};ta();e.data="Simplified Chinese"===P?"MFP\u5bc4\u5b58\u5668":"Traditional Chinese"===P?"MFP\u6682\u5b58\u5668":"MFP Registers";e.attr=l;e.state="open";e.children=d;Ba=18*c.length+20;0===g.length&&($("#rootTree_Pin")[0].appendChild(oa("div",
"mfpTree","Loading...")),g=$("#mfpTree"),$("#ChipType").hover(function(){$(this).css("background-color","#FAFAFA");Ma()},function(){$(this).css("background-color","#FFFFFF")}),$("#MCU").hover(function(){$(this).css("background-color","#FAFAFA");Ma()},function(){$(this).css("background-color","#FFFFFF")}));g[0].setAttribute("style","background-color: #FFFFFF; float:left; width:259px; height: "+Ba+"px; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");g.hover(function(){$(this).css("background-color",
"#FAFAFA");Ma()},function(){$(this).css("background-color","#FFFFFF")});g.jstree({json_data:{data:e},themes:{theme:"default",icons:!1},core:{animation:0},plugins:["themes","json_data","ui","crrm"]}).bind("hover_node.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d=c.slicePriorToX(":"),h="";Na&&NUTOOL_PIN.g_cfg_regDescriptions.hasOwnProperty(d)&&(-1===NUTOOL_PIN.g_cfg_regDescriptions[d].indexOf("nonexistent")&&(h="Simplified Chinese"===P?"\u4f4d\u5740: ":"Traditional Chinese"===P?"\u4f4d\u5740: ":
"Address: "),h+=NUTOOL_PIN.g_cfg_regDescriptions[d],$("#"+c).simpletip({fixed:!0,offset:[60,0]}),$("#"+c).eq(0).simpletip().update(h))}).bind("dblclick.jstree",function(b){b=$(b.target).closest("li")[0].id;"undefined"===typeof A.ALT_MFP&&"MINI55"!==k&&"NM1200"!==k&&g.jstree("rename",$("#"+b));$("#"+b).eq(0).simpletip().blockShow();$("#"+b).eq(0).simpletip().hide()}).bind("rename.jstree",function(b,a){var c=a.rslt.obj.attr("id"),d=a.rslt.old_name,h=a.rslt.new_name,f=!1;"NANO100AN"===k||"NANO100BN"===
k||"NANO112"===k?8===h.slice(h.toLowerCase().indexOf("0x")+2).length&&0===h.toLowerCase().indexOf("p")&&4===h.toLowerCase().lastIndexOf("_mfp")&&8===h.toLowerCase().lastIndexOf(":0x")&&(f=!0):"NM1500"===k||"M0519"===k||"M051DN_DE"===k||"M051BN"===k||"M051AN"===k||"M058S"===k||"MINI51AN"===k||"MINI51DE"===k||"MINI55"===k||"MINI58"===k||"NUC029AE"===k||"NUC029TAE"===k||"NUC029AN"===k||"NM1200"===k?8===h.slice(h.toLowerCase().indexOf("0x")+2).length&&0===h.toLowerCase().indexOf("p")&&2===h.toLowerCase().lastIndexOf("_mfp")&&
6===h.toLowerCase().lastIndexOf(":0x")&&(f=!0):"ML51"===k||0===k.indexOf("MS51")?8===h.slice(h.toLowerCase().indexOf("0x")+2).length&&0===h.toLowerCase().lastIndexOf("p")&&2===h.toLowerCase().lastIndexOf("mf")&&12===h.toLowerCase().lastIndexOf(":0x")&&(f=!0):8!==h.slice(h.toLowerCase().indexOf("0x")+2).length||0!==h.toLowerCase().lastIndexOf("gp")||3!==h.toLowerCase().lastIndexOf("_mfp")||7!==h.toLowerCase().lastIndexOf(":0x")&&8!==h.toLowerCase().lastIndexOf(":0x")||(f=!0);f?(Lb(d),qa(h),ka()):g.jstree("rename_node",
$("#"+c),d)}).bind("destroy.jstree",function(){f=a=u=h=null;c=[];d=[];n=b=g=l=e=m=null});g.css("font-size","16px");g.css("font-family",'Monaco, Consolas, "Lucida Console", monospace;')}function ka(){var a,f,c=0;var d=T(A);var e=0;for(a=d.length;e<a;e+=1)c<d[e].length&&(c=d[e].length);e=0;for(a=d.length;e<a;e+=1){var g=d[e];if(g.length<c){var b=0;for(f=c-g.length;b<f;b+=1)g+=ab}$("#mfpTree").jstree("rename_node",$("#"+d[e]),g+":0x"+wa(A[d[e]]).toUpperCase())}}function oa(a,f,c,d){d?(d=document.createElement("input"),
d.value=c,d.type=a):(d=document.createElement(a),d.innerHTML=c);d.id=f;return d}function T(a){var f=[],c=0,d;for(d in a)a.hasOwnProperty(d)&&(f[c]=d,c+=1);return f}function Mb(){var a,f,c,d={};if("undefined"!==typeof NUTOOL_PIN.g_cfg_addGPIO&&"undefined"!==typeof NUTOOL_PIN.g_cfg_addGPIO[G]){d="function"==typeof NUTOOL_PIN.g_cfg_addGPIO[G]?NUTOOL_PIN.g_cfg_addGPIO[G]():NUTOOL_PIN.g_cfg_addGPIO[G];var e=T(d);for(a=0;a<e.length;a+=1){var g=e[a]+":0";var b=0;for(f=NUTOOL_PIN.g_cfg_gpios.length;b<f;b+=
1)if(g===NUTOOL_PIN.g_cfg_gpios[b].f[0]){var h=0;for(c=d[e[a]].length;h<c;h+=1){var m=d[e[a]][h];for(f=NUTOOL_PIN.g_cfg_gpios[b].f.length-1;0<=f;--f){g=NUTOOL_PIN.g_cfg_gpios[b].f[f];if(parseInt(g.slice(g.indexOf(":")+1),10)===parseInt(m.slice(m.indexOf(":")+1),10))break;if(parseInt(g.slice(g.indexOf(":")+1),10)<parseInt(m.slice(m.indexOf(":")+1),10)){NUTOOL_PIN.g_cfg_gpios[b].f.splice(f+1,0,m);break}}}break}}}"undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO&&"undefined"!==typeof NUTOOL_PIN.g_cfg_unusedGPIO[NUTOOL_PIN.g_packageNumberIndex]?
d="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[G]&&(d="function"==typeof NUTOOL_PIN.g_cfg_unusedGPIO[G]?NUTOOL_PIN.g_cfg_unusedGPIO[G]():NUTOOL_PIN.g_cfg_unusedGPIO[G]);e=T(d);for(a=0;a<e.length;a+=1)if("ALL"===e[a])for(b=0,f=NUTOOL_PIN.g_cfg_gpios.length;b<
f;b+=1)for(h=0,c=d[e[a]].length;h<c;h+=1)for(m=d[e[a]][h],g=NUTOOL_PIN.g_cfg_gpios[b].f.length-1;0<=g;--g)0===NUTOOL_PIN.g_cfg_gpios[b].f[g].indexOf(m)&&NUTOOL_PIN.g_cfg_gpios[b].f.splice(g,1);else if("PARTIAL"===e[a])for(b=0,f=NUTOOL_PIN.g_cfg_gpios.length;b<f;b+=1)for(h=0,c=d[e[a]].length;h<c;h+=1)for(m=d[e[a]][h],g=NUTOOL_PIN.g_cfg_gpios[b].f.length-1;0<=g;--g)NUTOOL_PIN.g_cfg_gpios[b].f[g].slicePriorToX(":")===m&&NUTOOL_PIN.g_cfg_gpios[b].f.splice(g,1);else for(g=e[a]+":0",b=0,f=NUTOOL_PIN.g_cfg_gpios.length;b<
f;b+=1)if(g===NUTOOL_PIN.g_cfg_gpios[b].f[0]){h=0;for(c=d[e[a]].length;h<c;h+=1)for(m=d[e[a]][h],g=NUTOOL_PIN.g_cfg_gpios[b].f.length-1;0<=g;--g)0===NUTOOL_PIN.g_cfg_gpios[b].f[g].indexOf(m)&&NUTOOL_PIN.g_cfg_gpios[b].f.splice(g,1);break}h=T(NUTOOL_PIN.g_cfg_regDescriptions);for(a=h.length-1;0<=a;--a)"undefined"===typeof A[h[a]]&&delete NUTOOL_PIN.g_cfg_regDescriptions[h[a]];aa=[];for(a=0;a<p;a+=1)for(g=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a]+":0",h=0,c=NUTOOL_PIN.g_cfg_gpios.length;h<
c;h+=1)if(g===NUTOOL_PIN.g_cfg_gpios[h].f[0]){f=0;for(b=NUTOOL_PIN.g_cfg_gpios[h].f.length;f<b;f+=1)m=c=NUTOOL_PIN.g_cfg_gpios[h].f[f].slicePriorToX(":"),-1!==m.indexOf("_")&&(m=m.slicePriorToX("_")),m=J(m),"undefined"===typeof aa[m]?(aa[m]=[],aa[m][0]=a+1,sa[m]=[],sa[m][0]=c):(aa[m].push(a+1),sa[m].push(c));break}}function Ma(){var a;for(a=0;a<D.length;a+=1)D[a].mouseLeave()}function Da(a,f){if(-1===G.indexOf("SOP")){var c=Math.floor((a-1)/p*4);var d=a-1-c*p/4}else c=Math.floor((a-1)/p*2),d=a-1-
c*p/2;D[c].lastPinIndex=d;D[c].savedPinPadColor[d]=f;D[c].mouseLeave()}function zb(){var a,f,c,d,e,g,b={init:function(a,c,d){b.inner=a;b.stage=c[0];b.whichSide=d;b.pin=[];b.savedPinPadColor=[];b.savedPinName=[];b.x=[];b.y=[];b.currentPinIndex=-1;b.lastPinIndex=-1;Q.addEvent(b.stage,"click",b.pinClickHandler);Q.addEvent(b.stage,"mousemove",function(a){b.mousePosition=b.getMousePos($("#NUC_PinConfiguration_Canvas")[0],a);b.decideWhichPin()});if(-1===G.indexOf("SOP")){b.oneSidePinNumber=p/4;b.pin[0]=
1+d*b.oneSidePinNumber;c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d*p/4];c="P"===c.slice(0,1)&&"."===c.slice(2,3)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=c;b.x[0]=0;b.y[0]=0;for(a=1;a<b.oneSidePinNumber;a+=1)c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a+d*p/4],c="P"===c.slice(0,1)&&"."===c.slice(2,3)?"#FFFFFF":"#9365C9",b.pin[a]=a+1+d*b.oneSidePinNumber,b.savedPinPadColor[a]=c;for(a=0;a<b.oneSidePinNumber;a+=1)b.pin[a]<=p/4?(b.x[a]=E+20+(b.pin[a]-1)*(16+O)-1,b.y[a]=F+
l):b.pin[a]>p/4&&b.pin[a]<=p/2?(b.x[a]=E+l,b.y[a]=F+l-20-16-(b.pin[a]-p/4-1)*(16+O)):b.pin[a]>p/2&&b.pin[a]<=p/4*3?(b.x[a]=E+l-20-16-(b.pin[a]-p/2-1)*(16+O)-1,b.y[a]=F-40+1):b.pin[a]>p/4*3&&b.pin[a]<=p&&(b.x[a]=E-40,b.y[a]=F+20+(b.pin[a]-p/4*3-1)*(16+O));switch(d){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;")}}else{b.oneSidePinNumber=p/2;b.pin[0]=1+d*b.oneSidePinNumber;c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][d*p/2];c="P"===c.slice(0,1)&&"."===c.slice(2,3)?"#FFFFFF":"#9365C9";b.savedPinPadColor[0]=
c;b.x[0]=0;b.y[0]=0;for(a=1;a<b.oneSidePinNumber;a+=1)c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a+d*p/2],c="P"===c.slice(0,1)&&"."===c.slice(2,3)?"#FFFFFF":"#9365C9",b.pin[a]=a+1+d*b.oneSidePinNumber,b.savedPinPadColor[a]=c;for(a=0;a<b.oneSidePinNumber;a+=1)b.pin[a]<=p/2?(b.x[a]=E-40,b.y[a]=F+20+(b.pin[a]-1)*(16+O)):(b.x[a]=E+l/2,b.y[a]=F+l-20-16-(b.pin[a]-p/2-1)*(16+O));switch(d){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;")}}b.ctx=Q.getContext(b.stage);c=c=null;return b},draw:function(){var a;b.ctx.strokeStyle="#000000";
if(-1===G.indexOf("SOP"))switch(b.whichSide){case 0:for(a=0;a<b.oneSidePinNumber;a+=1){b.ctx.strokeRect(b.x[a]-b.x[0]+10,11,b.w,b.h);b.ctx.fillStyle=b.savedPinPadColor[a];b.ctx.fillRect(b.x[a]-b.x[0]+10,11,b.w,b.h);var c=L[b.pin[a]-1];-1!==c.lastIndexOf("/")&&(c=c.slice(c.lastIndexOf("/")+1));(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+"..");b.savedPinName[a]=c;b.ctx.font="12px Arial";b.ctx.fillStyle="black";var d=b.x[a]-b.x[0]+10;var f=51;b.ctx.save();b.ctx.translate(d,
f);b.ctx.rotate(-Math.PI/2);b.ctx.fillText(c,1,12.8);b.ctx.restore()}break;case 1:for(a=0;a<b.oneSidePinNumber;a+=1)b.ctx.strokeRect(11,b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[a],b.ctx.fillRect(11,b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),c=L[b.pin[a]-1],c=c.slicePriorToX("/"),(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+".."),b.savedPinName[a]=c,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(c,11,b.y[a]-b.y[b.oneSidePinNumber-
1]+22.8);break;case 2:for(a=0;a<b.oneSidePinNumber;a+=1)b.ctx.strokeRect(b.x[a]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[a],b.ctx.fillRect(b.x[a]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h),c=L[b.pin[a]-1],c=c.slicePriorToX("/"),(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+".."),b.savedPinName[a]=c,b.ctx.font="12px Arial",b.ctx.fillStyle="black",d=b.x[a]-b.x[b.oneSidePinNumber-1]+10,f=50,b.ctx.save(),b.ctx.translate(d,f),b.ctx.rotate(-Math.PI/
2),b.ctx.textAlign="end",b.ctx.fillText(c,40,12.8),b.ctx.restore();break;case 3:for(a=0;a<b.oneSidePinNumber;a+=1)b.ctx.strokeRect(11,b.y[a]-b.y[0]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[a],b.ctx.fillRect(11,b.y[a]-b.y[0]+10,b.w,b.h),c=L[b.pin[a]-1],-1!==c.lastIndexOf("/")&&(c=c.slice(c.lastIndexOf("/")+1)),(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+".."),b.savedPinName[a]=c,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(c,11,b.y[a]-b.y[0]+22.8)}else switch(b.whichSide){case 0:for(a=
0;a<b.oneSidePinNumber;a+=1)b.ctx.strokeRect(11,b.y[a]-b.y[0]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[a],b.ctx.fillRect(11,b.y[a]-b.y[0]+10,b.w,b.h),c=L[b.pin[a]-1],-1!==c.lastIndexOf("/")&&(c=c.slice(c.lastIndexOf("/")+1)),(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+".."),b.savedPinName[a]=c,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(c,11,b.y[a]-b.y[0]+22.8);break;case 1:for(a=0;a<b.oneSidePinNumber;a+=1)b.ctx.strokeRect(11,b.y[a]-b.y[b.oneSidePinNumber-
1]+10,b.w,b.h),b.ctx.fillStyle=b.savedPinPadColor[a],b.ctx.fillRect(11,b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),c=L[b.pin[a]-1],c=c.slicePriorToX("/"),(0!==c.indexOf("P")||2!==c.indexOf("."))&&4<c.length&&(c=c.slice(0,4)+".."),b.savedPinName[a]=c,b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(c,11,b.y[a]-b.y[b.oneSidePinNumber-1]+22.8)}},restore:function(){Q.removeContext($("#"+b.inner));b=null},getMousePos:function(a,b){var c=a.getBoundingClientRect();return{x:b.clientX-c.left,
y:b.clientY-c.top}},decideWhichPin:function(){var a;for(a=0;a<b.oneSidePinNumber;a+=1){var c=b.x[a]*z/100;if(b.mousePosition.x>=c&&b.mousePosition.x<=c+b.w*z/100&&b.mousePosition.y>=b.y[a]*z/100&&b.mousePosition.y<=(b.y[a]+b.h)*z/100){b.currentPinIndex=a;break}b.currentPinIndex=-1}-1!==b.currentPinIndex?b.mouseEnter():b.mouseLeave()},mouseEnter:function(){var e;var g=0;for(e=D.length;g<e;g+=1)D[g].lastPinIndex!==b.currentPinIndex&&D[g].mouseLeave();if(b.currentPinIndex!==b.lastPinIndex){g=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b.pin[b.currentPinIndex]-
1];e=b.lastPinIndex=b.currentPinIndex;b.ctx.strokeStyle="#000000";b.ctx.fillStyle="#FC517E";if(-1===G.indexOf("SOP"))switch(b.whichSide){case 0:Y&&b.ctx.strokeRect(b.x[e]-b.x[0]+10,11,b.w,b.h);b.ctx.fillRect(b.x[e]-b.x[0]+10,11,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";var k=b.x[e]-b.x[0]+10;var l=51;b.ctx.save();b.ctx.translate(k,l);b.ctx.rotate(-Math.PI/2);b.ctx.fillText(b.savedPinName[e],1,12.8);b.ctx.restore();break;case 1:Y&&b.ctx.strokeRect(11,b.y[e]-b.y[b.oneSidePinNumber-1]+
10,b.w,b.h);b.ctx.fillRect(11,b.y[e]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[e],11,b.y[e]-b.y[b.oneSidePinNumber-1]+22.8);break;case 2:Y&&b.ctx.strokeRect(b.x[e]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillRect(b.x[e]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";k=b.x[e]-b.x[b.oneSidePinNumber-1]+10;l=50;b.ctx.save();b.ctx.translate(k,l);b.ctx.rotate(-Math.PI/2);b.ctx.textAlign=
"end";b.ctx.fillText(b.savedPinName[e],40,12.8);b.ctx.restore();break;case 3:Y&&b.ctx.strokeRect(11,b.y[e]-b.y[0]+10,b.w,b.h),b.ctx.fillRect(11,b.y[e]-b.y[0]+10,b.w,b.h),b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[e],11,b.y[e]-b.y[0]+22.8)}else switch(b.whichSide){case 0:Y&&b.ctx.strokeRect(11,b.y[e]-b.y[0]+10,b.w,b.h);b.ctx.fillRect(11,b.y[e]-b.y[0]+10,b.w,b.h);b.ctx.font="12px Arial";b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[e],11,b.y[e]-b.y[0]+22.8);
break;case 1:Y&&b.ctx.strokeRect(11,b.y[e]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillRect(11,b.y[e]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.font="12px Arial",b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[e],11,b.y[e]-b.y[b.oneSidePinNumber-1]+22.8)}if(("P"!==g.slice(0,1)||"."!==g.slice(2,3))&&"unknown"!==g){a=$("#panel")[0].appendChild(oa("canvas",b.inner+"_tooltip_pin"));if(Y){f=b.ctx.measureText(g).width;c=16;l="12px Arial";var u=c-4;e=(b.x[b.currentPinIndex]+b.w)*z/100;k=b.y[b.currentPinIndex]*
z/100}else 100>z?(f=b.ctx.measureText(g).width/z*100,c=16/z*100,l=12/z*100+"px Times Arial",u=c-5/z*100):(f=b.ctx.measureText(g).width,c=16,l="12px Arial",u=c-4),e=b.x[b.currentPinIndex]+b.w,k=b.y[b.currentPinIndex];a.setAttribute("style","z-index:2; position:absolute; left:"+e+"px; top:"+k+"px;");a.setAttribute("width",f+21);a.setAttribute("height",c);d=Q.getContext(a);d.font=l;d.strokeStyle="#000000";d.lineWidth=2;d.strokeRect(0,0,f+21,c);d.fillStyle="#FFF6C0";d.fillRect(1,1,f+21-2,c-2);d.fillStyle=
"#000000";d.fillText(g,7,u)}}},mouseLeave:function(){var a=b.lastPinIndex;if(-1!==b.lastPinIndex){b.ctx.strokeStyle="#000000";b.ctx.fillStyle=b.savedPinPadColor[a];if(-1===G.indexOf("SOP"))switch(b.whichSide){case 0:Y&&b.ctx.strokeRect(b.x[a]-b.x[0]+10,11,b.w,b.h);b.ctx.fillRect(b.x[a]-b.x[0]+10,11,b.w,b.h);b.ctx.fillStyle="black";e=b.x[a]-b.x[0]+10;g=51;b.ctx.save();b.ctx.translate(e,g);b.ctx.rotate(-Math.PI/2);b.ctx.fillText(b.savedPinName[a],1,12.8);b.ctx.restore();break;case 1:Y&&b.ctx.strokeRect(11,
b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.fillRect(11,b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h);b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[a],11,b.y[a]-b.y[b.oneSidePinNumber-1]+22.8);break;case 2:Y&&b.ctx.strokeRect(b.x[a]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillRect(b.x[a]-b.x[b.oneSidePinNumber-1]+10,10,b.w,b.h);b.ctx.fillStyle="black";e=b.x[a]-b.x[b.oneSidePinNumber-1]+10;g=50;b.ctx.save();b.ctx.translate(e,g);b.ctx.rotate(-Math.PI/2);b.ctx.textAlign="end";b.ctx.fillText(b.savedPinName[a],
40,12.8);b.ctx.restore();break;case 3:Y&&b.ctx.strokeRect(11,b.y[a]-b.y[0]+10,b.w,b.h),b.ctx.fillRect(11,b.y[a]-b.y[0]+10,b.w,b.h),b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[a],11,b.y[a]-b.y[0]+22.8)}else switch(b.whichSide){case 0:Y&&b.ctx.strokeRect(11,b.y[a]-b.y[0]+10,b.w,b.h);b.ctx.fillRect(11,b.y[a]-b.y[0]+10,b.w,b.h);b.ctx.fillStyle="black";b.ctx.fillText(b.savedPinName[a],11,b.y[a]-b.y[0]+22.8);break;case 1:Y&&b.ctx.strokeRect(11,b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillRect(11,
b.y[a]-b.y[b.oneSidePinNumber-1]+10,b.w,b.h),b.ctx.fillStyle="black",b.ctx.fillText(b.savedPinName[a],11,b.y[a]-b.y[b.oneSidePinNumber-1]+22.8)}b.lastPinIndex=-1;Q.removeContext($("#"+b.inner+"_tooltip_pin"))}},pinClickHandler:function(){var a;var c=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][b.pin[b.currentPinIndex]-1];var d=[],f=0,e=Q.getContext($("#NUC_PinConfiguration_Canvas")[0]);if(-1!==b.currentPinIndex&&(ra(),"P"===c.slice(0,1)&&"."===c.slice(2,3))){parseInt(c.sliceAfterX("."),
10);c+=":0";var g=ua(c,parseInt(c.sliceAfterX("."),10));var k=b.x[b.currentPinIndex];var l=b.y[b.currentPinIndex];c=0;for(a=NUTOOL_PIN.g_cfg_gpios[g].f.length;c<a;c+=1)d[c]=NUTOOL_PIN.g_cfg_gpios[g].f[c].slicePriorToX(":"),e.measureText(d[c]).width>f&&(f=e.measureText(d[c]).width);d.push("Reset");ya=[];c=0;for(a=d.length;c<a;c+=1)e=!Y&&100<z?l+20*c:l+20*c/z*100,g="#6495ED",c!==a-1&&d[c]===C[b.pin[b.currentPinIndex]-1]&&(g=-1!==$.inArray(b.pin[b.currentPinIndex],S)?"#FAB92D":"#41AF88"),ya[c]=Zb().init(b.pin[b.currentPinIndex],
c.toString(),d[c],f,k+b.w,e,g,!0),e=c.toString(),e=e.replaceSpecialCharacters(),$("#Pin_MultiFunction_Selection_"+e).hover(ya[c].mouseEnter,ya[c].mouseLeave),ya[c].draw()}}};return b}function ra(){var a;var f=0;for(a=ya.length;f<a;f+=1)ya[f].restore();ya=[]}function Zb(){var a,f,c,d={init:function(a,c,b,f,k,l,n,u){d.pin=a;d.label=b;d.color=n;d.inner="Pin_MultiFunction_Selection_"+c;d.stage=$("#panel")[0].appendChild(oa("canvas",d.inner));Y?(d.w=f,d.h=20,a=k*z/100,l=l*z/100,f="12px Arial",d.textYposition=
14):(a=k,100>z?(d.w=f/z*100,d.h=20/z*100,f=12/z*100+"px Times Arial",d.textYposition=14/z*100):(d.w=f,d.h=20,f="12px Arial",d.textYposition=14));d.positionX=a;d.positionY=l;d.stage.setAttribute("width",d.w+21);d.stage.setAttribute("height",d.h);d.stage.setAttribute("style","z-index:2; position:absolute; left:"+a+"px; top:"+l+"px;");d.ctx=Q.getContext(d.stage);d.ctx.font=f;(d.bInstallClickListener=u)&&Q.addEvent(d.stage,"click",d.pinMultiFunctionSelectionsClickHandler);return d},mouseEnter:function(){d.ctx.fillStyle=
"#B0C4DE";d.ctx.fillRect(1,1,d.w+21-2,d.h-2);d.ctx.fillStyle="#000000";d.ctx.fillText(d.label,7,d.textYposition);if(Na&&0<NUTOOL_PIN.g_cfg_gpiosDescriptions.length&&(0!==d.label.indexOf("P")||2!==d.label.indexOf("."))&&"Reset"!==d.label){var e=Ab(d.label,d.pin);"unknown"!==e&&(a=$("#panel")[0].appendChild(oa("canvas",d.inner+"_tooltip")),f=d.ctx.measureText(e).width,-1===G.indexOf("SOP")?d.pin>p/8&&d.pin<=5*p/8?a.setAttribute("style","z-index:2; position:absolute; left:"+(d.positionX-f-21-1)+"px; top:"+
d.positionY+"px;"):a.setAttribute("style","z-index:2; position:absolute; left:"+(d.positionX+d.w+21+1)+"px; top:"+d.positionY+"px;"):d.pin>p/2?a.setAttribute("style","z-index:2; position:absolute; left:"+(d.positionX-f-21-1)+"px; top:"+d.positionY+"px;"):a.setAttribute("style","z-index:2; position:absolute; left:"+(d.positionX+d.w+21+1)+"px; top:"+d.positionY+"px;"),a.setAttribute("width",f+21),a.setAttribute("height",d.h),c=Q.getContext(a),c.font=d.ctx.font,c.strokeStyle="#000000",c.lineWidth=2,
c.strokeRect(0,0,f+21,d.h),c.fillStyle="#FFF6C0",c.fillRect(1,1,f+21-2,d.h-2),c.fillStyle="#000000",c.fillText(e,7,d.textYposition))}},mouseLeave:function(){d.ctx.fillStyle=d.color;d.ctx.fillRect(1,1,d.w+21-2,d.h-2);d.ctx.fillStyle="#000000";d.ctx.fillText(d.label,7,d.textYposition);Q.removeContext($("#"+d.inner+"_tooltip"))},draw:function(){d.ctx.strokeStyle="#000000";d.ctx.strokeRect(0,0,d.w+21,d.h);d.ctx.fillStyle=d.color;d.ctx.fillRect(1,1,d.w+21-2,d.h-2);d.ctx.fillStyle="#000000";d.ctx.fillText(d.label,
7,d.textYposition)},restore:function(){Q.removeContext($("#"+d.inner+"_tooltip"));Q.removeContext($("#"+d.inner));ia();d=null},pinMultiFunctionSelectionsClickHandler:function(){var a;Ma();if("Reset"===d.label){if(0!==S.length){var c=0;for(a=S.length;c<a;c+=1)S[c]===d.pin&&S.splice(c,1)}var b=C[d.pin-1]+"_Pin"+d.pin;b=b.replaceSpecialCharacters();$("#moduleTree").jstree("uncheck_node",$("#"+b));if(!$("#"+b).hasClass("jstree-unchecked")){var f=J(b.slicePriorToX("_"));c=[];c[0]=d.pin;xa(b,f,c);ka();
if("undefined"!==typeof w[f]){c=0;for(a=w[f].length;c<a;c+=1)if(w[f][c]===b){w[f][c]="";break}c=0;for(a=w[f].length;c<a&&""===w[f][c];c+=1)c===a-1&&$("#"+f+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}f=null;c=[]}Da(d.pin,"#FFFFFF");ra()}else{f=!1;b=d.label+"_Pin"+d.pin;if(-1!==$.inArray(b.restorePinTreeNodeName()+"_Intermediate",Aa))for(c=0,a=N.length;c<a;c+=1)if(0===N[c].indexOf(b.restorePinTreeNodeName())&&N[c]!==b&&(!0===$("#"+N[c]).hasClass("jstree-checked")||0===
C[parseInt(N[c].slice(N[c].indexOf("_Pin")+4),10)-1].replaceSpecialCharacters().indexOf(N[c].restorePinTreeNodeName()))){f=!0;var k=N[c].slice(N[c].indexOf("_Pin")+4);break}if(f){var l=J(d.label);-1!==l.indexOf("_")&&(l=l.slicePriorToX("_"));"undefined"!==typeof d.pin&&null!==d.pin&&$b(function(){Nb(l,d.pin,d.label)},d.label,k)}else Nb(J(b.slicePriorToX("_")),d.pin,d.label);k=f=null}b=null}};return d}function Nb(a,f,c){var d,e=$("#moduleTree"),g=C[f-1]+"_Pin"+f;g=g.replaceSpecialCharacters();e.jstree("uncheck_node",
$("#"+g));if(!$("#"+g).hasClass("jstree-unchecked")){var b=J(g.slicePriorToX("_"));var k=[];k[0]=f;xa(g,b,k);if("undefined"!==typeof w[b]){k=0;for(d=w[b].length;k<d;k+=1)if(w[b][k]===g){w[b][k]="";break}k=0;for(d=w[b].length;k<d&&""===w[b][k];k+=1)k===d-1&&$("#"+b+"_Root").removeClass("jstree-undetermined").addClass("jstree-unchecked")}}g=(c+"_Pin"+f).replaceSpecialCharacters();e.jstree("check_node",$("#"+g));$("#"+g).hasClass("jstree-checked")||(e.jstree("open_node",$("#"+a+"_Root")),e.jstree("open_node",
$("#"+c+"_Intermediate")),e.jstree("check_node",$("#"+g)));Da(f,"#FAB92D");"undefined"===typeof S?S[0]=f:S.push(f);ra();a=a.replaceSpecialCharacters();c=c.replaceSpecialCharacters();e.jstree("close_all");e.jstree("open_node",$("#"+a+"_Root"));e.jstree("open_node",$("#"+c+"_Intermediate"));f=T(aa);f.sort();e.scrollTop(18*$.inArray(a,f))}function Ab(a,f){var c,d="",e=!1;var g=0;for(c=NUTOOL_PIN.g_cfg_gpiosDescriptions.length;g<c;g+=1){var b=d=NUTOOL_PIN.g_cfg_gpiosDescriptions[g];var k=!1;-1!==d.indexOf("@")&&
(b=b.slice(b.indexOf("@")+1,b.indexOf(":")),k=!0);if(0===d.indexOf(a+":")||0===d.indexOf(a+"@"))if(!k||b===NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][f-1]){e=!0;break}}return d=e?d.slice(d.indexOf(":")+1):"unknown"}function $b(a,f,c){if($("#rootTree_Pin").is(":visible")){ta();if("Simplified Chinese"===P){var d="\u901a\u77e5";f="\u9884\u671f\u7684"+f+"\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 e="\u4e0d\u8981"}else"Traditional Chinese"===P?(d="\u901a\u77e5",f="\u9810\u671f\u7684"+f+"\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",e="\u4e0d\u8981"):(d="Notice",f="The expected "+f+" has been configured by the pin "+c+". Would you like to cancel the old one and configure to the current pin?",c="Yes",e="No");ia();$('<div id="noticeForMultipleSelectionsDialog"><p>'+
f+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!1,resizable:!1,title:d,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:e,click:function(){ra();$("#noticeForMultipleSelectionsDialog").dialog("isOpen")&&$("#noticeForMultipleSelectionsDialog").dialog("destroy")}}]})}e=
c=f=d=null}function sb(){aa=[];M=[];A=[];cb=[];da=[];C=[];L=[];S=[];eb();ra();Q.removeContext($("#NUC_PinConfiguration_Canvas"));$("#mfpTree").jstree("destroy");$("#supportedModules").jstree("destroy");$("#moduleTree").jstree("destroy");$("#mfpTree").remove();$("#supportedModules").remove();$("#moduleTree").remove();$("div").remove(".tooltip")}function tb(){pb();"undefined"===typeof NUTOOL_PER&&ub();Mb();lb();rb();hb();Xa();mb()}function Fa(a,f,c){var d="js"===c?"src":"css"===c?"href":"none",e=window.document.getElementsByTagName("js"===
c?"script":"css"===c?"link":"none");"undefined"!==typeof NUTOOL_PER&&"js"===c&&(a="PinConfigure/"+a,f="PinConfigure/"+f);var g=f;if("js"===c){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",g)}else"css"===c&&(b=document.createElement("link"),b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("href",g));g=b;for(c=e.length;0<=c;--c)e[c]&&null!==e[c].getAttribute(d)&&(e[c].getAttribute(d)===a?e[c].parentNode.removeChild(e[c]):
e[c].getAttribute(d)===f&&e[c].parentNode.removeChild(e[c]));e[0].parentNode.appendChild(g)}function ub(){var a,f=$("#MCUselect"),c={},d=[],e=!1;0<f.children().length&&f.children().remove();var g=0;for(a=NUTOOL_PIN.g_cfg_chips.length;g<a;g+=1)try{d.push(NUTOOL_PIN.g_cfg_chips[g].name+"("+NUTOOL_PIN.g_cfg_chips[g].pkg+")")}catch(b){}d.sort(pa);g=0;for(a=d.length;g<a;g+=1)c=document.createElement("option"),c.id=c.innerHTML=c.value=d[g],f[0].appendChild(c);g=0;for(a=NUTOOL_PIN.g_cfg_chips.length;g<a;g+=
1)if(NUTOOL_PIN.g_cfg_chips[g].name+"("+NUTOOL_PIN.g_cfg_chips[g].pkg+")"===G){e=!0;break}e?f.val(G):f.val($("#MCUselect option:first-child").val()).change();$("#ChipTypeSelect").val(bb(k));f.on("change",function(){la!==$(this).val()&&(la=$(this).val(),setTimeout(Ob,0))});a=g=null;d=[];f=e=c=null}function ac(){var a,f=$("#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 d=0;for(a=ob.length;d<a;d+=1){var e=document.createElement("option");try{e.id=e.innerHTML=e.value=ob[d]}catch(b){}f[0].appendChild(e)}f.val(bb(k));ub();f.on("change",function(){c="NUC_"+k+"_Content.js";var a=$(this).val();var d=a;"NUC200"===a?d="NUC200AN":"NANO100"===a?d="NANO100BN":"NUC100"===a?d="NUC100DN":"M051"===a?d="M051DN_DE":"MINI51"===a?d="MINI51DE":"NUC029"===a?d="NUC029AE":"M451"===a?d="M451HD":"M480"===a?d="M480LD":"MS51"===a&&(d="MS51_16K");k=d;g="NUC_"+k+"_Content.js";Fa(c,g,"js");
ub()});var g=c=f=e=a=d=null}function Ob(){$a();if(la!==G){try{window.external.updateCurrentDialogSize()}catch(f){}var a=k;k=nb(la);Fa("NUC_"+a+"_Content.js","NUC_"+k+"_Content.js","js");sb();G=la;NUTOOL_PIN.decidepackageNumber();p=parseInt(NUTOOL_PIN.g_packageNumber.slice(NUTOOL_PIN.g_packageNumber.indexOf(NUTOOL_PIN.g_packageNumber.match(/\d/))),10);33===p&&(p=32);Ha=!1;U=[];R=[];K=null;tb();z=100;va();Ea();ia()}}function ia(){$("#conflictDialog").dialog("isOpen")&&$("#conflictDialog").dialog("destroy");
$("#adjustedModulesDialog").dialog("isOpen")&&$("#adjustedModulesDialog").dialog("destroy");$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").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 Vb(){var a,f=Q.getContext($("#NUC_PinConfiguration_Canvas")[0]);f.font="12px Arial";if(-1===G.indexOf("SOP")){var c=0;for(a=p/4;c<a;c+=1){var d=E+20+c*(16+O);var e=F+l;f.save();f.translate(d,e);f.rotate(-Math.PI/2);f.fillStyle="white";f.fillText((c+1).toString(),3,12.8);f.restore();
ba&&(e=F+l+40,f.save(),f.translate(d,e),f.rotate(-Math.PI/2),f.textAlign="end",f.fillStyle="black",f.fillText(L[c],-3,12.8),f.restore());d=E+l;e=F+l-20-16-c*(16+O)+12.8;var g=f.measureText((c+1+p/4).toString());f.fillStyle="white";f.fillText((c+1+p/4).toString(),d-g.width-3,e);ba&&(d=E+l+40+3,f.fillStyle="black",f.fillText(L[c+p/4],d,e));d=E+l-20-16-c*(16+O);e=F-40;f.save();f.translate(d,e);f.rotate(-Math.PI/2);g=f.measureText((c+1+p/2).toString());f.fillStyle="white";f.fillText((c+1+p/2).toString(),
-40-g.width-3,12.8);f.restore();ba&&(f.save(),f.translate(d,e),f.rotate(-Math.PI/2),f.fillStyle="black",f.fillText(L[c+p/2],6,12.8),f.restore());d=E+3;e=F+20+c*(16+O)+12.8;f.fillStyle="white";f.fillText((c+1+p/4*3).toString(),d,e);ba&&(d=E-40-3,f.save(),f.fillStyle="black",f.fillText(L[c+p/4*3],d-f.measureText(L[c+p/4*3]).width,e),f.restore())}}else for(c=0,a=p/2;c<a;c+=1)d=E+3,e=F+20+c*(16+O)+12.8,f.fillStyle="white",f.fillText((c+1).toString(),d,e),ba&&(d=E-40-3,f.save(),f.fillStyle="black",f.fillText(L[c],
d-f.measureText(L[c]).width,e),f.restore()),d=E+l/2,e=F+l-20-16-c*(16+O)+12.8,g=f.measureText((c+1+p/2).toString()),f.fillStyle="white",f.fillText((c+1+p/2).toString(),d-g.width-3,e),ba&&(d=E+l/2+40+3,f.fillStyle="black",f.fillText(L[c+p/2],d,e))}function gb(){var a=Q.getContext($("#NUC_PinConfiguration_Canvas")[0]);if("Simplified Chinese"===P){var f="\u88ab\u82af\u7247\u56fe\u914d\u7f6e";var c="\u88ab\u6811\u72b6\u56fe\u914d\u7f6e";var d="\u6ed1\u9f20\u7126\u70b9";var e="\u975e\u53ef\u914d\u7f6e\u7684";
a.font="12px \u65b0\u7d30\u660e\u9ad4"}else"Traditional Chinese"===P?(f="\u88ab\u82af\u7247\u5716\u914d\u7f6e",c="\u88ab\u6a39\u72c0\u5716\u914d\u7f6e",d="\u6ed1\u9f20\u7126\u9ede",e="\u975e\u53ef\u914d\u7f6e\u7684",a.font="12px \u65b0\u7d30\u660e\u9ad4"):(f="Configured by ChipView",c="Configured by TreeView",d="Focused by Mouse",e="Not Configurable",a.font="12px Arial");a.strokeStyle="black";var g=E-20-40-120;var b=F-20-16-5;a.strokeRect(g,b,40,16);a.fillStyle="#FAB92D";a.fillRect(g,b,40,16);a.fillStyle=
"black";a.fillText(f,g+40+3,b+12.8);g=E-20-40-120;b=F-20-42;a.strokeRect(g,b,40,16);a.fillStyle="#41AF88";a.fillRect(g,b,40,16);a.fillStyle="black";a.fillText(c,g+40+3,b+12.8);g=E-20-40-120;b=F-20-63;a.strokeRect(g,b,40,16);a.fillStyle="#FC517E";a.fillRect(g,b,40,16);a.fillStyle="black";a.fillText(d,g+40+3,b+12.8);g=E-20-40-120;b=F-20-84;a.strokeRect(g,b,40,16);a.fillStyle="#9365C9";a.fillRect(g,b,40,16);a.fillStyle="black";a.fillText(e,g+40+3,b+12.8)}function Pb(){var a=Q.getContext($("#NUC_PinConfiguration_Canvas")[0]);
var f=E-20-40-120-3;var c=F-20-84;a.fillStyle="#FFFFFF";a.fillRect(f,c,180,104)}function Ca(a,f,c){var d,e;f=f.restorePinTreeNodeName().restoreSpecialCharacters();var g=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a];var b=g+":0";a=0;for(d=NUTOOL_PIN.g_cfg_gpios.length;a<d;a+=1)if(b===NUTOOL_PIN.g_cfg_gpios[a].f[0]){d=0;for(e=NUTOOL_PIN.g_cfg_gpios[a].f.length;d<e;d+=1)if("undefined"===typeof c||!1===c)if("AD"!==f){if(0===NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf(f)){qb(g,NUTOOL_PIN.g_cfg_gpios[a].f[d].slice(NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf(":")+
1));break}}else{if(0!==NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf("ADC")&&0===NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf(f)){qb(g,NUTOOL_PIN.g_cfg_gpios[a].f[d].slice(NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf(":")+1));break}}else if(b=NUTOOL_PIN.g_cfg_gpios[a].f[d],b=b.slicePriorToX(":"),b===f){qb(g,NUTOOL_PIN.g_cfg_gpios[a].f[d].slice(NUTOOL_PIN.g_cfg_gpios[a].f[d].indexOf(":")+1));break}break}}function va(){var a=$("#panel");Y?(a.find("canvas").css("zoom"," "+z+"%"),a.width(ja-275-8),a.height(ea-8),$("#NUC_PinConfiguration_Canvas").width(na*
z/100),$("#NUC_PinConfiguration_Canvas").height(za*z/100),-1===G.indexOf("SOP")?($("#pin_side_0").width((D[0].w+D[0].x[D[0].oneSidePinNumber-1]-D[0].x[0]+20)*z/100),$("#pin_side_0").height((D[0].h+20)*z/100),$("#pin_side_1").width((D[1].w+20)*z/100),$("#pin_side_1").height((D[1].h+D[1].y[0]-D[1].y[D[1].oneSidePinNumber-1]+20)*z/100),$("#pin_side_2").width((D[2].w+D[2].x[0]-D[2].x[D[2].oneSidePinNumber-1]+20)*z/100),$("#pin_side_2").height((D[2].h+20)*z/100),$("#pin_side_3").width((D[3].w+20)*z/100),
$("#pin_side_3").height((D[3].h+D[3].y[D[3].oneSidePinNumber-1]-D[3].y[0]+20)*z/100)):($("#pin_side_0").width((D[0].w+20)*z/100),$("#pin_side_0").height((D[0].h+D[0].y[D[0].oneSidePinNumber-1]-D[0].y[0]+20)*z/100),$("#pin_side_1").width((D[1].w+20)*z/100),$("#pin_side_1").height((D[1].h+D[1].y[0]-D[1].y[D[1].oneSidePinNumber-1]+20)*z/100)),a.css("border","3px solid white")):($("#parentOfPanel").css("zoom"," "+z+"%"),a.width((ja-275-8)/z*100),a.height((ea-8)/z*100),a.css({position:"absolute",left:275/
z*100+"px"}));ra()}function vb(){for(var a,f,c,d=[],e,g,b,k,l=0;0<M.length&&1E3>l;)for(l+=1,a=parseInt(M[0].slicePriorToX(":"),10),f=L[a-1],g=-1,b=0,k=da[a-1];g!==b;)g=f.indexOf(k),b=f.lastIndexOf(k),c=f.slice(g),c=c.slicePriorToX("/"),e=c+"_Pin"+a,e=e.replaceSpecialCharacters(),c=J(e.slicePriorToX("_")),d[0]=a,xa(e,c,d),$("#"+e).removeClass("jstree-checked"),$("#"+e).addClass("jstree-unchecked"),$("#"+c+"_Root").removeClass("jstree-undetermined"),$("#"+c+"_Root").removeClass("jstree-checked"),$("#"+
c+"_Root").addClass("jstree-unchecked"),f=f.slice(g+1);ka();$("#moduleTree").find("li").each(function(a,b){$("#"+$(b).attr("id")+" >a").css("color","black")});$("#moduleTree").jstree("close_all");M=[];d=[];w=[];V=[];l=k=b=g=e=c=c=f=a=null}function Ta(a){var f,c,d,e,g=[],b="",k=!0;if(0===NUTOOL_PIN.g_cfg_shareBits.length)return k;var l=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof l&&-1!==l.indexOf("UIlanguage:"))if(l=l.sliceAfterX("UIlanguage:"),l=l.slicePriorToX("\r"),
"Simplified Chinese"===l){var p="\u6216";var n="\u5e94\u4e3a";var u="\u3002";var w="(\u518d\u6b21\u914d\u7f6e\u5b83)"}else"Traditional Chinese"===l?(p="\u6216",n="\u61c9\u70ba",u="\u3002",w="(\u518d\u6b21\u914d\u7f6e\u5b83)"):(p=" or ",n=" should be ",u=".",w="(configure it again)");else p=" or ",n=" should be ",u=".",w="(configure it again)";l=0;for(f=NUTOOL_PIN.g_cfg_shareBits.length;l<f;l+=1){var r=NUTOOL_PIN.g_cfg_shareBits[l];var t=0;for(c=NUTOOL_PIN.g_cfg_gpioMatrix.length;t<c;t+=1){var D=-1;
var q=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[t].f.length;q<d;q+=1)if(-1!==NUTOOL_PIN.g_cfg_gpioMatrix[t].f[q].indexOf(r)){var y=NUTOOL_PIN.g_cfg_gpioMatrix[t].f[0];D=$.inArray(y,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex]);break}if(-1!==D&&-1===$.inArray(D,g)){g.push(D);var x=0;q=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[t].f.length;q<d;q+=1){var I=NUTOOL_PIN.g_cfg_gpioMatrix[t].f[q];var z=parseInt(I.slice(I.indexOf("[")+1,I.indexOf("]")),10);var B=1<<z>>>0;I=I.slicePriorToX("[");I=A[I];x+=((I&
B)>>>z)*Math.pow(2,q-1)}var G=C[D];z=0;var E=ua(y,parseInt(y.sliceAfterX("."),10));q=1;for(d=NUTOOL_PIN.g_cfg_gpios[E].f.length;q<d;q+=1)if(0===NUTOOL_PIN.g_cfg_gpios[E].f[q].indexOf(G+":")){z=NUTOOL_PIN.g_cfg_gpios[E].f[q];z=parseInt(z.slice(z.indexOf(":")+1),10);break}""===G&&(G=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][D]);if(x!==z){k=!1;x=[];q=1;for(d=NUTOOL_PIN.g_cfg_gpioMatrix[t].f.length;q<d;q+=1)if(-1!==$.inArray(NUTOOL_PIN.g_cfg_gpioMatrix[t].f[q].slicePriorToX(":"),NUTOOL_PIN.g_cfg_shareBits)&&
(I=NUTOOL_PIN.g_cfg_gpioMatrix[t].f[q],z=parseInt(I.slice(I.indexOf("[")+1,I.indexOf("]")),10),B=1<<z>>>0,I=I.slicePriorToX("["),I=A[I],I&B))for(B=1<<q-1>>>0,I=1,e=NUTOOL_PIN.g_cfg_gpios[E].f.length;I<e;I+=1)z=NUTOOL_PIN.g_cfg_gpios[E].f[I],z=parseInt(z.slice(z.indexOf(":")+1),10),z&B&&(0===NUTOOL_PIN.g_cfg_gpios[E].f[I].indexOf(G)?x.push(G+w):x.push(NUTOOL_PIN.g_cfg_gpios[E].f[I]));0===x.length&&x.push(NUTOOL_PIN.g_cfg_gpios[E].f[0].slicePriorToX(":"));B="";q=0;for(d=x.length;q<d;q+=1)0!==q&&q===
d-1?B+=p:0!==q&&(B+=", "),B+=x[q].slicePriorToX(":"),q===d-1&&(B+=u);b=b+G+"(Pin"+(D+1)+")"+n+B+" <br />"}}}}k||a(b);return k}function db(a){var f=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof f&&-1!==f.indexOf("UIlanguage:"))if(f=f.sliceAfterX("UIlanguage:"),f=f.slicePriorToX("\r"),"Simplified Chinese"===f){f="\u5171\u4eab\u4f4d\u5143\u9519\u8bef";a="\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 />"+
a+"<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";var c="\u786e\u5b9a"}else"Traditional Chinese"===f?(f="\u5171\u4eab\u4f4d\u5143\u932f\u8aa4",a="\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 />"+
a+"<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"):(f="Shared Bits Error",a="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 />"+a+"<br />Unless they are all fixed, the operations of saving configuration, generating code and printing report will not be permitted.",
c="Confirm");else f="Shared Bits Error",a="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 />"+a+"<br />Unless they are all fixed, the operations of saving configuration, generating code and printing report will not be permitted.",c="Confirm";$("#shareBitErrorDialog").dialog("isOpen")&&$("#shareBitErrorDialog").dialog("destroy");$('<div id="shareBitErrorDialog"><p>'+
a+"</p></div>").dialog({modal:!1,resizable:!1,title:f,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#shareBitErrorDialog").dialog("destroy")},buttons:[{text:c,click:function(){$("#shareBitErrorDialog").dialog("isOpen")&&$("#shareBitErrorDialog").dialog("destroy")}}]});f=c=a=f=null}function bc(a){var f=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof f&&-1!==f.indexOf("UIlanguage:"))if(f=f.sliceAfterX("UIlanguage:"),f=f.slicePriorToX("\r"),"Simplified Chinese"===
f){f="\u5171\u4eab\u4f4d\u5143\u9519\u8bef";a="\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 />"+a+"<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";
var c="\u5173\u95ed";var d="\u4fee\u6b63"}else"Traditional Chinese"===f?(f="\u5171\u4eab\u4f4d\u5143\u932f\u8aa4",a="\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 />"+a+"<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",d="\u4fee\u6b63"):(f="Shared Bit Error",a="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 />"+a+"<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",d="Fix");else f="Shared Bit Error",a="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 />"+
a+"<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",d="Fix";$("#shareBitErrorDialog").dialog("isOpen")&&$("#shareBitErrorDialog").dialog("destroy");$('<div id="shareBitErrorDialog"><p>'+a+"</p></div>").dialog({modal:!1,resizable:!1,title:f,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#shareBitErrorDialog").dialog("destroy")},buttons:[{text:c,click:function(){$("#shareBitErrorDialog").dialog("isOpen")&&
$("#shareBitErrorDialog").dialog("destroy");vb();Cb();window.external.closeFromJS()}},{text:d,click:function(){$("#shareBitErrorDialog").dialog("isOpen")&&$("#shareBitErrorDialog").dialog("destroy")}}]});f=c=a=f=null}function Sa(a){var f,c=!0,d=[];if($("#rootTree_Pin").is(":visible")){d=T(A);var e=0;for(f=d.length;e<f;e+=1)if(cb[d[e]]!==A[d[e]]){c=!1;break}c?a():(ta(),"Simplified Chinese"===P?(e="\u8b66\u544a",f="\u914d\u7f6e\u6863\u5df2\u88ab\u4fee\u6539\u8fc7\u3002\u8bf7\u95ee\u4f60\u8981\u50a8\u5b58\u5b83\u5417?",
c="\u8981",d="\u4e0d\u8981"):"Traditional Chinese"===P?(e="\u8b66\u544a",f="\u914d\u7f6e\u6a94\u5df2\u88ab\u4fee\u6539\u904e\u3002\u8acb\u554f\u4f60\u8981\u5132\u5b58\u5b83\u55ce?",c="\u8981",d="\u4e0d\u8981"):(e="Warning",f="The configuration has been modified.<br />Would you like to save it?",c="Yes",d="No"),ia(),$('<div id="warningForSavingDialog"><p>'+f+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!0,draggable:!1,resizable:!1,title:e,width:500,
height:"auto",show:"fade",hide:"fade",close:function(){$("#warningForSavingDialog").dialog("destroy")},buttons:[{text:c,click:function(){Ta(db)&&window.external.saveConfigFromJS();a();$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").dialog("destroy")}},{text:d,click:function(){a();Za();$("#warningForSavingDialog").dialog("isOpen")&&$("#warningForSavingDialog").dialog("destroy")}}]}),d=c=f=e=null);c=null;d=[]}}function Xb(a){var f="";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 d="\u4e00\u4e9b\u6a21\u5757\u5df2\u88ab\u8c03\u6574\uff0c\u5176\u5b83\u65e0\u6cd5\u8c03\u6574\u7684\u5df2\u88ab\u79fb\u9664\u3002\u5217\u8868\u5982\u4e0b:<hr>";var e="\u7b2c";var g="\u811a\u4f4d";var b="\u4ece";var k="\u5df2\u79fb\u9664";var l="\u590d\u539f";var p="\u786e\u5b9a"}else"Traditional Chinese"===c?(c="\u885d\u7a81\u7684\u8abf\u6574",
d="\u4e00\u4e9b\u6a21\u584a\u5df2\u88ab\u8abf\u6574\uff0c\u5176\u5b83\u7121\u6cd5\u8abf\u6574\u7684\u5df2\u88ab\u79fb\u9664\u3002\u5217\u8868\u5982\u4e0b:<hr>",e="\u7b2c",g="\u8173\u4f4d",b="\u5f9e",k="\u5df2\u79fb\u9664",l="\u5fa9\u539f",p="\u78ba\u5b9a"):(c="Adjustment of the Conflict",d="Some modules have been adjusted. The others unable to adjust have been removed. Here is the list:<hr>",e=" Pin",g="",b="from",k=" has been removed",l="Undo",p="Confirm");else c="Adjustment of the Conflict",d="Some modules have been adjusted. The others unable to adjust have been removed. Here is the list:<hr>",
e=" Pin",g="",b="from",l="Undo",p="Confirm";for(;-1!==a.indexOf(";");)f=a.sliceAfterX("/").slicePriorToX(";"),-1!==a.slicePriorToX(";").indexOf("removed")?(f="",d+="<b><big>"+a.slicePriorToX(":")+":"+e+a.sliceAfterX(":").slicePriorToX("/")+g+k+"</big></b><br />",d+=C[parseInt(a.sliceAfterX(":").slicePriorToX("/"),10)-1]+":"+e+a.sliceAfterX(":").slicePriorToX("/")+g+"<hr>"):-1!==a.slicePriorToX(";").indexOf("end")?(f="",d+=a.slicePriorToX(":")+":"+e+a.sliceAfterX(":").slicePriorToX("/")+g+"<hr>"):
d+=a.slicePriorToX(":")+":"+e+a.sliceAfterX(":").slicePriorToX("/")+g+"("+b+e+a.sliceAfterX("/").slicePriorToX(";")+g+")<br />",a=a.sliceAfterX(";");""!==f&&(d+=C[parseInt(f,10)-1]+":"+e+f+g+"<hr>");ia();$('<div id="adjustedModulesDialog"><p>'+d+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!1,resizable:!1,title:c,width:500,height:400,show:"fade",hide:"fade",close:function(){$("#adjustedModulesDialog").dialog("destroy")},buttons:[{text:l,click:function(){var a,
b=T(A);Ha=!0;U=[];var c=0;for(a=b.length;c<a;c+=1)U[b[c]]=Ra[b[c]];R=[];c=0;for(a=Oa.length;c<a;c+=1)R[c]=Oa[c];M=[];A=[];da=[];C=[];eb();ra();Q.removeContext($("#NUC_PinConfiguration_Canvas"));$("#mfpTree").jstree("destroy");$("#supportedModules").jstree("destroy");$("#moduleTree").jstree("destroy");$("#mfpTree").remove();$("#supportedModules").remove();$("#moduleTree").remove();$("div").remove(".tooltip");pb();0===$("#NUC_PinConfiguration_Canvas").length&&$("#panel")[0].appendChild(oa("canvas",
"NUC_PinConfiguration_Canvas"));rb();hb();Xa();Ea();mb();$("#adjustedModulesDialog").dialog("isOpen")&&$("#adjustedModulesDialog").dialog("destroy")}},{text:p,click:function(){$("#adjustedModulesDialog").dialog("isOpen")&&$("#adjustedModulesDialog").dialog("destroy")}}]});c=p=k=b=g=e=f=d=c=null}function cc(){var a,f="m";var c=T(NUTOOL_PIN.g_cfg_regDescriptions);var d=0;for(a=c.length;d<a;d+=1)0!==d&&(f+=","),f+=NUTOOL_PIN.g_cfg_regDescriptions[c[d]].slice(2);return f+","}function Za(){var a;var f=
T(A);cb=[];var c=0;for(a=f.length;c<a;c+=1)cb[f[c]]=A[f[c]]}function Qb(){var a;wb="";for(a=1;a<=p;a+=1)""!==C[a-1]&&(wb+="Pin"+a+":"+C[a-1]+"\n")}function Rb(){var a,f,c=[];for(a=1;a<=p;a+=1)if(""!==C[a-1]){var d=a;var e=f=C[a-1];-1!==e.indexOf("_")&&(e=e.slicePriorToX("_"));e=J(e);"undefined"===typeof c[e]?(c[e]=[],c[e][0]=f+"(Pin:"+d+")"):c[e].push(f+"(Pin:"+d+")")}xb="";var g=T(c);a=0;for(d=g.length;a<d;a+=1)for(c[g[a]].sort(pa),f=0,e=c[g[a]].length;f<e;f+=1)xb+=c[g[a]][f]+"\n"}function Sb(){var a,
f=[];for(a=1;a<=p;a+=1)if(""!==C[a-1]){var c=a;var d=C[a-1];var e=J(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]);"undefined"===typeof f[e]?(f[e]=[],f[e][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]+":"+d+"(Pin:"+c+")"):f[e].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][c-1]+":"+d+"(Pin:"+c+")")}yb="";var g=T(f).sort(pa);a=0;for(c=g.length;a<c;a+=1)for(f[g[a]].sort(pa),d=0,e=f[g[a]].length;d<e;d+=1)yb+=f[g[a]][d]+"\n"}function Tb(){Ua?ma.readyState?ma.send("q"):
fa("\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 connnection is not stable. Please try it later."):(ma=new WebSocket("ws://127.0.0.1:5555","openocd-nuvoton-protocol"),ma.onopen=function(){Ua=!0;ma.readyState?ma.send("q"):fa("\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 connnection is not stable. Please try it later.")},ma.onerror=function(){!1===Ua?fa("\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."):
fa("NuEclipse\u9000\u51fa\u4e86\u8c03\u8bd5\u6a21\u5f0f\u3002","NuEclipse\u9000\u51fa\u4e86\u8abf\u8a66\u6a21\u5f0f\u3002","NuEclipse leaved the debug mode.");Ua=!1;ma=null},ma.onmessage=function(a){if(0===a.data.indexOf("q")){a=a.data;var f;a=a.slice(1);if("UNKNOWN"!==a.toUpperCase()){var c=nb(a);c!==k&&(oldfilename="NUC_"+k+"_Content.js",newfilename="NUC_"+c+"_Content.js",Fa(oldfilename,newfilename,"js"),$("#ChipTypeSelect").val(c),k=c);la=null;c=0;for(f=NUTOOL_PIN.g_cfg_chips.length;c<f;c+=1)a===
NUTOOL_PIN.g_cfg_chips[c].name&&(la=NUTOOL_PIN.g_cfg_chips[c].name+"("+NUTOOL_PIN.g_cfg_chips[c].pkg+")");null!==la&&la!==G&&($a(),sb(),G=la,NUTOOL_PIN.decidepackageNumber(),p=parseInt(NUTOOL_PIN.g_packageNumber.slice(NUTOOL_PIN.g_packageNumber.indexOf(NUTOOL_PIN.g_packageNumber.match(/\d/))),10),33===p&&(p=32),Ha=!1,U=[],R=[],K=null,tb(),z=100,va(),Ea(),ia())}ma.send(cc())}else if(0===a.data.indexOf("m")){a=a.data;a=a.slice(1);f=a.split(",");var d=T(NUTOOL_PIN.g_cfg_regDescriptions);if(f.length===
d.length){a=0;for(c=d.length;a<c;a+=1){var e=d[a];var g=A[e];var b=parseInt(f[a],16);g!==b&&(Lb(e+":0x"+wa(g).toUpperCase()),qa(e+":0x"+wa(b).toUpperCase()))}ka()}}})}function Jb(){$("#rootTree_Pin").is(":visible")&&(z=10*Math.ceil(z/10)+5,va())}function Kb(){$("#rootTree_Pin").is(":visible")&&z>=Ja+5&&(z=10*Math.floor(z/10)-5,va())}function Ub(){if(!Gb()){Hb();Ib();Fb()||(Ha=!1);pb();if("undefined"===typeof NUTOOL_PER)try{window.external.updateCurrentDialogSize()}catch(a){Qa=!1}Mb();lb();"undefined"===
typeof NUTOOL_PER&&ac();$("#rootTree_Pin")[0].setAttribute("style","width:275px; height: "+ha+"px;");rb();hb();$a();Xa();mb();Ea();Eb()}}var Y,p,O=0,fb,na=0,za=0,ja=0,ea=0,Ba=0,ha=0,l=0,E=0,F=0,la,Q={getContext:null,removeContext:null,addEvent:null},P="",Ka="",Na,k,G,K,ma=null,W,X,La,Va,Wa,wb,xb,yb,B,ab,z=100,kb=100,Ja,D=[],Aa=[],N=[],L=[],M=[],da=[],C=[],R=[],Oa=[],aa=[],sa=[],U=[],A=[],cb=[],Ra=[],w=[],V=[],ya=[],S=[],ob="NUC400 NUC505 M451 M480 M2351 M251 M261 NUC100 NUC200 NUC029 NDA102 M031 M051 M0518 M0519 M0564 ML51 MS51 MINI51 NANO100 NM1120 NM1200 NM1500 ISD9100 ISD9300".split(" "),
ba=!1,Ua=!1,Qa=!0,Ha=!0,Ga=!0;window.onload=function(){Ub()};NUTOOL_PIN={getg_userSelectUIlanguage:function(){return P},getg_partNumber_package:function(){return G},getg_pin_descriptions:function(){return Wa},getg_gpio_MFPsString:function(){return X},getg_pinCurrentStateString:function(){return La},getg_pinsConfiguredByGPIOstring:function(){return Va},getg_includeHeadFileString:function(){return W},getg_generatedCodeByPinString:function(){return wb},getg_generatedCodeByModuleString:function(){return xb},
getg_generatedCodeByGPIOstring:function(){return yb},setg_selectedPartNoValue:function(a){la=a},loadPinConfigureTool:Ub,loadPinConfigureTool_fromSelectionGuide:function(){Gb()||(ta(),Hb(),Ib(),$("#rootTree_Pin")[0].setAttribute("style","width:275px; height: "+ha+"px;"),Ob(),Ea(),Eb())},getGeneratedCodeByPin:Qb,getGeneratedCodeByModule:Rb,getGeneratedCodeByGPIO:Sb,getDataUsedToCreateText:function(){var a,f,c,d=[],e=[];"undefined"===typeof NUTOOL_PER?"NUC200AE"===k?W='#include "NUC230_240.h"\n':"NUC200AN"===
k?W='#include "NUC200Series.h"\n':"NANO100AN"===k||"NANO100BN"===k?W='#include "Nano100Series.h"\n':"NANO103"===k?W='#include "Nano103.h"\n':"NANO112"===k?W='#include "Nano1X2Series.h"\n':"NUC100AN_BN"===k||"NUC100CN"===k||"NUC100DN"===k?W='#include "NUC100Series.h"\n':"NUC121AE"===k?W='#include "NUC121.h"\n':"NUC122AN"===k?W='#include "NUC122.h"\n':"NUC123AN"===k||"NUC123AE"===k?W='#include "NUC123.h"\n':"M031"===k?W='#include "M031Series.h"\n':"NUC505"===k?W='#include "NUC505Series.h"\n':"M058S"===
k?W='#include "M058S.h"\n':"M051DN_DE"===k||"M051BN"===k||"M051AN"===k?W='#include "M051Series.h"\n':"M451LD"===k||"M451HD"===k?W='#include "M451Series.h"\n':"MINI51AN"===k?W='#include "Mini51.h"\n':"MINI51DE"===k?W='#include "Mini51Series.h"\n':"MINI55"===k?W='#include "Mini55Series.h"\n':"MINI57"===k||"NM1120"===k?W='#include "Mini57Series.h"\n':"MINI58"===k?W='#include "Mini58Series.h"\n':"ML51"!==k&&(W="NUC029AN"===k?'#include "NUC029xAN.h"\n':"NUC029AE"===k?'#include "NUC029FAE.h"\n':"NUC029KGE"===
k?'#include "NUC029xGE.h"\n':"NM1200"===k?'#include "Mini51.h"\n':"NM1500"===k?'#include "MT500Series.h"\n':"NUC400"===k?'#include "NUC472_442.h"\n':'#include "'+k+'.h"\n'):W='#include "NuCodeGenProj.h"\n';X="";var g=T(A);g.sort();if(0!==NUTOOL_PIN.g_cfg_gpiosDefines.length){var b=0;for(f=g.length;b<f;b+=1)U[g[b]]=A[g[b]],e[g[b]]=[];for(b=1;b<=p;b+=1)if(""!==C[b-1]){f=b;var h=C[b-1];var l=J(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][f-1]);"undefined"===typeof d[l]?(d[l]=[],d[l][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][f-
1]+":"+h):d[l].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][f-1]+":"+h)}var v=T(d).sort(pa);b=0;for(f=v.length;b<f;b+=1)for(d[v[b]].sort(pa),h=0,l=d[v[b]].length;h<l;h+=1){var n=c=d[v[b]][h];c=c.slicePriorToX(":");n=n.sliceAfterX(":");var 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(n+":")){a=NUTOOL_PIN.g_cfg_gpiosDefines[u].f[a];
do-1===a.indexOf("/")?(u=a,a=""):(u=a.slicePriorToX("/"),a=a.sliceAfterX("/")),n=u,u=u.sliceAfterX("@"),n=-1===n.indexOf(":")?n.slicePriorToX("@"):n.slice(n.indexOf(":")+1,n.indexOf("@")),e[u].push(n);while(""!==a);break}break}}if("ML51"!==k){b=0;for(f=g.length;b<f;b+=1)X=X+"    //SYS->"+g[b]+" = 0x"+wa(A[g[b]]).toUpperCase()+";\n";X+="\n";X+="    //If the defines do not exist in your project, please refer to the corresponding sys.h in the Header folder appended to the tool package.\n";b=0;for(f=
g.length;b<f;b+=1)if(0<e[g[b]].length)for(X=X+"    SYS->"+g[b]+" = ",h=e[g[b]].length-1;0<=h;--h)X=0!==h?X+e[g[b]][h]+" | ":X+e[g[b]][h]+";\n";else X=X+"    SYS->"+g[b]+" = 0x00000000;\n"}else{b=0;for(f=g.length;b<f;b+=1)X=X+"    //SYS->"+g[b]+" = 0x"+wa(A[g[b]]).toUpperCase()+";\n";X+="\n";X+="    //If the defines do not exist in your project, please refer to the corresponding .h file in the Header folder appended to the tool package.\n";b=0;for(f=g.length;b<f;b+=1)if(0<e[g[b]].length)for(h=e[g[b]].length-
1;0<=h;--h)X=X+"    "+e[g[b]][h]+";\n"}}else{b=0;for(f=g.length;b<f;b+=1)X+="    SYS->"+g[b]+" = 0x"+wa(A[g[b]]).toUpperCase()+";\n";$("#NUC_PinConfiguration_Canvas")[0].setAttribute("innerHTML","")}La="";for(b=1;b<=p;b+=1)""!==C[b-1]?La+="Pin"+b+":"+C[b-1]+"\n":(h=L[b-1].slice(L[b-1].indexOf(da[b-1])),h=h.slicePriorToX("/"),La+="Pin"+b+":"+h+"\n");Va="";b=0;for(f=R.length;b<f;b+=1)Va+="GPIOpin:"+R[b]+"\n"},closeAPP:function(){null!==ma&&ma.close();Ta(bc)&&Sa(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_"),ja=parseInt(a.slicePriorToX("Y_"),10),ea=parseInt(a.slice(a.indexOf("Y_")+2,a.indexOf("\r")),10),792>ja&&(ja=792),590>ea&&(ea=590)):(ja=na,ea=za);ha=ea-10;$("#panel").width(ja-275-8);$("#panel").height(ea-8);"none"===$("#mfpTree").css("display")?$("#moduleTree").height(ha-$("#supportedModules").height()):($("#MCU").height(),
$("#moduleTree").height(ha-$("#ChipType").height()-$("#MCU").height()-Ba-6-$("#supportedModules").height()));z=100;va();Ea()},triggerSearch:function(){Ya($("#searchInput_Pin").val())},showRegisters:function(){$("#rootTree_Pin").is(":visible")&&("undefined"===typeof NUTOOL_PER?"none"===$("#mfpTree").css("display")?($("#ChipType").show(),$("#MCU").show(),$("#mfpTree").show(),$("#MCU").height(),$("#moduleTree").height(ha-$("#ChipType").height()-$("#MCU").height()-Ba-6-$("#supportedModules").height())):
($("#ChipType").hide(),$("#MCU").hide(),$("#mfpTree").hide(),$("#moduleTree").height(ha-$("#supportedModules").height())):"none"===$("#mfpTree").css("display")?($("#mfpTree").show(),$("#MCU").height(),$("#moduleTree").height(ha-$("#ChipType").height()-$("#MCU").height()-Ba-6-$("#supportedModules").height())):($("#mfpTree").hide(),$("#moduleTree").height(ha-$("#supportedModules").height())))},loadConfig:function(){$("#rootTree_Pin").is(":visible")&&Sa(function(){window.external.loadConfigFromJS()})},
loadConfig_core:function(){try{Ga=!0,Fb()||(fa("\u914d\u7f6e\u6863\u4e0d\u6b63\u786e\u3002","\u914d\u7f6e\u6a94\u4e0d\u6b63\u78ba\u3002","The config file is incorrect."),Ha=!1),$a(),sb(),tb(),ka(),z=100,va(),Ea(),$("#MCUselect").val(G),la=G,ia(),Ga=!1}catch(a){}},saveConfig:function(){Ta(db)&&window.external.saveConfigFromJS()},generateCode:function(){var a=0;var f=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if(-1===k.indexOf("MS51")&&$("#rootTree_Pin").is(":visible")&&Ta(db)){if("undefined"!==
typeof f&&-1!==f.indexOf("UIlanguage:"))if(f=f.sliceAfterX("UIlanguage:"),f=f.slicePriorToX("\r"),"Simplified Chinese"===f){f="\u4ea7\u751f\u7a0b\u5f0f\u7801";var c="\u9009\u62e9\u7528\u6765\u5206\u7c7b\u914d\u7f6e\u8d44\u8baf\u7684\u6807\u51c6\u3002";var d="\u811a\u4f4d";var e="\u6a21\u7d44";var g="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d";var b="\u786e\u5b9a";var h="\u79bb\u5f00"}else"Traditional Chinese"===f?(f="\u7522\u751f\u7a0b\u5f0f\u78bc",c="\u9078\u64c7\u7528\u4f86\u5206\u985e\u914d\u7f6e\u8cc7\u8a0a\u7684\u6a19\u6e96\u3002",
d="\u8173\u4f4d",e="\u6a21\u7d44",g="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d",b="\u78ba\u5b9a",h="\u96e2\u958b"):(f="Generate Code",c="Select the criteria by which the configured information is being cataloged.",d="Pin",e="Module",g="GPIO",b="Confirm",h="Leave");else f="Generate Code",c="Select the criteria by which the configured information is being cataloged.",d="Pin",e="Module",g="GPIO",b="Confirm",h="Leave";ia();$('<div id="generateCodeDialog"><p>'+c+'</p><label><input type="checkbox" id="checkbox_byPin" checked=true/>'+
d+'</label><br /><label><input type="checkbox" id="checkbox_byModule" />'+e+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" />'+g+'</label><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!0,draggable:!1,resizable:!1,title:f,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},buttons:[{text:b,click:function(){a=0;$("#checkbox_byPin").is(":checked")&&(a=1,Qb());$("#checkbox_byModule").is(":checked")&&
(a+=2,Rb());$("#checkbox_byGPIO").is(":checked")&&(a+=4,Sb());window.external.generateCodeFromJS(a);$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}},{text:h,click:function(){$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}}]});a=f=h=b=g=e=d=c=f=null}else fa("\u8fd9\u4e2a\u82af\u7247\u65e0\u6cd5\u751f\u6210\u7a0b\u5f0f\u7801\u3002","\u9019\u500b\u6676\u7247\u7121\u6cd5\u751f\u6210\u7a0b\u5f0f\u78bc\u3002","This chip cannot generate code.")},
connectToTarget:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if(Y||$("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",f="\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",f="\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",f="To use this feature, please upgrade the IE version to 10 or higher.",c="Confirm")):(a="Connect to Target Chip",f="To use this feature, please upgrade the IE version to 10 or higher.",c="Confirm"),ia(),$('<div id="connectToTargetDialog"><p>'+f+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></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=d=c=f=a=null);else if(Ua)Tb();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 f="\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";var d="\u79bb\u5f00"}else"Traditional Chinese"===a?(a="\u9023\u7dda\u5230\u76ee\u6a19\u6676\u7247",f="\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",d="\u96e2\u958b"):(a="Connect to Target Chip",f="When connecting to a target chip, what you have configured is going to be gone. To continue, click the Confirm button.",c="Confirm",d="Leave");else a="Connect to Target Chip",f="When connecting to a target chip, what you have configured is going to be gone. To continue, click the Confirm button.",c="Confirm",d="Leave";ia();$('<div id="connectToTargetDialog"><p>'+f+'</p><input type="text" size="1" style="position:relative;top:-500px;"/></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(){Tb();$("#connectToTargetDialog").dialog("isOpen")&&$("#connectToTargetDialog").dialog("destroy")}},{text:d,click:function(){$("#connectToTargetDialog").dialog("isOpen")&&$("#connectToTargetDialog").dialog("destroy")}}]});a=d=c=f=a=null}},printReport:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;
if($("#rootTree_Pin").is(":visible")&&Ta(db)){if("undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:"))if(a=a.sliceAfterX("UIlanguage:"),a=a.slicePriorToX("\r"),"Simplified Chinese"===a){var f="\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 d="\u82af\u7247\u56fe\u793a";var e="\u811a\u4f4d";var g="\u6a21\u7d44";var b="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d";var h="\u6682\u5b58\u5668";var m="\u786e\u5b9a";
var v="\u79bb\u5f00"}else"Traditional Chinese"===a?(f="\u65b9\u6848\u540d\u7a31",a="\u5370\u51fa\u5831\u544a",c="\u9078\u64c7\u7528\u4f86\u5c55\u793a\u914d\u7f6e\u8cc7\u8a0a\u7684\u6a19\u6e96\u3002",d="\u6676\u7247\u5716\u793a",e="\u8173\u4f4d",g="\u6a21\u7d44",b="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d",h="\u66ab\u5b58\u5668",m="\u78ba\u5b9a",v="\u96e2\u958b"):(a="Print Report",f="Project Name",c="Select the criteria by which the configured information is being exhibited.",d="ChipView",e="Pin",g="Module",
b="GPIO",h="Register",m="Confirm",v="Leave");else a="Print Report",f="Project Name",c="Select the criteria by which the configured information is being cataloged.",d="ChipView",e="Pin",g="Module",b="GPIO",h="Register",m="Confirm",v="Leave";ia();f=Y?$('<div id="printReportDialog"><label>'+f+': <input type="text" id="inputText_projectName" value=""></label><br /><p>'+c+'</p><label><input type="checkbox" id="checkbox_byPin" checked=true/>'+e+'</label><br /><label><input type="checkbox" id="checkbox_byModule" />'+
g+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" />'+b+'</label><br /><label><input type="checkbox" id="checkbox_byRegister" />'+h+"</label></div>"):$('<div id="printReportDialog"><label>'+f+': <input type="text" id="inputText_projectName" value=""></label><br /><p>'+c+'</p><label><input type="checkbox" id="checkbox_byChipView" checked=true/>'+d+'</label><br /><label><input type="checkbox" id="checkbox_byPin" checked=true/>'+e+'</label><br /><label><input type="checkbox" id="checkbox_byModule" />'+
g+'</label><br /><label><input type="checkbox" id="checkbox_byGPIO" />'+b+'</label><br /><label><input type="checkbox" id="checkbox_byRegister" />'+h+"</label></div>");f.dialog({modal:!0,draggable:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#printReportDialog").dialog("destroy")},buttons:[{text:m,click:function(){$("#checkbox_byChipView").is(":checked")&&(n="checkbox_byChipView/");$("#checkbox_byPin").is(":checked")&&(n+="checkbox_byPin/");$("#checkbox_byModule").is(":checked")&&
(n+="checkbox_byModule/");$("#checkbox_byGPIO").is(":checked")&&(n+="checkbox_byGPIO/");$("#checkbox_byRegister").is(":checked")&&(n+="checkbox_byRegister/");var a=$("#inputText_projectName").val(),b=n;ta();if("Simplified Chinese"===P){var c="\u65b9\u6848";var d="\u65b9\u6848\u540d\u79f0";var f="\u65e5\u671f";var e="\u578b\u53f7";var g="\u82af\u7247\u7cfb\u5217";var h="\u5fae\u63a7\u5668\u540d\u79f0";var m="\u5fae\u63a7\u5668\u5c01\u88c5";var v="\u82af\u7247\u56fe\u793a";var w="\u811a\u4f4d\u914d\u7f6e";
var z="\u6a21\u7ec4\u914d\u7f6e";var B="\u591a\u5de5\u6cdb\u7528\u811a\u4f4d\u914d\u7f6e";var E="\u6682\u5b58\u5668\u914d\u7f6e"}else"Traditional Chinese"===P?(c="\u65b9\u6848",d="\u65b9\u6848\u540d\u7a31",f="\u65e5\u671f",e="\u578b\u865f",g="\u6676\u7247\u7cfb\u5217",h="\u5fae\u63a7\u5668\u540d\u7a31",m="\u5fae\u63a7\u5668\u5c01\u88dd",v="\u6676\u7247\u5716\u793a",w="\u8173\u4f4d\u914d\u7f6e",z="\u6a21\u7d44\u914d\u7f6e",B="\u591a\u5de5\u6cdb\u7528\u8173\u4f4d\u914d\u7f6e",E="\u66ab\u5b58\u5668\u914d\u7f6e"):
(c="Project",d="Project Name",f="Date",e="Part No.",g="Chip Series",h="MCU Name",m="MCU Package",v="ChipView",w="Pin Configuration",z="Module Configuration",B="GPIO Configuration",E="Register Configuration");var F="<!DOCTYPE html><html><head><title>Print Report</title></head><body>";var K=new Date;K=K.getMonth()+1+"/"+K.getDate()+"/"+K.getFullYear();F+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+
c+'</caption><tr> <td style="border: 1px solid black;">'+d+'</td> <td style="border: 1px solid black;">'+a+'</td> </tr> <tr> <td style="border: 1px solid black;">'+f+'</td> <td style="border: 1px solid black;">'+K+"</td> </tr> </table>";a=G.slicePriorToX("(");F+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+e+'</caption><tr> <td style="border: 1px solid black;">'+g+'</td> <td style="border: 1px solid black;">'+
k+'</td> </tr> <tr> <td style="border: 1px solid black;">'+h+'</td> <td style="border: 1px solid black;">'+a+'</td> </tr> <tr> <td style="border: 1px solid black;">'+m+'</td> <td style="border: 1px solid black;">'+NUTOOL_PIN.g_packageNumber+"</td> </tr></table>";F+="<br><br><br><br><br><br><br><hr>";if(null!==b){if(-1!==b.indexOf("checkbox_byChipView")){$("#panel")[0].appendChild(oa("canvas","NUC_ChipView_Canvas"));e=$("#NUC_ChipView_Canvas")[0];e.setAttribute("style","z-index:1; position:absolute; left:0px; top:0px; border: 1px solid white;");
g=195+l+40+l/4;h=170+l+40+130;e.setAttribute("width",g);e.setAttribute("height",h);e=Q.getContext(e);e.scale(.85,.85);g=195;if(-1===G.indexOf("SOP")){g-=30;e.strokeRect(g,170,l,l);e.fillStyle="white";e.fillRect(g,170,l,l);e.beginPath();e.arc(g+10,170+l-10,5,0,2*Math.PI,!0);e.stroke();c=1;do c+=1,e.font=c+'px "Arial Black", "Arial Bold", Gadget, sans-serif;';while(e.measureText("Nuvoton").width<l/2);e.fillStyle="#FE2E2E";e.fillText("Nuvoton",g+l/2-e.measureText("nuvoTon").width/2,170+l/2);a=G.slicePriorToX("(");
h=0;for(m=NUTOOL_PIN.g_cfg_chips.length;h<m;h+=1)if(NUTOOL_PIN.g_cfg_chips[h].name+"("+NUTOOL_PIN.g_cfg_chips[h].pkg+")"===G){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[h].display&&(a=NUTOOL_PIN.g_cfg_chips[h].display);break}e.fillStyle="black";h=1;do h+=1,e.font="bold "+h+"px Calibri";while(e.measureText(a).width<l/2);h>c&&(h=c,e.font="bold "+h+"px Calibri");h=h/2+10;e.fillText(a,g+l/2-e.measureText(a).width/2,170+l/2+h);c=1;do c+=1,e.font="bold "+c+"px Calibri";while(e.measureText(NUTOOL_PIN.g_packageNumber).width<
l/4);h=h+c/2+10;e.fillText(NUTOOL_PIN.g_packageNumber,g+l/2-e.measureText(NUTOOL_PIN.g_packageNumber).width/2,170+l/2+h);e.font="12px Arial";e.fillStyle="black";h=0;for(m=p/4;h<m;h+=1)a=g+20+h*(16+O),c=170+l,e.save(),e.translate(a,c),e.rotate(-Math.PI/2),e.strokeText((h+1).toString(),3,12.8),e.restore(),""!==C[h]&&(c=170+l+40,e.save(),e.translate(a,c),e.rotate(-Math.PI/2),e.textAlign="end",e.fillText(C[h],-3,12.8),e.restore()),a=g+20+h*(16+O)-1,c=170+l,e.strokeRect(a,c,16,40),e.fillStyle=D[0].savedPinPadColor[h],
e.fillRect(a,c,16,40),d=L[h],-1!==d.lastIndexOf("/")&&(d=d.slice(d.lastIndexOf("/")+1)),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),c+=40,e.font="12px Arial",e.fillStyle="black",e.save(),e.translate(a,c),e.rotate(-Math.PI/2),e.fillText(d,1,12.8),e.restore(),a=g+l,c=170+l-20-16-h*(16+O)+12.8,d=e.measureText((h+1+p/4).toString()),e.strokeText((h+1+p/4).toString(),a-d.width-3,c),""!==C[h+p/4]&&(a=g+l+40+3,e.fillText(C[h+p/4],a,c)),a=g+l,c=170+l-20-16-h*(16+O),e.strokeRect(a,
c,40,16),e.fillStyle=D[1].savedPinPadColor[h],e.fillRect(a,c,40,16),d=L[h+p/4],d=d.slicePriorToX("/"),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),e.font="12px Arial",e.fillStyle="black",e.fillText(d,a,c+12.8),a=g+l-20-16-h*(16+O)-1,c=130,e.save(),e.translate(a,c),e.rotate(-Math.PI/2),d=e.measureText((h+1+p/4*2).toString()),e.strokeText((h+1+p/4*2).toString(),-40-d.width-3,12.8),e.restore(),""!==C[h+p/2]&&(e.save(),e.translate(a,c),e.rotate(-Math.PI/2),e.fillText(C[h+
p/2],6,12.8),e.restore()),c=131,e.strokeRect(a,c,16,40),e.fillStyle=D[2].savedPinPadColor[h],e.fillRect(a,c,16,40),d=L[h+p/2],d=d.slicePriorToX("/"),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),e.font="12px Arial",e.fillStyle="black",c+=40,e.save(),e.translate(a,c),e.rotate(-Math.PI/2),e.textAlign="end",e.fillText(d,40,12.8),e.restore(),a=g+3,c=h*(16+O)+202.8,e.strokeText((h+1+p/4*3).toString(),a,c),""!==C[h+3*p/4]&&(a=g-40-3,e.save(),e.textAlign="end",e.fillText(C[h+
p/4*3],a,c),e.restore()),a=g-40+1,c=190+h*(16+O),e.strokeRect(a,c,40,16),e.fillStyle=D[3].savedPinPadColor[h],e.fillRect(a,c,40,16),d=L[h+3*p/4],-1!==d.lastIndexOf("/")&&(d=d.slice(d.lastIndexOf("/")+1)),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),e.font="12px Arial",e.fillStyle="black",e.fillText(d,a,c+12.8,40,16)}else{g-=30;e.strokeRect(g,170,l/2,l);e.fillStyle="white";e.fillRect(g,170,l/2,l);e.beginPath();e.arc(g+10,180,5,0,2*Math.PI,!0);e.stroke();c=1;do c+=1,e.font=
c+'px "Arial Black", "Arial Bold", Gadget, sans-serif;';while(e.measureText("Nuvoton").width<l/2);e.save();e.translate(g+l/4,170+l/2-e.measureText("nuvoTon").width/2);e.rotate(Math.PI/2);e.fillStyle="#FE2E2E";e.fillText("Nuvoton",0,0);e.restore();a=G.slicePriorToX("(");h=0;for(m=NUTOOL_PIN.g_cfg_chips.length;h<m;h+=1)if(NUTOOL_PIN.g_cfg_chips[h].name+"("+NUTOOL_PIN.g_cfg_chips[h].pkg+")"===G){"undefined"!==typeof NUTOOL_PIN.g_cfg_chips[h].display&&(a=NUTOOL_PIN.g_cfg_chips[h].display);break}e.fillStyle=
"black";h=1;do h+=1,e.font="bold "+h+"px Calibri";while(e.measureText(a).width<l/2);h>c&&(h=c,e.font="bold "+h+"px Calibri");h=h/2+5;e.save();e.translate(g+l/4-h,170+l/2-e.measureText(a).width/2);e.rotate(Math.PI/2);e.fillText(a,0,0);e.restore();c=1;do c+=1,e.font="bold "+c+"px Calibri";while(e.measureText(NUTOOL_PIN.g_packageNumber).width<l/4);h=h+c/2+5;e.save();e.translate(g+l/4-h,170+l/2-e.measureText(NUTOOL_PIN.g_packageNumber).width/2);e.rotate(Math.PI/2);e.fillText(NUTOOL_PIN.g_packageNumber,
0,0);e.restore();e.font="12px Arial";e.fillStyle="black";h=0;for(m=p/2;h<m;h+=1)a=g+3,c=h*(16+O)+202.8,e.strokeText((h+1).toString(),a,c),""!==C[h]&&(a=g-40-3,e.save(),e.textAlign="end",e.fillText(C[h],a,c),e.restore()),a=g-40+1,c=190+h*(16+O),e.strokeRect(a,c,40,16),e.fillStyle=D[0].savedPinPadColor[h],e.fillRect(a,c,40,16),d=L[h],-1!==d.lastIndexOf("/")&&(d=d.slice(d.lastIndexOf("/")+1)),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),e.font="12px Arial",e.fillStyle=
"black",e.fillText(d,a,c+12.8,40,16),a=g+l/2,c=170+l-20-16-h*(16+O)+12.8,d=e.measureText((h+1+p/2).toString()),e.strokeText((h+1+p/2).toString(),a-d.width-3,c),""!==C[h+p/2]&&(a=g+l/2+40+3,e.fillText(C[h+p/2],a,c)),a=g+l/2,c=170+l-20-16-h*(16+O),e.strokeRect(a,c,40,16),e.fillStyle=D[1].savedPinPadColor[h],e.fillRect(a,c,40,16),d=L[h+p/2],d=d.slicePriorToX("/"),(0!==d.indexOf("P")||2!==d.indexOf("."))&&4<d.length&&(d=d.slice(0,4)+".."),e.font="12px Arial",e.fillStyle="black",e.fillText(d,a,c+12.8)}Y||
(e=document.getElementById("NUC_ChipView_Canvas").toDataURL(),F=F+("<h4>"+v+"</h4>")+('<img src="'+e+'">')+"<hr>");$("#NUC_ChipView_Canvas").remove()}if(-1!==b.indexOf("checkbox_byPin")){v=F;e=!0;F+='<table style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="box" rules="all" ><caption style="text-align:left">'+w+"</caption>";for(w=1;w<=p;w+=1)""!==C[w-1]&&(F+='<tr><td style="border: 1px solid black;">Pin'+w+'</td> <td style="border: 1px solid black;">'+
C[w-1]+"</td></tr>",e=!1);F+="</table>";e&&(F=v)}if(-1!==b.indexOf("checkbox_byModule")){w=F;e=z;F=w;g=!0;v=[];for(z=1;z<=p;z+=1)""!==C[z-1]&&(h=z,m=g=C[z-1],-1!==m.indexOf("_")&&(m=m.slicePriorToX("_")),m=J(m),"undefined"===typeof v[m]?(v[m]=[],v[m][0]=g+"(Pin:"+h+")"):v[m].push(g+"(Pin:"+h+")"),g=!1);h=T(v);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">'+e+"</caption>";
z=0;for(m=h.length;z<m;z+=1)for(v[h[z]].sort(pa),e=0,a=v[h[z]].length;e<a;e+=1)w+='<tr><td style="border: 1px solid black;">'+h[z]+'</td> <td style="border: 1px solid black;">'+v[h[z]][e]+"</td></tr>";w+="</table>";g&&(w=F);F=w}if(-1!==b.indexOf("checkbox_byGPIO")){z=F;g=B;w=z;v=!0;F=[];for(B=1;B<=p;B+=1)""!==C[B-1]&&(e=B,v=C[B-1],h=J(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e-1]),"undefined"===typeof F[h]?(F[h]=[],F[h][0]=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e-1]+
": "+v+"(Pin:"+e+")"):F[h].push(NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][e-1]+": "+v+"(Pin:"+e+")"),v=!1);e=T(F).sort(pa);z+='<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+g+"</caption>";B=0;for(h=e.length;B<h;B+=1)for(F[e[B]].sort(pa),g=0,m=F[e[B]].length;g<m;g+=1)a=F[e[B]][g],z+='<tr><td style="border: 1px solid black;">'+a.slicePriorToX(":")+'</td> <td style="border: 1px solid black;">'+
a.sliceAfterX(": ")+"</td></tr>";z+="</table>";v&&(z=w);F=z}if(-1!==b.indexOf("checkbox_byRegister")){b=F+('<table  style="border: 10px ridge black; background-color: white;" align="left" cellpadding="5" cellspacing="5" frame="border" rules="all"><caption style="text-align:left">'+E+"</caption>");z=T(A);z.sort();E=0;for(B=z.length;E<B;E+=1)b+='<tr><td style="border: 1px solid black;">'+z[E]+'</td> <td style="border: 1px solid black;">0x'+wa(A[z[E]]).toUpperCase()+"</td></tr>";F=b+"</table>"}}F+="</body></html>";
b=window.open("dummy.htm","");b.document.open();b.document.write(F);b.document.close();b.focus();b.print();$("#printReportDialog").dialog("isOpen")&&$("#printReportDialog").dialog("destroy")}},{text:v,click:function(){$("#printReportDialog").dialog("isOpen")&&$("#printReportDialog").dialog("destroy")}}]});var n=a=v=m=b=g=e=c=a=f=null}},runAnotherTool:function(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;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="\u6267\u884cNuCAD";var f="\u9009\u62e9\u4e00\u4e2a\u5de5\u5177\u6765\u6267\u884c\u3002";var c="\u4f7f\u7528NC\u811a\u4f4d\u6765\u663e\u793a\u672a\u914d\u7f6e\u7684\u811a\u4f4d";var d="\u786e\u5b9a";var e="\u79bb\u5f00"}else"Traditional Chinese"===a?(a="\u57f7\u884cNuCAD",f="\u9078\u64c7\u4e00\u500b\u5de5\u5177\u4f86\u57f7\u884c\u3002",c="\u4f7f\u7528NC\u8173\u4f4d\u4f86\u986f\u793a\u672a\u914d\u7f6e\u7684\u8173\u4f4d",
d="\u78ba\u5b9a",e="\u96e2\u958b"):(a="Run NuCAD",f="Select a tool to run.",c="Use NC pins to present unconfigured pins",d="Confirm",e="Leave");else a="Run NuCAD",f="Select a tool to run.",c="Use NC pin to present a unconfigured pin",d="Confirm",e="Leave";ia();$('<div id="runAnotherToolDialog"><p>'+f+'</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"/>'+
c+'</label><input type="text" size="1" style="position:relative;top:-500px;"/></div>').dialog({modal:!1,draggable:!1,resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#runAnotherToolDialog").dialog("destroy")},buttons:[{text:d,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")}},{text:e,click:function(){$("#runAnotherToolDialog").dialog("isOpen")&&$("#runAnotherToolDialog").dialog("destroy")}}]});a=e=d=f=a=null}},get_pin_descriptions:function(){var a,f;Wa="Pin,Current Multi Function\n";for(a=0;a<p;a+=1){var c=""!==C[a]?NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a]+"/"+C[a]:NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a];Wa+=a+1+","+c+"\n"}Wa+="\nPin,Description\n";
for(a=0;a<p;a+=1){c="";var d=NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex][a];var e=d+":0";var g=0;for(f=NUTOOL_PIN.g_cfg_gpios.length;g<f;g+=1)if(e===NUTOOL_PIN.g_cfg_gpios[g].f[0]){f=0;for(e=NUTOOL_PIN.g_cfg_gpios[g].f.length;f<e;f+=1)c+=NUTOOL_PIN.g_cfg_gpios[g].f[f].slicePriorToX(":"),f!==NUTOOL_PIN.g_cfg_gpios[g].f.length-1&&(c+="/");break}""===c&&(c=d);Wa+=a+1+","+c+"\n"}},showPinDescriptions:function(){if($("#rootTree_Pin").is(":visible")){ba=!ba;eb();ra();lb();"none"===$("#mfpTree").css("display")?
$("#moduleTree").height(ha-$("#supportedModules").height()):($("#MCU").height(),$("#moduleTree").height(ha-$("#ChipType").height()-$("#MCU").height()-Ba-6-$("#supportedModules").height()));Xa();var a;var f=T(C);var c=0;for(a=f.length;c<a;c+=1){var d=f[c];var e=C[d];""!==e&&(d=parseInt(d,10),Ia(d,e,!1),Da(d+1,"#41AF88"))}c=0;for(a=S.length;c<a;c+=1)d=S[c],Da(d,"#FAB92D");$("#panel").css("overflow-x","scroll");$("#panel").css("overflow-y","scroll");z=100;va();Ea()}},zoomIn:Jb,bestFit:function(){$("#rootTree_Pin").is(":visible")&&
(z=kb,va())},zoomOut:Kb,uncheckAllNodes:function(){Sa(function(){vb()});Za()},uncheckAllNodes_core:vb,settings:function(){var a,f="",c="",d="",e="",g="",b,h,k,l;var n=a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if($("#rootTree_Pin").is(":visible")){if("undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:"))if(a=a.sliceAfterX("UIlanguage:").slicePriorToX("\r"),"Simplified Chinese"===a){a="\u8bbe\u5b9a";var p="1. \u4ece\u4e0b\u9762\u9009\u53d6\u4e00\u4e2a\u8bed\u8a00\u663e\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002";
var w="2. \u663e\u793a\u63d0\u793a\u6846\u3002";var r="\u82f1\u6587";var t="\u7b80\u4f53\u4e2d\u6587";var z="\u7e41\u4f53\u4e2d\u6587";var q="\u8981";var y="\u4e0d\u8981";c="checked";var x="\u786e\u5b9a";var A="\u79bb\u5f00"}else"Traditional Chinese"===a?(a="\u8a2d\u5b9a",p="1. \u5f9e\u4e0b\u9762\u9078\u53d6\u4e00\u500b\u8a9e\u8a00\u986f\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002",w="2. \u986f\u793a\u63d0\u793a\u6846\u3002",r="\u82f1\u6587",t="\u7b80\u9ad4\u4e2d\u6587",z="\u7e41\u9ad4\u4e2d\u6587",
q="\u8981",y="\u4e0d\u8981",d="checked",x="\u78ba\u5b9a",A="\u96e2\u958b"):(a="Settings",p="1. Select one of the followng languages displayed in UI.",w="2. Display a tooltip.",r="Engilsh",t="Simplified Chinese",z="Traditional Chinese",q="Yes",y="No",f="checked",x="Confirm",A="Leave");else a="Settings",p="1. Select one of the followng languages displayed in UI.",w="2. Display a tooltip.",r="Engilsh",t="Simplified Chinese",z="Traditional Chinese",q="Yes",y="No",f="checked",x="Confirm",A="Leave";"undefined"!==
typeof n&&-1!==n.indexOf("DisplayTooltip:")&&(n=n.sliceAfterX("DisplayTooltip:"),n=n.slicePriorToX("\r"),"No"===n?g="checked":e="checked");$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy");$('<div id="languageDialog"><p>'+p+'</p><input type="radio" id="engiish" value="Engilsh" name="UIlanguage" '+f+'><label for="engiish">'+r+'</label><br /><input type="radio" id="simplifiedChinese" value="Simplified Chinese" name="UIlanguage" '+c+'><label for="simplifiedChinese">'+t+'</label><br /><input type="radio" id="traditionalChinese" value="Traditional Chinese" name="UIlanguage" '+
d+'><label for="traditionalChinese">'+z+"</label><br /><p>"+w+'</p><input type="radio" id="stringYes" value="Yes" name="DisplayTooltip" '+e+'><label for="stringYes">'+q+'</label><br /><input type="radio" id="stringNo" value="No" name="DisplayTooltip" '+g+'><label for="stringNo">'+y+'</label><br /><input type="text" size="1" style="position:relative;top:-500px;"/></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:x,click:function(){$("input").each(function(){"UIlanguage"===this.name&&!0===this.checked?(P=$(this).val(),"Simplified Chinese"===P?(h="\u82af\u7247\u7cfb\u5217:",k="\u578b\u53f7:",l="MFP\u5bc4\u5b58\u5668",b="\u652f\u63f4\u6a21\u7ec4",B="\u641c\u5bfb.."):"Traditional Chinese"===P?(h="\u6676\u7247\u7cfb\u5217:",k="\u578b\u865f:",l="MFP\u6682\u5b58\u5668",b="\u652f\u63f4\u6a21\u7d44",B="\u641c\u5c0b.."):(h="Chip Series:",k="Part No.:",l="MFP Registers",b="Supported Modules",B="Search.."),
$("#ChipType_span").text(h),$("#MCU_span").text(k),$("#mfpTree").jstree("rename_node",$("#mfp_tree"),l),$("#supportedModules_span").text(b),$("#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(B),$("#searchInput_Pin").change(function(){Ya(this.value)}),Pb(),gb(),window.external.saveUIlanguage(P),k=h=B=b=null):
"DisplayTooltip"===this.name&&!0===this.checked&&(Ka=$(this).val(),window.external.saveDisplayTooltip(Ka),Na="No"===$(this).val()?!1:!0)});$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}},{text:A,click:function(){""===P&&(P="Engilsh");$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}}]});var B=b=l=k=h=a=A=x=g=e=d=c=f=y=q=z=t=r=w=p=a=null}},changeUIlanguage:function(){ta();if("Simplified Chinese"===P){var a="\u82af\u7247\u7cfb\u5217:";var f=
"\u578b\u53f7:";var c="MFP\u5bc4\u5b58\u5668";var d="\u652f\u63f4\u6a21\u7ec4";var e="\u641c\u5bfb.."}else"Traditional Chinese"===P?(a="\u6676\u7247\u7cfb\u5217:",f="\u578b\u865f:",c="MFP\u6682\u5b58\u5668",d="\u652f\u63f4\u6a21\u7d44",e="\u641c\u5c0b.."):(a="Chip Series:",f="Part No.:",d="Supported Modules",e="Search..",c="MFP Registers");$("#ChipType_span").text(a);$("#MCU_span").text(f);$("#mfpTree").jstree("rename_node",$("#mfp_tree"),c);$("#supportedModules_span").text(d);$("#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(e);$("#searchInput_Pin").change(function(){Ya(this.value)});Pb();gb();e=d=c=f=a=null},executePDFfail:function(){fa("\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(){fa("\u60a8\u7684\u7535\u8111\u4e0d\u80fd\u6267\u884cNuCAD\u56e0\u4e3a\u5b83\u4e0d\u5728content\u8d44\u6599\u5939\u91cc\u9762\u3002","\u60a8\u7684\u96fb\u8166\u4e0d\u80fd\u57f7\u884cNuCAD\u56e0\u70ba\u5b83\u4e0d\u5728content\u8cc7\u6599\u593e\u88e1\u9762\u3002","Your PC is incapable of executing NuCAD because it does not exist in the content folder.")},get_gpio_MFPsNames:function(){var a;
X="";var f=T(A);f.sort();var c=0;for(a=f.length;c<a;c+=1)X+="SYS->"+f[c]+" = 0x"+wa(A[f[c]]).toUpperCase()+"\n";La="";for(c=1;c<=p;c+=1)""!==C[c-1]?La+="Pin"+c+":"+C[c-1]+"\n":(a=L[c-1].slice(L[c-1].indexOf(da[c-1])),a=a.slicePriorToX("/"),La+="Pin"+c+":"+a+"\n");Va="";c=0;for(a=R.length;c<a;c+=1)Va+="GPIOpin:"+R[c]+"\n"},recordConfig:Za,g_readConfigFilePath:""}})();