var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(N,U,T){N instanceof String&&(N=String(N));for(var ca=N.length,X=0;X<ca;X++){var na=N[X];if(U.call(T,na,X,N))return{i:X,v:na}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(N,U,T){if(N==Array.prototype||N==Object.prototype)return N;N[U]=T.value;return N};$jscomp.getGlobal=function(N){N=["object"==typeof globalThis&&globalThis,N,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var U=0;U<N.length;++U){var T=N[U];if(T&&T.Math==Math)return T}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(N,U){var T=$jscomp.propertyToPolyfillSymbol[U];if(null==T)return N[U];T=N[T];return void 0!==T?T:N[U]};
$jscomp.polyfill=function(N,U,T,ca){U&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(N,U,T,ca):$jscomp.polyfillUnisolated(N,U,T,ca))};$jscomp.polyfillUnisolated=function(N,U,T,ca){T=$jscomp.global;N=N.split(".");for(ca=0;ca<N.length-1;ca++){var X=N[ca];if(!(X in T))return;T=T[X]}N=N[N.length-1];ca=T[N];U=U(ca);U!=ca&&null!=U&&$jscomp.defineProperty(T,N,{configurable:!0,writable:!0,value:U})};
$jscomp.polyfillIsolated=function(N,U,T,ca){var X=N.split(".");N=1===X.length;ca=X[0];ca=!N&&ca in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var na=0;na<X.length-1;na++){var ab=X[na];if(!(ab in ca))return;ca=ca[ab]}X=X[X.length-1];T=$jscomp.IS_SYMBOL_NATIVE&&"es6"===T?ca[X]:null;U=U(T);null!=U&&(N?$jscomp.defineProperty($jscomp.polyfills,X,{configurable:!0,writable:!0,value:U}):U!==T&&(void 0===$jscomp.propertyToPolyfillSymbol[X]&&(T=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[X]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(X):$jscomp.POLYFILL_PREFIX+T+"$"+X),$jscomp.defineProperty(ca,$jscomp.propertyToPolyfillSymbol[X],{configurable:!0,writable:!0,value:U})))};$jscomp.polyfill("Array.prototype.find",function(N){return N?N:function(U,T){return $jscomp.findInternal(this,U,T).v}},"es6","es3");var NUTOOL_PER={};
(function(){function N(){$("#CodeGeneratorContainer")[0].setAttribute("style","width:"+(za-ja+16)+"px; height:"+bb+"px; border: 1px solid white; position:absolute; left:"+(ja-16)+"px; top:0px; overflow-y: scroll;");$("#canvas_Peripheral").hide();$("#GenerateCode_pre").hide();0===$("#field1_canvas").length&&$("#field1").append('<canvas id="field1_canvas" width="'+(za-ja-18)+'" height="24"></canvas>');var a=$("#field1_canvas")[0].getContext("2d");var b=new Image;b.src="nuvoton.bmp";b.onload=function(){a.drawImage(b,
0,0)};0===$("#field1_anchor").length&&$("#field1").append('<a id="field1_anchor" href="PeripheralConfigure/quickstart.html" target="_blank" style="color:black;"><span id="field1_span" style="font-size:18px;font-family=arial; position: absolute; top: 35%; left: 10%;"></span></a>');Fa();-1!==Y.indexOf("Simplified")?$("#field1_span").html("\u6b22\u8fce\u6765\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u8fd9\u91cc\u914d\u7f6e\u5916\u8bbe\u529f\u80fd\u5e76\u751f\u6210\u6e90\u4ee3\u7801\u3002<br />\u73a9\u5f97\u5f00\u5fc3\uff01 (\u89c2\u770b\u5feb\u901f\u4e0a\u624b&#128214;)"):
-1!==Y.indexOf("Traditional")?$("#field1_span").html("\u6b61\u8fce\u4f86\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u9019\u88e1\u914d\u7f6e\u9031\u908a\u529f\u80fd\u4e26\u751f\u6210\u539f\u59cb\u78bc\u3002<br />\u73a9\u5f97\u958b\u5fc3\uff01 (\u89c0\u770b\u5feb\u901f\u4e0a\u624b&#128214;)"):$("#field1_span").html("Welcome to NuTool - CodeGenerator.<br />You can configure peripheral functions and generate code here.<br />Have fun! (Watch Quick Start &#128214;)")}function U(){var a,
b,c=[],g=[],h=[];c={};var f={},e={},d=[],m=[],r=$("#rootTree_Peripheral");f="";c=NUTOOL_PER.g_cfg_thirdPartyLibs;if(0===c.length)Qa=0;else{h=[];var x=0;for(a=c.length;x<a;x+=1){var v=f=c[x];-1===$.inArray(v,g)&&(g.push(v),h[v]=[]);h[v].push(f)}g.sort(qa);Qa=18*g.length;d=[];x=0;for(a=g.length;x<a;x+=1){v=g[x];if(1<h[v].length){m=[];var n=0;for(b=h[v].length;n<b;n+=1)f=h[v][n],e={},c={},c.id=f.replaceSpecialCharacters()+"_PeripheralConfigure",e.data=f,e.attr=c,m.push(e);f={};c={};c.id=v.replaceSpecialCharacters()+
"_PeripheralConfigure";f.data=v;f.attr=c;f.children=m}else f={},c={},c.id=v.replaceSpecialCharacters()+"_PeripheralConfigure",f.data=v,f.attr=c;f.state="closed";d[x]=f}if(0===$("#thirdPartyLibTree").length){r[0].appendChild(jb("div","supportedthirdPartyLibs",""));var H=$("#supportedthirdPartyLibs");H.append("<span id=supportedthirdPartyLibs_span></span>");var O=$("#supportedthirdPartyLibs_span");r[0].appendChild(jb("div","thirdPartyLibTree","Loading..."))}H[0].setAttribute("style","background-color: #FFFFFF; border-right: 16px solid #F2F2F2; border-left: 8px solid #FFFFFF; float:left; width:"+
(ja-16)+"px; height: 22px;");H.css("font-weight","bold");$thirdPartyLibTree=$("#thirdPartyLibTree");$thirdPartyLibTree[0].setAttribute("style","background-color: #FFFFFF; overflow-y: scroll; border-left: 8px solid #FFFFFF; float:left; width:"+(ja-16)+"px; height: "+Qa+"px;");Fa();-1!==Y.indexOf("Simplified")?($thirdPartyLibTree[0].innerHTML="\u8f7d\u5165\u4e2d...",O.text("\u7b2c\u4e09\u65b9\u51fd\u5f0f\u5e93")):-1!==Y.indexOf("Traditional")?($thirdPartyLibTree[0].innerHTML="\u8f09\u5165\u4e2d...",
O.text("\u7b2c\u4e09\u65b9\u51fd\u5f0f\u5eab")):($thirdPartyLibTree[0].innerHTML="Loading...",O.text("Third Party Libraries"));$thirdPartyLibTree.jstree({themes:{theme:"classic",icons:!1},json_data:{data:d},core:{animation:0},plugins:["themes","json_data","checkbox","ui"]}).bind("check_node.jstree",function(D,C){D=C.rslt.obj.attr("id");0<$("#"+D).find("li").length&&($thirdPartyLibTree.jstree("uncheck_node",$("#"+D)),$thirdPartyLibTree.jstree("open_node",$("#"+D)))}).bind("uncheck_node.jstree",function(D,
C){}).bind("select_node.jstree",function(D,C){}).bind("loaded.jstree",function(D,C){if(Ra)for(D=0,C=wb.length;D<C;D+=1)$("#thirdPartyLibTree").jstree("check_node",$("#"+wb[D].replaceSpecialCharacters()+"_PeripheralConfigure"))}).bind("destroy.jstree",function(D,C){})}}function T(){var a,b;var c=aa.slicePriorToX("(");var g=[],h=[],f={},e=[];g=[];f=[];g={};var d={};d={};var m=[];var r=[],x=$("#rootTree_Peripheral"),v=$("#ChipType_span_Peripheral"),n=$("#MCU_span_Peripheral"),H="",O="";if(!1===kb&&"undefined"!==
typeof NUTOOL_PER.g_cfg_perFunctions&&0!==NUTOOL_PER.g_cfg_perFunctions.length)g=NUTOOL_PER.g_cfg_perFunctions;else{try{external.findPerFunctionFileFromJS()}catch(t){}g=NUTOOL_PER.g_perFunctionString.split(",").sort(qa)}$.each(g,function(t,p){-1===$.inArray(p,h)&&h.push(p)});if(0!==h.length){cb=[];var D=0;for(a=h.length;D<a;D+=1)H=h[D],moduleName=H.slicePriorToX("_").slicePriorToX(".").toString(),-1===$.inArray(moduleName,f)&&(f.push(moduleName),cb[moduleName]=[]),cb[moduleName].push(H.slicePriorToX("."));
ea="";D=0;for(a=NUTOOL_PER.g_cfg_chips.length;D<a;D+=1)if(NUTOOL_PER.g_cfg_chips[D].name+"("+NUTOOL_PER.g_cfg_chips[D].pkg+")"===aa&&"undefined"!==typeof NUTOOL_PER.g_cfg_chips[D].type){ea=NUTOOL_PER.g_cfg_chips[D].type;break}if("undefined"!==typeof NUTOOL_PIN){Aa={};var C=0;for(b=NUTOOL_PIN.g_cfg_gpios.length;C<b;C+=1)f=NUTOOL_PIN.g_cfg_gpios[C].f[0].slicePriorToX(":0"),-1!==$.inArray(f,NUTOOL_PIN.g_cfg_pkgs[NUTOOL_PIN.g_packageNumberIndex])?Aa[f.replaceSpecialCharacters()]="1":Aa[f.replaceSpecialCharacters()]=
"0"}"undefined"!==typeof NUTOOL_PER.g_cfg_unusedPerFunctions&&"undefined"!==typeof NUTOOL_PER.g_cfg_unusedPerFunctions[c]&&("function"==typeof NUTOOL_PER.g_cfg_unusedPerFunctions[c]?e.push(NUTOOL_PER.g_cfg_unusedPerFunctions[c]()):e.push(NUTOOL_PER.g_cfg_unusedPerFunctions[c]));""!==ea&&"undefined"!==typeof NUTOOL_PER.g_cfg_unusedPerFunctions&&"undefined"!==typeof NUTOOL_PER.g_cfg_unusedPerFunctions[ea]&&("function"==typeof NUTOOL_PER.g_cfg_unusedPerFunctions[ea]?e.push(NUTOOL_PER.g_cfg_unusedPerFunctions[ea]()):
e.push(NUTOOL_PER.g_cfg_unusedPerFunctions[ea]));for(c=0;c<e.length;c+=1)for(f=e[c],g=va(f),D=0;D<g.length;D+=1)if("SUBSTRING"===g[D])for(C=0,b=f[g[D]].length;C<b;C+=1)for(r=f[g[D]][C],m=h.length-1;0<=m;--m)0===h[m].indexOf(r)&&h.splice(m,1);else if("FULL"===g[D])for(C=0,b=f[g[D]].length;C<b;C+=1)for(r=f[g[D]][C],-1===r.indexOf(".txt")&&(r+=".txt"),m=h.length-1;0<=m;--m)h[m]===r&&h.splice(m,1);f=[];fa=[];D=0;for(a=h.length;D<a;D+=1)H=h[D],moduleName=H.slicePriorToX("_").slicePriorToX(".").toString(),
-1===$.inArray(moduleName,f)&&(f.push(moduleName),fa[moduleName]=[]),fa[moduleName].push(H.slicePriorToX("."));f.sort(qa);m=[];D=0;for(a=f.length;D<a;D+=1){moduleName=f[D];if(1<fa[moduleName].length||-1!==fa[moduleName][0].indexOf("_")){r=[];C=0;for(b=fa[moduleName].length;C<b;C+=1)H=fa[moduleName][C],d={},g={},g.id=H+"_PeripheralConfigure",d.data=H,d.attr=g,r.push(d);d={};g={};g.id=moduleName+"_PeripheralConfigure";d.data=moduleName;d.attr=g;d.children=r}else d={},g={},g.id=moduleName+"_PeripheralConfigure",
d.data=moduleName,d.attr=g;d.state="closed";m[D]=d}if(0===$("#perFunctionTree").length){x[0].appendChild(jb("div","supportedperFunctions",""));var k=$("#supportedperFunctions");k.append("<span id=supportedperFunctions_span></span>");var I=$("#supportedperFunctions_span");x[0].appendChild(jb("div","perFunctionTree","Loading..."))}k[0].setAttribute("style","background-color: #FFFFFF; border-right: 16px solid #F2F2F2; border-left: 8px solid #FFFFFF; float:left; width:"+(ja-16)+"px; height: 22px;");k.css("font-weight",
"bold");$perFunctionTree=$("#perFunctionTree");Fa();-1!==Y.indexOf("Simplified")?(v.text("\u6676\u7247\u7cfb\u5217:"),n.text("\u578b\u53f7:"),$perFunctionTree[0].innerHTML="\u8f7d\u5165\u4e2d...",I.text("\u5916\u8bbe\u529f\u80fd")):-1!==Y.indexOf("Traditional")?(v.text("\u6676\u7247\u7cfb\u5217:"),n.text("\u578b\u865f:"),$perFunctionTree[0].innerHTML="\u8f09\u5165\u4e2d...",I.text("\u9031\u908a\u529f\u80fd")):(v.text("Chip Series:"),n.text("Part No.:"),$perFunctionTree[0].innerHTML="Loading...",I.text("Peripheral Functions"));
v.css("font-size","14px");v.css("font-weight","bold");n.css("font-size","14px");n.css("font-weight","bold");"undefined"!==typeof NUTOOL_PIN&&(O="PeripheralConfigure//");0!==Qa?$perFunctionTree[0].setAttribute("style","background-color: #FFFFFF; overflow-y: scroll; border-left: 8px solid #FFFFFF; float:left; width:"+(ja-16)+"px; height: "+(g_NUC_TreeView_Height-$("#ChipType_Peripheral").height()-$("#MCU_Peripheral").height()-$("#supportedperFunctions").height()-Qa-20)+"px;"):$perFunctionTree[0].setAttribute("style",
"background-color: #FFFFFF; overflow-y: scroll; border-left: 8px solid #FFFFFF; float:left; width:"+(ja-16)+"px; height: "+(g_NUC_TreeView_Height-$("#ChipType_Peripheral").height()-$("#MCU_Peripheral").height()-$("#supportedperFunctions").height())+"px;");$perFunctionTree.jstree({themes:{theme:"default",icons:!1,jstree_ins:!1},json_data:{data:m},core:{animation:0},plugins:["themes","json_data","checkbox","ui"]}).bind("check_node.jstree",function(t,p){var y;t=p.rslt.obj.attr("id");if(X())if(oa)if($.toast().reset("all"),
0<$("#"+t).find("li").length)$perFunctionTree.jstree("uncheck_node",$("#"+t)),$("#"+t).hasClass("jstree-closed")?$perFunctionTree.jstree("open_node",$("#"+t)):$perFunctionTree.jstree("close_node",$("#"+t));else{t!==L&&$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click();L=t;if($("#"+t).hasClass("semi-disabled"))for(moduleName=t.slicePriorToX("_"),
C=0,b=fa[moduleName].length;C<b;C+=1)p=fa[moduleName][C]+"_PeripheralConfigure",t!==p&&$("#"+p).hasClass("jstree-checked")&&$perFunctionTree.jstree("uncheck_node",$("#"+p));$("#field1_canvas").remove();$("#field1_anchor").remove();p=0;for(y=ba.length;p<y;p+=1)"undefined"!==typeof $("#"+ba[p])&&$("#"+ba[p]).hide();if("undefined"===typeof Z[t.slicePriorToX("_PeripheralConfigure")])t=t.slicePriorToX("_PeripheralConfigure"),Ga=O+W+"//"+t+".txt",na(t),ab(O+W+"//"+t+".txt",t),ca(t);else{t=t.slicePriorToX("_PeripheralConfigure");
p=0;for(y=Z[t].length;p<y;p+=1)"undefined"!==typeof $("#"+Z[t][p])&&$("#"+Z[t][p]).show();$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();$("#GenerateCode_pre").hide();$(".prettyprinted").removeClass("prettyprinted");$("#"+ha[t]).alpaca("exists")&&$("#"+ha[t]).alpaca("get").form.getButtonEl("submit").click()}}else $("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(O+W+"//"+L.slicePriorToX("_PeripheralConfigure")+
".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;$("#perFunctionTree").jstree("uncheck_node",$("#"+L))});else $("#"+t).removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}).bind("uncheck_node.jstree",function(t,p){var y,M,G=p.rslt.obj.attr("id").slicePriorToX("_PeripheralConfigure"),J=$("#field1"),K,A;var B=function(){$.toast().reset("all");y=0;for(M=ba.length;y<M;y+=1)"undefined"!==typeof $("#"+ba[y])&&$("#"+ba[y]).hide();$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();
$("#GenerateCode_pre").hide();$(".prettyprinted").removeClass("prettyprinted");0===$("#field1_canvas").length&&$("#field1").append('<canvas id="field1_canvas" width="'+(za-ja-18)+'" height="24"></canvas>');K=$("#field1_canvas")[0].getContext("2d");A=new Image;A.src="nuvoton.bmp";A.onload=function(){K.drawImage(A,0,0)};0===$("#field1_span").length&&J.append('<a id="field1_anchor" href="PeripheralConfigure/quickstart.html" target="_blank" style="color:black;"><span id="field1_span" style="font-size:18px;font-family=arial; position: absolute; top: 35%; left: 10%;"></span></a>');
Fa();-1!==Y.indexOf("Simplified")?$("#field1_span").html("\u6b22\u8fce\u6765\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u8fd9\u91cc\u914d\u7f6e\u5916\u8bbe\u529f\u80fd\u5e76\u751f\u6210\u6e90\u4ee3\u7801\u3002<br />\u73a9\u5f97\u5f00\u5fc3\uff01 (\u89c2\u770b\u5feb\u901f\u4e0a\u624b&#128214;)"):-1!==Y.indexOf("Traditional")?$("#field1_span").html("\u6b61\u8fce\u4f86\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u9019\u88e1\u914d\u7f6e\u9031\u908a\u529f\u80fd\u4e26\u751f\u6210\u539f\u59cb\u78bc\u3002<br />\u73a9\u5f97\u958b\u5fc3\uff01 (\u89c0\u770b\u5feb\u901f\u4e0a\u624b&#128214;)"):
$("#field1_span").html("Welcome to NuTool - CodeGenerator.<br />You can configure peripheral functions and generate code here.<br />Have fun! (Watch Quick Start &#128214;)");delete xa[G];delete ra[G];delete P[G];delete Q[G];delete R[G]};oa?B():($("#"+G+"_PeripheralConfigure").removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),Sa(G,function(){$("#"+G+"_PeripheralConfigure").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");Ba(O+W+"//"+G+".txt");
delete Z[G];oa=!0;B()}))}).bind("select_node.jstree",function(t,p){var y=p.rslt.obj.attr("id");if(oa){if($.toast().reset("all"),X()&&0===$("#"+y).find("li").length&&$("#"+y).hasClass("jstree-checked")){$("#field1_canvas").remove();$("#field1_anchor").remove();y!==L&&$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click();L=y;t=0;for(p=ba.length;t<p;t+=
1)"undefined"!==typeof $("#"+ba[t])&&$("#"+ba[t]).hide();if("undefined"===typeof Z[y.slicePriorToX("_PeripheralConfigure")])y=y.slicePriorToX("_PeripheralConfigure"),Ga=O+W+"//"+y+".txt",na(y),ab(O+W+"//"+y+".txt",y),ca(y);else{y=y.slicePriorToX("_PeripheralConfigure");t=0;for(p=Z[y].length;t<p;t+=1)"undefined"!==typeof $("#"+Z[y][t])&&$("#"+Z[y][t]).show();$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();$("#GenerateCode_pre").hide();$(".prettyprinted").removeClass("prettyprinted");
$("#"+ha[y]).alpaca("exists")&&$("#"+ha[y]).alpaca("get").form.getButtonEl("submit").click()}}}else Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(O+W+"//"+L.slicePriorToX("_PeripheralConfigure")+".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;$("#perFunctionTree").jstree("uncheck_node",$("#"+L))})}).bind("loaded.jstree",function(t,p){if("undefined"!==typeof NUTOOL_PER.g_cfg_perFuncMutex)for(D=0,a=NUTOOL_PER.g_cfg_perFuncMutex.length;D<a;D+=1)if(moduleName=NUTOOL_PER.g_cfg_perFuncMutex[D],
$("#"+moduleName+"_PeripheralConfigure").addClass("semi-disabled"),"undefined"!==typeof fa[moduleName]){C=0;for(b=fa[moduleName].length;C<b;C+=1)$("#"+fa[moduleName][C]+"_PeripheralConfigure").addClass("semi-disabled");$("#"+moduleName+"_PeripheralConfigure >a").css("background-color","#B0C4DE")}if(Ra&&kb){t=0;for(p=Ha.length;t<p;t+=1)na(Ha[t],"updateData"),t!==p-1?(0<$("#"+Ha[t].slicePriorToX("_").replaceSpecialCharacters()+"_PeripheralConfigure").find("li").length&&($perFunctionTree.jstree("open_node",
$("#"+Ha[t].slicePriorToX("_").replaceSpecialCharacters()+"_PeripheralConfigure")),$("#"+Ha[t].slicePriorToX("_").replaceSpecialCharacters()+"_PeripheralConfigure").removeClass("jstree-unchecked jstree-checked").addClass("jstree-undetermined")),$("#"+Ha[t].replaceSpecialCharacters()+"_PeripheralConfigure").removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked")):$("#perFunctionTree").jstree("check_node",$("#"+Ha[t].replaceSpecialCharacters()+"_PeripheralConfigure"));db=null}else Ra=
!0}).bind("destroy.jstree",function(t,p){})}}function ca(a){var b;var c="";var g="",h="",f=40;var e={};var d=Ca[a],m=null,r=null,x=null;var v=function(y){var M,G,J=[],K={},A;var B=0;for(M=d.length;B<M;B+=1)"undefined"!==typeof d[B][y]&&"none"!==d[B][y]&&""!==d[B][y]&&(k=d[B],"undefined"===typeof K[k[y]]&&(K[k[y]]=[]),K[k[y]].push(B+1),-1===J.indexOf(k[y])&&J.push(k[y]));if(0!==J.length){B=0;for(M=J.length;B<M;B+=1){var E=J[B];y=0;for(G=d.length;y<G;y+=1)Array.isArray(E)||E.toString().trim()!==d[y].id?
-1!==E.indexOf(d[y].id)&&K[E].push(y+1):K[E].push(y+1)}do{var q=!1;B=1;for(M=500;B<M;B+=1){var V=f*B;y=A=0;for(G=J.length;y<G;y+=1){E=J[y];var z=Math.max.apply(null,K[E]);if(V>=Math.min.apply(null,K[E])&&V<z){q=!1;B=M;break}A<z&&(A=z);if(y===G-1&&V>=A){q=!0;B=M;break}}}if(q)break;f+=1}while(2E4>f)}};var n=function(){var y,M,G=this.getValue(),J=va(G),K="",A=null;var B=function(){K="";z=0;for(y=d.length;z<y;z+=1)"undefined"===typeof d[z].id||"undefined"===d[z].id||-1!==$.inArray(d[z].id,Ta[a])||"multipleselect"!==
d[z].type&&"checkbox"!==d[z].type||(l=d[z].id,F="0",g=pa(g,l,F,"data:"),h=pa(h,l,F,"entireTag")),"undefined"!==typeof d[z].id&&"undefined"!==d[z].id&&-1===$.inArray(d[z].id,Ta[a])&&(l=d[z].id,F="undefined"!==typeof d[z].default?d[z].default.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/,/g,"|").trim():"NUC_NULL","undefined"!==typeof d[z].dependenciesDefault&&"true"!==d[z].dependenciesDefault&&(F="NUC_NULL"),h=pa(h,l,F,"entireTag")),"undefined"!==typeof d[z].header&&(K=d[z].header.replace(/\//g,
"\\"));if(null!==m&&"undefined"!==typeof m.ALL)if("undefined"===typeof P[a]&&(P[a]=[]),Array.isArray(m.ALL))for(u=0,M=m.ALL.length;u<M;u+=1)-1===$.inArray(m.ALL[u],P[a])&&P[a].push(m.ALL[u]);else-1===$.inArray(m.ALL,P[a])&&P[a].push(m.ALL);if(null!==r&&"undefined"!==typeof r.ALL)if("undefined"===typeof Q[a]&&(Q[a]=[]),Array.isArray(r.ALL))for(u=0,M=r.ALL.length;u<M;u+=1)-1===$.inArray(r.ALL[u],Q[a])&&Q[a].push(r.ALL[u]);else-1===$.inArray(r.ALL,Q[a])&&Q[a].push(r.ALL);if(null!==x&&"undefined"!==typeof x.ALL)if("undefined"===
typeof R[a]&&(R[a]=[]),Array.isArray(x.ALL))for(u=0,M=x.ALL.length;u<M;u+=1)-1===$.inArray(x.ALL[u],R[a])&&R[a].push(x.ALL[u]);else-1===$.inArray(x.ALL,R[a])&&R[a].push(x.ALL);Ta[a]=[];if(g!==Da){Da=g;try{external.updateSnippetFileFromJs()}catch(la){}}NUTOOL_PER.drawCanvas("canvas_Peripheral",W,Ya,a)?$("#canvas_Peripheral").show():$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();$(".prettyprinted").removeClass("prettyprinted");0===$("#GenerateCode_span").length&&$("#GenerateCode_pre").append('<span id="GenerateCode_span"></span>');
h=Bb(h);Ia&&!NUTOOL_PER.g_bFunctionalTesting&&($("#GenerateCode_span").text(h),prettyPrint(),$("#GenerateCode_pre").show());xa[a]=h;""!==K?-1!==K.indexOf(".h")?ra[a]=K:ra[a]=K+".h":ra[a]="periph_conf.h";h=g=""};var E=this.options.buttons.submit.id;var q=this.options.buttons.submit.title;E=parseInt(E.sliceAfterX("field1_sub"),10)-1;if(-1===q.indexOf("Continue")){Ga=D;h=g=Da=$.ajax({url:D,async:!1}).responseText.replace(/\r/g,"");Ya={clock:{},peripheral:{}};var V=":";var z=0;for(y=d.length;z<y;z+=1)"undefined"!==
typeof d[z].id&&(V+=d[z].id,V=z!==y-1?V+"/:":V+"/");Ya.peripheralAllIds=V;"undefined"!==typeof NUTOOL_CLOCK&&(NUTOOL_CLOCK.getGeneratedClockStatus(),Ya.clock=JSON.parse(NUTOOL_CLOCK.getg_clockRegsString1()));x=r=m=null;z=0;for(y=d.length;z<y&&("undefined"!==typeof d[z].pin&&("undefined"!==typeof d[z].pin[ea]&&(m=d[z].pin[ea]),"undefined"!==typeof d[z].pin[aa.slicePriorToX("(")]&&(m=d[z].pin[aa.slicePriorToX("(")]),null===m&&(m=d[z].pin)),"undefined"!==typeof d[z].clock&&("undefined"!==typeof d[z].clock[ea]&&
(r=d[z].clock[ea]),"undefined"!==typeof d[z].clock[aa.slicePriorToX("(")]&&(r=d[z].clock[aa.slicePriorToX("(")]),null===r&&(r=d[z].clock)),"undefined"!==typeof d[z].peripheral&&("undefined"!==typeof d[z].peripheral[ea]&&(x=d[z].peripheral[ea]),"undefined"!==typeof d[z].peripheral[aa.slicePriorToX("(")]&&(x=d[z].peripheral[aa.slicePriorToX("(")]),null===x&&(x=d[z].peripheral)),null===m||null===r||null===x);z+=1);delete P[a];delete Q[a];delete R[a]}0<=E&&(E="field1_sub"+E,"undefined"!==typeof $("#"+
E)&&0!==$("#"+E).length&&$("#"+E).alpaca("exists")&&$("#"+E).is(":visible")&&$("#"+E).alpaca("get").form.getButtonEl("submit").click());if(0<J.length){z=0;for(y=J.length;z<y;z+=1){var l=J[z];if(-1===$.inArray(l,lb[a])){Ta[a].push(l);if(null!==m&&"undefined"!==typeof m[l]&&"undefined"!==typeof m[l][G[l]])if("undefined"===typeof P[a]&&(P[a]=[]),A=m[l][G[l]],Array.isArray(A)){var u=0;for(M=A.length;u<M;u+=1)-1===$.inArray(A[u],P[a])&&P[a].push(A[u])}else-1===$.inArray(A,P[a])&&P[a].push(A);if(null!==
r&&"undefined"!==typeof r[l]&&"undefined"!==typeof r[l][G[l]])if("undefined"===typeof Q[a]&&(Q[a]=[]),A=r[l][G[l]],Array.isArray(A))for(u=0,M=A.length;u<M;u+=1)-1===$.inArray(A[u],Q[a])&&Q[a].push(A[u]);else-1===$.inArray(A,Q[a])&&Q[a].push(A);if(null!==x&&"undefined"!==typeof x[l]&&"undefined"!==typeof x[l][G[l]])if("undefined"===typeof R[a]&&(R[a]=[]),A=x[l][G[l]],Array.isArray(A))for(u=0,M=A.length;u<M;u+=1)-1===$.inArray(A[u],R[a])&&R[a].push(A[u]);else-1===$.inArray(A,R[a])&&R[a].push(A);var F=
-1===G[l].toString().indexOf(",")?G[l].toString().trim():"["+G[l].toString().replace(/,/g,", ").trim()+"]";g=pa(g,l,F,"data:");F=-1===l.toString().toLowerCase().indexOf("textonly")?G[l].toString().replace(/,/g,"|").trim():"NUC_NULL";h=pa(h,l,F,"entireTag");Ya.peripheral[l]=G[l].toString().trim()}else{var S=va(G[l]);u=0;for(M=S.length;u<M;u+=1){var w=S[u];Ta[a].push(w);if(null!==m&&"undefined"!==typeof m[w]&&"undefined"!==typeof m[w][G[l][w]])if("undefined"===typeof P[a]&&(P[a]=[]),A=m[w][G[l][w]],
Array.isArray(A))for(E=0,V=A.length;E<V;E+=1)-1===$.inArray(A[E],P[a])&&P[a].push(A[E]);else-1===$.inArray(A,P[a])&&P[a].push(A);if(null!==r&&"undefined"!==typeof r[w]&&"undefined"!==typeof r[w][G[l][w]])if("undefined"===typeof Q[a]&&(Q[a]=[]),A=r[w][G[l][w]],Array.isArray(A))for(E=0,V=A.length;E<V;E+=1)-1===$.inArray(A[E],Q[a])&&Q[a].push(A[E]);else-1===$.inArray(A,Q[a])&&Q[a].push(A);if(null!==x&&"undefined"!==typeof x[w]&&"undefined"!==typeof x[w][G[l][w]])if("undefined"===typeof R[a]&&(R[a]=[]),
A=x[w][G[l][w]],Array.isArray(A))for(E=0,V=A.length;E<V;E+=1)-1===$.inArray(A[E],R[a])&&R[a].push(A[E]);else-1===$.inArray(A,R[a])&&R[a].push(A);F=-1===G[l][w].toString().indexOf(",")?G[l][w].toString().trim():"["+G[l][w].toString().replace(/,/g,", ").trim()+"]";g=pa(g,w,F,"data:");F=-1===w.toString().toLowerCase().indexOf("textonly")?G[l][w].toString().replace(/,/g,"|").trim():"NUC_NULL";h=pa(h,w,F,"entireTag");Ya.peripheral[w]=G[l][w].toString().trim()}}}-1===q.indexOf("Continue")&&B()}else B()};
var H=function(y){var M,G,J,K=[],A=[];NUTOOL_PER.g_postRender_f1=J=function(z,l){var u,F;"undefined"===typeof z&&(z="NUC_NONE");if(NUTOOL_PER.g_bFunctionalTesting){if("undefined"===typeof K[l])return;var S=K[l]}else S=A[this.propertyId];l=0;for(u=d.length;l<u;l+=1){var w=0;for(F=S.length;w<F;w+=1)if(d[l].id===S[w]){var la=va(d[l].listener);w=0;for(F=la.length;w<F;w+=1){var ia=la[w].replace(/\s/g,"").split(",");if(ia.toString()===z.toString()||"NUC_ANY"===ia.toString()&&"NUC_NONE"!==z){w=d[l].listener[la[w]];
-1!==w.indexOf(",")&&(w=w.replace(/\s/g,""),0===w.indexOf("[")&&(w=w.slice(1)),w.lastIndexOf("]")+1===w.length&&(w=w.slicePriorToLastX("]")));E="undefined"!==typeof d[l].groupId&&"none"!==d[l].groupId&&""!==d[l].groupId?y.childrenByPropertyId[d[l].groupId].childrenByPropertyId[d[l].id]:y.childrenByPropertyId[d[l].id];E.setValue(w);E.refresh();break}}break}}};NUTOOL_PER.g_postRender_control=y;"Continue"!==y.options.form.buttons.submit.title&&Ia||y.form.getButtonEl("submit").hide();"Continue"!==y.options.form.buttons.submit.title&&
y.form.getButtonEl("submit").click();Ua+=1;0<wa.length&&Ua<wa.length&&$(wa[Ua].holder).alpaca(wa[Ua]);var B=0;for(M=d.length;B<M;B+=1)if("undefined"!==typeof d[B].observable&&"none"!==d[B].observable&&""!==d[B].observable){try{var E="undefined"!==typeof d[B].groupId&&"none"!==d[B].groupId&&""!==d[B].groupId?y.childrenByPropertyId[d[B].groupId].childrenByPropertyId[d[B].id]:y.childrenByPropertyId[d[B].id]}catch(z){}var q=0;for(G=d.length;q<G;q+=1)try{if(d[q].id===d[B].observable){var V="undefined"!==
typeof d[q].groupId&&"none"!==d[q].groupId&&""!==d[q].groupId?y.childrenByPropertyId[d[q].groupId].childrenByPropertyId[d[B].observable]:y.childrenByPropertyId[d[B].observable];break}}catch(z){}"undefined"!==typeof E&&"undefined"!==typeof V&&(E.subscribe(V,J),"undefined"===typeof K[d[B].observable]&&(K[d[B].observable]=[]),K[d[B].observable].push(d[B].id))}for(V in K)K.hasOwnProperty(V)&&(A[K[V][0]]=K[V])};var O=NUTOOL_PER.g_bFunctionalTesting?function(){}:function(){var y,M,G=!1,J,K,A;var B=null!==
this.getValue()?this.getValue().toString().replace(/,/g,", ").trim():"";Ea={};var E=0;for(y=d.length;E<y;E+=1)if(d[E].id===this.propertyId&&"undefined"!==d[E].changeEvent){var q=d[E].changeEvent;for(J in q)if(q.hasOwnProperty(J)&&J!==a){Ea[J]={};for(K in q[J])if(q[J].hasOwnProperty(K))if("undefined"!==typeof q[J][K][B])G=!0,Ea[J][K]=q[J][K][B];else if(""!==B)for(A in q[J][K]){if(q[J][K].hasOwnProperty(A)&&"NUC_ANY"===A){G=!0;Ea[J][K]=q[J][K].NUC_ANY;break}}else if(""===B)for(A in q[J][K])if(q[J][K].hasOwnProperty(A)&&
"NUC_NONE"===A){G=!0;Ea[J][K]=q[J][K].NUC_NONE;break}if(G&&(na(J,"updateData"),na(J,"updateDataOfObservable"),delete xa[J],"undefined"!==typeof Z[J])){var V=0;for(M=Z[J].length;V<M;V+=1)"undefined"!==typeof $("#"+Z[J][V])&&$("#"+Z[J][V]).alpaca("exists")&&($("#"+Z[J][V]).alpaca("destroy"),$("#"+Z[J][V]).remove());delete Z[J]}}}$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click()};
"undefined"!==typeof NUTOOL_PIN&&(c="PeripheralConfigure//");var D=c+W+"//"+a+".txt";NUTOOL_PER.g_bFunctionalTesting?f=1E7:(v("groupId"),v("observable"),v("dependencies"));e=Math.ceil(d.length/f);$("#field1_canvas").remove();$("#field1_anchor").remove();c=0;for(v=ba.length;c<v;c+=1)"undefined"!==typeof $("#"+ba[c])&&$("#"+ba[c]).hide();Ua=0;wa=[];Z[a]=[];c=0;for(v=e;c<v;c+=1,Ja+=1){$("#field1").append('<div id="field1_sub'+Ja+'"></div>');ba.push("field1_sub"+Ja);Z[a].push("field1_sub"+Ja);var C=(c+
1)*f<d.length?(c+1)*f:d.length;e={data:{}};for(b=c*f;b<C;b+=1){var k=d[b];if("undefined"!==typeof k.data){var I=k.id;if("undefined"!==typeof k.groupId&&"none"!==k.groupId&&""!==k.groupId){var t=k.groupId;e.data.hasOwnProperty(t)||(e.data[t]={});e.data[t][I]=k.data}else e.data[I]=k.data}}e.schema={};0===c&&(e.schema.title="Nuvoton Peripheral Configure",e.schema.helper="We can configure the IP details easily and correctly.");e.schema.type="object";e.schema.properties={};for(b=c*f;b<C;b+=1)if(k=d[b],
I=k.id,"undefined"!==typeof k.type){var p={};p.id=I;"select"===k.type||"radio"===k.type?(p.type="string",p.title=k.label,p.enum=k.enum):"multipleselect"===k.type?(p.type="string",p.title=k.label,p.enum=k.enum):"checkbox"===k.type?(p.type="string","undefined"===typeof k.enum&&(k.enum=[],k.enum.push(!0)),"undefined"===typeof k.optionLabels&&(k.optionLabels=[],k.optionLabels.push("<br>")),p.enum=k.enum):"checkboxBoolean"===k.type?p.type="boolean":"integer"===k.type?("none"!==k.minimum&&""!==k.minimum&&
(p.minimum=k.minimum),"none"!==k.maximum&&""!==k.maximum&&(p.maximum=k.maximum)):"hextext"===k.type?(p.format="ip-address","none"!==k.minimum&&""!==k.minimum&&(p.minimumHex=k.minimum),"none"!==k.maximum&&""!==k.maximum&&(p.maximumHex=k.maximum)):"textonly"===k.type?p.type="string":"hidden"===k.type&&(p.type="string");"undefined"!==typeof k.default&&(p.default=k.default);"undefined"!==typeof k.dependencies&&"none"!==k.dependencies&&""!==k.dependencies&&(p.dependencies=k.dependencies);"undefined"!==
typeof k.groupId&&"none"!==k.groupId&&""!==k.groupId?(t=k.groupId,e.schema.properties.hasOwnProperty(t)||(e.schema.properties[t]={},e.schema.properties[t].type="object",e.schema.properties[t].properties={},lb[a].push(t)),e.schema.properties[t].properties[I]=p):e.schema.properties[I]=p}e.options={};e.options.focus="";e.options.fields={};for(b=c*f;b<C;b+=1)k=d[b],I=k.id,"undefined"!==typeof k.type&&(p={events:{}},"select"===k.type&&(p.type=k.type,p.helper=k.helper,p.sort="true"===k.sort,p.hideNone=
!0,p.optionLabels=k.optionLabels,p.events.change=O),"radio"===k.type?(p.type=k.type,p.helper=k.helper,p.sort="true"===k.sort,p.hideNone=!0,p.optionLabels=k.optionLabels,p.vertical="true"===k.vertical,p.events.click=O):"checkbox"===k.type?(p.type=k.type,p.label=k.label,p.helper=k.helper,"undefined"!==typeof k.enum&&1===k.enum.length&&"undefined"!==typeof k.optionLabels&&1===k.optionLabels.length&&""===k.optionLabels[0]&&(k.optionLabels[0]="<br>"),p.optionLabels=k.optionLabels,p.sort="true"===k.sort,
p.events.change=O):"checkboxBoolean"===k.type?(p.type="checkbox",p.rightLabel=k.label,p.helper=k.helper,p.events.change=O):"multipleselect"===k.type?(p.type="select",p.label=k.label,p.helper=k.helper,p.size=k.size,p.sort="true"===k.sort,p.removeDefaultNone=!0,p.validate=!1,p.multiple=!0,p.optionLabels=k.optionLabels,p.events.change=O):"integer"===k.type?(p.type=k.type,p.label=k.label,p.helper=k.helper,"undefined"!==typeof k.validate&&(p.validate="true"===k.validate),p.events.change=O):"hextext"===
k.type?(p.label=k.label,p.helper=k.helper,"undefined"!==typeof k.validate&&(p.validate="true"===k.validate),p.events.change=O):"textonly"===k.type?(p.type="textarea",p.label=k.label,p.helper=k.helper,p.view="bootstrap-display"):"hidden"===k.type&&(p.type=k.type),"undefined"!==typeof k.dependenciesOption&&"none"!==k.dependenciesOption&&""!==k.dependenciesOption&&("string"===typeof k.dependenciesOption||k.dependenciesOption instanceof String?(p.dependencies={},p.dependencies[k.dependencies]=k.dependenciesOption):
"object"===typeof k.dependenciesOption&&k.dependenciesOption instanceof Array?(p.dependencies={},p.dependencies[k.dependencies]=k.dependenciesOption.toString()):p.dependencies=k.dependenciesOption),"undefined"!==typeof k.groupId&&"none"!==k.groupId&&""!==k.groupId?(t=k.groupId,e.options.fields.hasOwnProperty(t)||(e.options.fields[t]={},e.options.fields[t].type="object",e.options.fields[t].label=k.groupName,e.options.fields[t].fields={}),e.options.fields[t].fields[I]=p):e.options.fields[I]=p);e.options.form=
{};e.options.form.buttons={};e.options.form.buttons.submit={};c!=v-1?e.options.form.buttons.submit.title="Continue":(e.options.form.buttons.submit.title="Generate Code",ha[a]="field1_sub"+Ja);e.options.form.buttons.submit.click=n;e.options.form.buttons.submit.id="field1_sub"+Ja;e.postRender=H;e.holder="#field1_sub"+Ja;$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();$("#GenerateCode_pre").hide();$(".prettyprinted").removeClass("prettyprinted");wa.push(e)}0<wa.length&&$(wa[0].holder).alpaca(wa[0])}
function X(){if(0<wa.length&&Ua<wa.length){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:")?(a=a.sliceAfterX("UIlanguage:"),a=a.slicePriorToX("\r"),a="Simplified Chinese"===a?"\u672c\u8f6f\u4ef6\u76ee\u524d\u6b63\u5728\u5fd9\u788c\u4e2d\u3002\u8bf7\u7a0d\u540e\u518d\u8bd5...":"Traditional Chinese"===a?"\u672c\u8edf\u4ef6\u76ee\u524d\u6b63\u5728\u5fd9\u788c\u4e2d\u3002\u8acb\u7a0d\u5f8c\u518d\u8a66...":"The tool is currently busy. Please try again later..."):
a="The tool is currently busy. Please try again later...";$.toast().reset("all");$.toast({text:a,icon:"warning",position:"mid-center"});return!1}return!0}function na(a,b){var c,g,h="",f=[];var e=0;var d,m;"undefined"===typeof b&&(b="updateDefault");"undefined"!==typeof NUTOOL_PIN&&(h="PeripheralConfigure//");h=h+W+"//"+a+".txt";try{originalReadConfigFile=saved_newReadConfigFile=c=$.ajax({url:h,async:!1}).responseText.replace(/\r/g,"")}catch(O){return}for(c=c.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");-1!==
c.indexOf("<!");){var r=c.sliceBetweenXandX("<!","!>").replace(/\r?\n|\r/g,"");var x={};for(d=0;-1!==r.indexOf(";");){var v=r.slicePriorToX(";").trim();var n=v.sliceAfterX(":").trim();v=v.slicePriorToX(":").replace(/\s/g,"");if(("id"===v||"default"===v||"data"===v||"observable"===v||"listener"===v)&&""!==n)if(-1!==n.indexOf("{")&&-1!==n.indexOf("}"))x[v]=JSON.parse(n.replace(/'/g,'"').trim());else if(-1===n.indexOf("["))x[v]=n.replace(/"/g," ").trim();else{if(-1===n.indexOf('"')){n=n.sliceAfterX("[");
var H=[];for(m=0;(-1!==n.indexOf(",")||-1!==n.indexOf("]"))&&!(-1!==n.indexOf(",")?(H.push(n.slicePriorToX(",").toString().trim()),n=n.sliceAfterX(",")):(H.push(n.slicePriorToX("]").toString().trim()),n=""),2E3<m);)m+=1}else H=JSON.parse(n);x[v]=H}r=r.sliceAfterX(";");if(2E3<d)break;else d+=1}$.isEmptyObject(x)||f.push(x);c=c.sliceAfterX(">");if(2E3<e)break;else e+=1}c=0;for(r=f.length;c<r;c+=1){if("updateDefault"===b&&"undefined"!==typeof f[c].observable)for(e=0,x=f.length;e<x;e+=1)if(f[e].id===
f[c].observable&&"undefined"!==typeof f[e].default)if("undefined"!==typeof f[c].listener[f[e].default])saved_newReadConfigFile=pa(saved_newReadConfigFile,f[c].id,f[c].listener[f[e].default],"default:");else if(""!==f[e].default)for(g in f[c].listener)if(f[c].listener.hasOwnProperty(g)&&"NUC_ANY"===g){saved_newReadConfigFile=pa(saved_newReadConfigFile,f[c].id,f[c].listener.NUC_ANY,"default:");break}"updateData"===b&&"undefined"!==typeof Ea[a]&&"undefined"!==typeof Ea[a][f[c].id]&&-1===f[c].id.toLowerCase().indexOf("textonly")&&
(saved_newReadConfigFile=pa(saved_newReadConfigFile,f[c].id,Ea[a][f[c].id],"data:"));if("updateDataOfObservable"===b&&"undefined"!==typeof f[c].observable)for(e=0,x=f.length;e<x;e+=1)if(f[e].id===f[c].observable&&"undefined"!==typeof f[e].data)if("undefined"!==typeof f[c].listener[f[e].data])saved_newReadConfigFile=pa(saved_newReadConfigFile,f[c].id,f[c].listener[f[e].data],"data:");else if(""!==f[e].data)for(g in f[c].listener)if(f[c].listener.hasOwnProperty(g)&&"NUC_ANY"===g){saved_newReadConfigFile=
pa(saved_newReadConfigFile,f[c].id,f[c].listener.NUC_ANY,"data:");break}}Ga=h;Da=saved_newReadConfigFile;if(saved_newReadConfigFile!==originalReadConfigFile)try{external.updateSnippetFileFromJs()}catch(O){}Da=""}function ab(a,b){var c=aa.slicePriorToX("("),g=ea,h={},f=[],e=0,d=0,m=0,r,x,v,n,H;var O=function(p,y){x=!1;for(v in p)if(p.hasOwnProperty(v))if(0===v.indexOf("NUC_OR")){H=[];for(n in p[v])if(p[v].hasOwnProperty(n)){try{t=compileExpression(n)}catch(M){}t(y)&&(x=!0,H.push(p[v][n]))}if(x){H=
H.map(String);break}}else if(0===v.indexOf("NUC_AND")){x=!0;H=[];for(n in p[v])if(p[v].hasOwnProperty(n)){try{t=compileExpression(n)}catch(M){}if(t(y))H.push(p[v][n]);else{x=!1;H=[];break}}if(x){H=H.map(String);break}}else{try{t=compileExpression(v)}catch(M){}if(t(y)){x=!0;H=p[v].map(String);break}}x||(H="undefined"!==typeof p.NUC_ANY?p.NUC_ANY.map(String):"none");return H};try{var D=$.ajax({url:a,async:!1}).responseText.replace(/\r/g,"").replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}catch(p){return}lb[b]=
[];Ta[b]=[];for(Ca[b]=[];-1!==D.indexOf("<!");){a=D.sliceBetweenXandX("<!","!>").replace(/\r?\n|\r/g,"");var C={};for(d=0;-1!==a.indexOf(";");){var k=a.slicePriorToX(";").trim();var I=k.sliceAfterX(":").trim();k=k.slicePriorToX(":").replace(/\s/g,"");if(-1!==I.indexOf("{")&&-1!==I.indexOf("}"))C[k]=JSON.parse(I.replace(/'/g,'"').trim());else if(-1===I.indexOf("["))-1===k.indexOf("filterExp")?C[k]=I.replace(/"/g," ").trim():C[k]=I.trim();else{if(-1===I.indexOf('"'))for(I=I.sliceAfterX("["),f=[],m=
0;(-1!==I.indexOf(",")||-1!==I.indexOf("]"))&&!(-1!==I.indexOf(",")?(f.push(I.slicePriorToX(",").toString().trim()),I=I.sliceAfterX(",")):(f.push(I.slicePriorToX("]").toString().trim()),I=""),2E3<m);)m+=1;else f=JSON.parse(I);C[k]=f}a=a.sliceAfterX(";");if(2E3<d)break;else d+=1}"undefined"!==typeof C.filter&&(h=C.filter);"undefined"!==typeof h[c]?h="function"==typeof h[c]?h[c]():h[c]:"undefined"!==typeof h[g]&&(h="function"==typeof h[g]?h[g]():h[g]);h.name=c;""!==g&&(h.type=g);for(r in Aa)Aa.hasOwnProperty(r)&&
(h[r]=Aa[r]);if("undefined"!==typeof C.filterExp&&"none"!==C.filterExp&&""!==C.filterExp){try{var t=compileExpression(C.filterExp)}catch(p){}t(h)||(C={})}$.isEmptyObject(C)||("undefined"!==typeof C.default&&_.isObject(C.default)&&!Array.isArray(C.default)&&(C.default=O(C.default,h)),"undefined"!==typeof C.enum&&_.isObject(C.enum)&&!Array.isArray(C.enum)&&(C.enum=O(C.enum,h)),"undefined"!==typeof C.optionLabels&&_.isObject(C.optionLabels)&&!Array.isArray(C.optionLabels)&&(C.optionLabels=O(C.optionLabels,
h)),Ca[b].push(C));D=D.sliceAfterX(">");if(2E3<e)break;else e+=1}}function Jb(a){var b=[];var c=[],g=[],h={},f=0,e;try{var d=$.ajax({url:a,async:!1}).responseText.replace(/\r/g,"").replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}catch(x){return}for(;-1!==d.indexOf("<!");){a=d.sliceBetweenXandX("<!","!>").replace(/\r?\n|\r/g,"");if(-1!==a.indexOf("data"))for(e=0;-1!==a.indexOf(";");){var m=a.slicePriorToX(";");var r=m.sliceAfterX(":").trim();m=m.slicePriorToX(":").replace(/\s/g,"");if("id"===m)if(-1===b.indexOf(r))c.push(r),
b.push(r);else break;if("data"===m){g.push(r);break}a=a.sliceAfterX(";");if(2E3<e)break;else e+=1}d=d.sliceAfterX(">");if(2E3<f)break;else f+=1}d=0;for(b=c.length;d<b;d+=1)h[c[d]]=g[d];return h}function Ba(a){var b,c,g=a.sliceAfterX("//").sliceBetweenXandX("//",".txt"),h=[],f=[],e=0,d;try{var m=c=b=$.ajax({url:a,async:!1}).responseText.replace(/\r/g,"")}catch(n){return}for(b=b.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");-1!==b.indexOf("<!");){var r=b.sliceBetweenXandX("<!","!>").replace(/\r?\n|\r/g,"");
if(-1!==r.indexOf("default"))for(d=0;-1!==r.indexOf(";");){var x=r.slicePriorToX(";");var v=x.sliceAfterX(":").trim();x=x.slicePriorToX(":").replace(/\s/g,"");"id"===x&&h.push(v);if("default"===x){if("undefined"!==typeof Ca[g]&&-1!==v.indexOf("{")&&-1!==v.indexOf("}"))for(r=0,x=Ca[g].length;r<x;r+=1)if(Ca[g][r].id===h[h.length-1]){v=Ca[g][r].default;break}f.push(v);break}r=r.sliceAfterX(";");if(2E3<d)break;else d+=1}b=b.sliceAfterX(">");if(2E3<e)break;else e+=1}r=0;for(x=h.length;r<x;r+=1)"undefined"!==
typeof f[r]&&-1===f[r].indexOf("{")&&-1===f[r].indexOf("}")&&(c=pa(c,h[r],f[r],"data:"));Ga=a;Da=c;if(Da!==m)try{external.updateSnippetFileFromJs()}catch(n){}Da=""}function pa(a,b,c,g){var h=0;var f=0;var e;do{h++;var d=a.indexOf("<!id:"+b+";",f);if(-1!==d){f=-1;for(e=0;-1<(e=a.indexOf("!>",e));){if(e>d){f=e;break}e+=1}if(-1!==f){if("entireTag"===g){""!==c&&("NUC_NULL"===c?c="":"true"===c.toString().toLowerCase()?c="1":"false"===c.toString().toLowerCase()&&(c="0"));d=a.slice(0,d)+c+a.slice(f+2);break}else{var m=
a.slice(d,f+2);e=m.indexOf(g);if(-1!==e){var r=m.slice(e+g.length).sliceAfterX(";");m=m.slice(0,e+g.length);d=a.slice(0,d)+m+c+";"+r+a.slice(f+2)}else d=a}a=d;f+=1}else{d=a;break}}else{d=a;break}}while(1E3>h);return d}function Bb(a){var b,c,g,h,f,e=["<!","<#"],d=["!>","##>"];var m=0;for(b=e.length;m<b;m+=1){var r=e[m];var x=d[m];for(h=0;-1!==(c=a.indexOf(r));){var v=-1;for(g=0;-1<(g=a.indexOf(x,g));){if(g>c){v=g;break}g+=1}if(-1!==v){var n="";g=a.slice(c).sliceBetweenXandX("<!","!>").replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,
"").replace(/\r?\n|\r/g,"");for(f=0;-1!==g.indexOf(";");){var H=g.slicePriorToX(";");var O=H.sliceAfterX(":").trim();H=H.slicePriorToX(":").replace(/\s/g,"");"default"===H&&(n=O);if("filterDefault"===H&&"false"===O.toString().toLowerCase()){n="";break}g=g.sliceAfterX(";");if(2E3<f)break;else f+=1}n=n.replace(/\[/g,"").replace(/\]/g,"").replace(/,/g,"|").trim();a=a.slice(0,c)+n+a.slice(v+x.length)}if(2E3<h)break;else h+=1}}return a}function xb(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;
"undefined"!==typeof a&&-1!==a.indexOf("DialogSize:")?(a=a.sliceAfterX("DialogSize:X_"),za=parseInt(a.slicePriorToX("Y_"),10),bb=parseInt(a.sliceBetweenXandX("Y_","\r"),10)):(za=893,bb=590);g_NUC_TreeView_Height=bb-16;ja=230;"undefined"!==typeof a&&-1!==a.indexOf("DevelopingTool:")&&(a=a.sliceAfterX("DevelopingTool:").slicePriorToX("\r"),-1!==a.toString().toLowerCase().indexOf("yes")&&(Ia=!0))}function Kb(a){var b=a;if(""!==a&&"undefined"!==typeof a){for(;-1!==a.indexOf("ThirdPartyLibs:");)a=a.sliceAfterX("ThirdPartyLibs:").slicePriorToX("\r"),
wb=a.split("/"),a=a.slice(1);for(a=b;-1!==a.indexOf("PeripheralFunctions:");)a=a.sliceAfterX("PeripheralFunctions:").slicePriorToX("\r"),Ha=a.split("/"),a=a.slice(1);for(a=b;-1!==a.indexOf("PeripheralFunctionData:");)a=a.sliceAfterX("PeripheralFunctionData:").slicePriorToX("\r"),Ea=-1!==a.indexOf("{")?JSON.parse(a):{},a=a.slice(1)}}function jb(a,b,c,g){g?(g=document.createElement("input"),g.value=c,g.type=a):(g=document.createElement(a),g.innerHTML=c);g.id=b;return g}function Va(){$("#warningDialog").is(":visible")&&
$("#warningDialog").dialog("destroy");$("#warningForUncheckNodeDialog").is(":visible")&&$("#warningForUncheckNodeDialog").dialog("destroy");$("#languageDialog").is(":visible")&&$("#languageDialog").dialog("destroy");$("#generateCodeDialog").is(":visible")&&$("#generateCodeDialog").dialog("destroy")}function sa(a,b,c){var g="js"===c?"src":"css"===c?"href":"none",h=window.document.getElementsByTagName("js"===c?"script":"css"===c?"link":"none"),f=null;"undefined"!==typeof NUTOOL_PIN&&"js"===c&&(a="PeripheralConfigure/"+
a,b="PeripheralConfigure/"+b);if("PeripheralConfigure/"!==b){f=b;if("js"===c){var e=document.createElement("script");e.setAttribute("type","text/javascript");e.setAttribute("src",f)}else"css"===c&&(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",f));f=e}for(c=h.length;0<=c;--c)h[c]&&null!==h[c].getAttribute(g)&&(h[c].getAttribute(g)===a?h[c].parentNode.removeChild(h[c]):h[c].getAttribute(g)===b&&""!==b&&h[c].parentNode.removeChild(h[c]));
null!==f&&h[0].parentNode.appendChild(f)}function Cb(){var a,b=$("#MCUselect_Peripheral"),c={},g=[],h=!1,f="",e="";0<b.children().length&&b.children().remove();var d=0;for(a=NUTOOL_PER.g_cfg_chips.length;d<a;d+=1)try{g[g.length]=NUTOOL_PER.g_cfg_chips[d].name+"("+NUTOOL_PER.g_cfg_chips[d].pkg+")"}catch(m){}g.sort(qa);d=0;for(a=g.length;d<a;d+=1)c=document.createElement("option"),c.id=c.innerHTML=c.value=g[d],b[0].appendChild(c);d=0;for(a=NUTOOL_PER.g_cfg_chips.length;d<a;d+=1)if(NUTOOL_PER.g_cfg_chips[d].name+
"("+NUTOOL_PER.g_cfg_chips[d].pkg+")"===aa){h=!0;break}h?b.val(aa):b.val($("#MCUselect_Peripheral option:first-child").val()).change();b.on("focus",function(){f=this.value}).on("change",function(){oa?Wa!==$(this).val()&&(Wa=$(this).val(),setTimeout(Lb,0)):("undefined"!==typeof NUTOOL_PIN&&(e="PeripheralConfigure//"),$(this).val(f),Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(e+W+"//"+L.slicePriorToX("_PeripheralConfigure")+".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;
$("#perFunctionTree").jstree("uncheck_node",$("#"+L))}))});a=d=null;g=[];b=h=c=null}function Lb(){if(Wa!==aa){"undefined"!==typeof NUTOOL_PIN&&(NUTOOL_PIN.setg_selectedPartNoValue(Wa),NUTOOL_CLOCK.setg_selectedPartNoValue(Wa),NUTOOL_PIN.loadPinConfigureTool_fromSelectionGuide(),NUTOOL_CLOCK.loadClockConfigureTool_fromSelectionGuide());try{external.updateCurrentDialogSize()}catch(b){}var a=W;W=yb(Wa);sa("NUC_"+a+"_Content.js","NUC_"+W+"_Content.js","js");Ra=!1;aa=Wa;Db();NUTOOL_PER.g_readConfigFilePath=
"dummyPath";U();T();N();try{external.changeDialogCaptionFromJS("NuTool - CodeGenerator_"+NUTOOL_PER.g_toolVersion)}catch(b){}}}function Eb(){var a,b=$("#ChipTypeSelect_Peripheral"),c="",g="";$("#ChipType_Peripheral")[0].setAttribute("style","background-color: #FFFFFF; width:"+(ja-16)+"px; border-left: 8px solid #FFFFFF; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");$("#MCU_Peripheral")[0].setAttribute("style","background-color: #FFFFFF; width:"+(ja-16)+"px; border-left: 8px solid #FFFFFF; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");
var h=0;for(a=mb.length;h<a;h+=1){var f=document.createElement("option");try{f.id=f.innerHTML=f.value=mb[h]}catch(e){}b[0].appendChild(f)}b.val(zb(W));Cb();b.on("focus",function(){c=this.value}).on("change",function(){if(!oa)"undefined"!==typeof NUTOOL_PIN&&(g="PeripheralConfigure//"),$(this).val(c),Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(g+W+"//"+L.slicePriorToX("_PeripheralConfigure")+".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;$("#perFunctionTree").jstree("uncheck_node",
$("#"+L))});else if(W!=$(this).val()){var e="NUC_"+W+"_Content.js";W=Mb($(this).val());sa(e,"NUC_"+W+"_Content.js","js");Cb()}});b=f=a=h=null}function yb(a){-1===a.indexOf("(")&&(a+="(");return 0===a.indexOf("M0564")?"M0564":Ia&&0===a.indexOf("NUC122ZD2AN")||0===a.indexOf("NUC122ZC1AN")||0===a.indexOf("NUC122LD2AN")?"DEMO":0===a.indexOf("M45")||0===a.indexOf("M4TK")?"M451":0===a.indexOf("M48")?"M480":0===a.indexOf("M253")?"M253":0===a.indexOf("M25")?"M251":0===a.indexOf("M2351")?"M2351":0===a.indexOf("M030G")||
0===a.indexOf("M031G")?"M030GM031G":0===a.indexOf("M030")||0===a.indexOf("M031")||0===a.indexOf("M032")?"M031":0===a.indexOf("M0518")?"M0518":0===a.indexOf("M0519")?"M0519":0===a.indexOf("M05")&&-1!==a.indexOf("DN(")?"M051DN":0===a.indexOf("M05")&&-1!==a.indexOf("DE(")?"M051DE":0===a.indexOf("MHC54ZDN")||0===a.indexOf("PL054TDN")?"M051DN":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("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("NUC2")&&-1!==a.indexOf("AN(")?"NUC200AN":0===a.indexOf("NUC2")&&-1!==a.indexOf("AE(")?"NUC200AE":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("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("AE0(")&&-1===a.indexOf("AE1(")&&-1===a.indexOf("AN0(")&&-1===a.indexOf("AN1(")?0===a.indexOf("NUC1")&&-1!==a.indexOf("AN(")?"NUC100AN":0===a.indexOf("NUC1")&&-1!==a.indexOf("BN(")?"NUC100BN":0===a.indexOf("NUC1")&&-1!==a.indexOf("CN(")?"NUC100CN":0===a.indexOf("NUC1")&&-1!==a.indexOf("DN(")?"NUC100DN":0===a.indexOf("NUC1262")?"NUC1262":0===a.indexOf("NUC126")?"NUC126":0===a.indexOf("NUC13")?"NUC131":0===a.indexOf("NUC505")?
"NUC505":0===a.indexOf("I91")?"ISD9100":0===a.indexOf("I93")?"ISD9300":"NUC400":"NUC123AN_AE":"NANO100BN":"NANO100AN"}function Mb(a){var b=a;"NUC200"===a?b="NUC200AN":"NANO100"===a?b="NANO100AN":"NUC100"===a?b="NUC1262":"M030G"===a?b="M030GM031G":"M031"===a?b="M031":"M051"===a?b="M051DE":"MINI51"===a?b="MINI55":"NUC029"===a&&(b="NUC029AE");return b}function zb(a){var b=a;"NUC200AN"===a?b="NUC200":"NUC200AE"===a?b="NUC200":"NANO100AN"===a?b="NANO100":"NANO100BN"===a?b="NANO100":"NANO103"===a?b="NANO100":
"NANO112"===a?b="NANO100":"NUC100AN"===a?b="NUC100":"NUC100BN"===a?b="NUC100":"NUC100CN"===a?b="NUC100":"NUC100DN"===a?b="NUC100":"NUC131"===a?b="NUC100":"NUC121AE"===a?b="NUC100":"NUC123AN_AE"===a?b="NUC100":"NUC122AN"===a?b="NUC100":0===a.indexOf("NUC126")?b="NUC100":0===a.indexOf("M030G")?b="M030G":0===a.indexOf("M03")?b="M031":"M051BN"===a?b="M051":"M051DN"===a?b="M051":"M051DE"===a?b="M051":"M051AN"===a?b="M051":"M058S"===a?b="M051":"MINI51AN"===a?b="MINI51":"MINI51DE"===a?b="MINI51":"MINI55"===
a?b="MINI51":"MINI58"===a?b="MINI51":"NUC029AE"===a?b="NUC029":"NUC029AN"===a&&(b="NUC029");return b}function Fb(a){if(null===a||"object"!=typeof a)return a;var b=a.constructor(),c;for(c in a)a.hasOwnProperty(c)&&(b[c]=Fb(a[c]));return b}function va(a){var b=[],c=0,g;for(g in a)a.hasOwnProperty(g)&&(b[c]=g,c+=1);return b}function qa(a,b){var c=0,g;var h=/(\d+)|(\D+)/g;var f=/\d/;if(isFinite(a)&&isFinite(b))return a-b;a=String(a).toLowerCase();b=String(b).toLowerCase();if(a===b)return 0;if(!f.test(a)||
!f.test(b))return a>b?1:-1;a=a.match(h);b=b.match(h);for(g=a.length>b.length?b.length:a.length;c<g;)if(h=a[c],f=b[c],c+=1,h!==f)return isFinite(h)&&isFinite(f)?("0"===h.charAt(0)&&(h="."+h),"0"===f.charAt(0)&&(f="."+f),h-f):h>f?1:-1;return a.length-b.length}function Gb(){var a=!1;if($("html").hasClass("ie8")||$("html").hasClass("ie7")||$("html").hasClass("ie6"))a=!0,$('<div id="belowIE9Dialog"><p>Please upgrade your IE to IE9 or higher version.<br />Otherwise, this tool will not run properly!</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').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 Nb(a,b,c){function g(f){return(h?/^\d+[A-Za-z]*$/:/^\d+$/).test(f)}var h=c&&c.lexicographical;c=c&&c.zeroExtend;a=a.split(".");b=b.split(".");if(!a.every(g)||!b.every(g))return NaN;if(c){for(;a.length<b.length;)a.push("0");for(;b.length<a.length;)b.push("0")}h||(a=a.map(Number),b=b.map(Number));for(c=0;c<a.length;++c){if(b.length==c)return 1;
if(a[c]!=b[c])return a[c]>b[c]?1:-1}return a.length!=b.length?-1:0}function Ka(a,b,c){Fa();"Simplified Chinese"===Y?alert(a):"Traditional Chinese"===Y?alert(b):alert(c)}function Ab(){var a="",b=a="",c="",g=function(){W="M251";aa="M251EB2AE(TSSOP28)"};if(Ia)for(i=0,max=Hb.length;i<max;i+=1)mb.push(Hb[i]);db="";a=""===NUTOOL_PER.g_readConfigFilePath?"Nu_config.cfg ":"file:///"+NUTOOL_PER.g_readConfigFilePath;a=$.ajax({url:a,async:!1}).responseText;if(!a||/^\s*$/.test(a))return db=a,g(),!1;for(;-1!==
a.indexOf("\r")&&a.indexOf("\r")<a.indexOf("MCU:");)a=a.sliceAfterX("\r");b=a.sliceBetweenXandX("MCU:","\r");c=yb(b);if(-1===$.inArray(zb(c),mb))return Ka("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u6676\u7247\u578b\u53f7 "+c+" \u4e0d\u6b63\u786e\u3002","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u6676\u7247\u578b\u865f "+c+" \u4e0d\u6b63\u78ba\u3002","The chip type of "+c+" read from the config file is incorrect."),g(),!1;oldfilename="undefined"!==typeof W&&""!==W?"NUC_"+W+"_Content.js":"NUC_M251_Content.js";
newfilename="NUC_"+c+"_Content.js";sa(oldfilename,newfilename,"js");db=a;W=c;aa=b;Kb(db);return!0}function Db(){var a,b=$("#field1");$("#supportedthirdPartyLibs").remove();$("#thirdPartyLibTree").jstree("destroy");$("#thirdPartyLibTree").remove();$("#supportedperFunctions").remove();$("#perFunctionTree").jstree("destroy");$("#perFunctionTree").remove();lb={};Ta={};Ca={};var c=0;for(a=ba.length;c<a;c+=1)"undefined"!==typeof $("#"+ba[c])&&$("#"+ba[c]).alpaca("exists")&&($("#"+ba[c]).alpaca("destroy"),
$("#"+ba[c]).remove());L="";wa=[];xa=[];ra=[];P=[];Q=[];R=[];ha=[];ba=[];Z={};Ja=Ua=0;b.empty();$("#canvas_Peripheral").hide();$("#GenerateCode_pre").empty();$("#GenerateCode_pre").hide();$(".prettyprinted").removeClass("prettyprinted");$("#field1_canvas").remove();$("#field1_anchor").remove();Va();$.toast().reset("all")}function Sa(a,b){Fa();if(-1!==Y.indexOf("Simplified")){var c="\u8b66\u544a";a+="\u7684\u67d0\u4e9b\u680f\u4f4d\u662f\u65e0\u6548\u7684\u3002\u82e5\u60a8\u4ecd\u60f3\u8981\u7ee7\u7eed\u8be5\u64cd\u4f5c\uff0c\u8bf7\u6309'\u6062\u590d\u9ed8\u8ba4\u8bbe\u7f6e'\u5e76\u518d\u8bd5\u4e00\u6b21\u3002\u4f46\u6240\u6709\u680f\u4f4d\u5c06\u4f1a\u56de\u590d\u5230\u521d\u59cb\u503c\u3002\u82e5\u60a8\u60f3\u8981\u4fee\u6b63\u5b83\uff0c\u8bf7\u6309'\u4fee\u6b63'\u3002";
var g="\u6062\u590d\u9ed8\u8ba4\u8bbe\u7f6e";var h="\u4fee\u6b63"}else-1!==Y.indexOf("Traditional")?(c="\u8b66\u544a",a+="\u7684\u67d0\u4e9b\u6b04\u4f4d\u662f\u7121\u6548\u7684\u3002\u82e5\u60a8\u4ecd\u60f3\u8981\u7e7c\u7e8c\u8a72\u64cd\u4f5c\uff0c\u8acb\u6309'\u6062\u5fa9\u9ed8\u8a8d\u8a2d\u7f6e'\u4e26\u518d\u8a66\u4e00\u6b21\u3002\u4f46\u6240\u6709\u6b04\u4f4d\u5c07\u6703\u56de\u5fa9\u5230\u521d\u59cb\u503c\u3002\u82e5\u60a8\u60f3\u8981\u4fee\u6b63\u5b83\uff0c\u8acb\u6309'\u4fee\u6b63'\u3002",g=
"\u6062\u5fa9\u9ed8\u8a8d\u8a2d\u7f6e",h="\u4fee\u6b63"):(c="Warning",a="Some fields of "+a+" are invalid. If you still want to contiune the operation, please press 'Restore Defaults' and try again. But all the fields will be restored to the default. If you want to fix it, please press 'Fix'.",g="Restore Defaults",h="Fix");Va();$('<div id="warningForUncheckNodeDialog"><p>'+a+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,draggable:!0,resizable:!1,
title:c,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:g,click:function(){b();$(this).is(":visible")&&$(this).dialog("destroy")}},{text:h,click:function(){$(this).is(":visible")&&$(this).dialog("destroy")}}]})}function Fa(){var a=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof a&&-1!==a.indexOf("UIlanguage:")?(Y=a.sliceAfterX("UIlanguage:"),Y=Y.slicePriorToX("\r")):Y="English"}function nb(a,b){function c(l,u){var F=!1;if("undefined"===typeof n[l].dependenciesOption||
"none"===n[l].dependenciesOption||""===n[l].dependenciesOption)return F;var S={};if("object"==typeof n[l].dependenciesOption&&"undefined"!==typeof n[l].dependenciesOption[u])if(l=n[l].dependenciesOption,Array.isArray(l[u]))if("select"===n[u].type||"integer"===n[u].type||"hextext"===n[u].type){var w=0;for(S=l[u].length;w<S;w+=1)if(l[u][w].toString()===n[u].data){F=!0;break}}else w=n[u].data.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),l[u].equals(w)&&(F=!0);else if(-1!==
l[u].toString().indexOf("|")||-1!==l[u].toString().indexOf("&")||-1!==l[u].toString().indexOf("!")){l=l[u];var la=n[u].data;var ia=l.split("|");var ma=[];for(w=0;w<ia.length;w++){var ya=ia[w].split("&");for(u=0;u<ya.length;u++)ma.push(ya[u].replace(/\(/g,"").replace(/\)/g,"").replace(/!/g,"").replace(/\s/g,""))}for(w=0;w<ma.length;w++)for(S[ma[w]]=0,ia=la.replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),u=0;u<ia.length;u++)if(ia[u].toString().trim()===ma[w].toString().trim()){S[ma[w]]=
1;break}if(!$.isEmptyObject(S)){l=l.replace(/\|/g," or ");l=l.replace(/&/g," and ");l=l.replace(/!/g,"not ");try{var ka=compileExpression(l)}catch(La){}ka(S)&&(F=!0)}}else if(-1!==l[u].indexOf(">")||-1!==l[u].indexOf("<")||-1!==l[u].indexOf("=")){l=l[u];la=n[u].data;S.myInteger=la;try{ka=compileExpression("myInteger"+l)}catch(La){}ka(S)&&(F=!0)}else l[u].toString()===n[u].data&&(F=!0);else if(Array.isArray(n[l].dependenciesOption))if("select"===n[u].type||"integer"===n[u].type||"hextext"===n[u].type)for(w=
0,S=n[l].dependenciesOption.length;w<S;w+=1){if(n[l].dependenciesOption[w].toString()===n[u].data){F=!0;break}}else w=n[u].data.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),n[l].dependenciesOption.equals(w)&&(F=!0);else if(-1!==n[l].dependenciesOption.indexOf("[")&&-1!==n[u].data.indexOf("["))if(ka=n[l].dependenciesOption.replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),w=n[u].data.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),
"select"===n[u].type||"integer"===n[u].type||"hextext"===n[u].type)for(w=0,S=ka.length;w<S;w+=1){if(ka[w].toString()===n[u].data){F=!0;break}}else ka.equals(w)&&(F=!0);else if(-1!==n[l].dependenciesOption.toString().indexOf("|")||-1!==n[l].dependenciesOption.toString().indexOf("&")||-1!==n[l].dependenciesOption.toString().indexOf("!")){l=n[l].dependenciesOption;la=n[u].data;ia=l.split("|");ma=[];for(w=0;w<ia.length;w++)for(ya=ia[w].split("&"),u=0;u<ya.length;u++)ma.push(ya[u].replace(/\(/g,"").replace(/\)/g,
"").replace(/!/g,"").replace(/\s/g,""));for(w=0;w<ma.length;w++)for(S[ma[w]]=0,ia=la.replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").split(","),u=0;u<ia.length;u++)if(ia[u].toString().trim()===ma[w].toString().trim()){S[ma[w]]=1;break}if(!$.isEmptyObject(S)){l=l.replace(/\|/g," or ");l=l.replace(/&/g," and ");l=l.replace(/!/g,"not ");try{ka=compileExpression(l)}catch(La){}ka(S)&&(F=!0)}}else if(-1!==n[l].dependenciesOption.indexOf(">")||-1!==n[l].dependenciesOption.indexOf("<")||-1!==n[l].dependenciesOption.indexOf("=")){l=
n[l].dependenciesOption;la=n[u].data;S.myInteger=la;try{ka=compileExpression("myInteger"+l)}catch(La){}ka(S)&&(F=!0)}else n[l].dependenciesOption.toString()===n[u].data&&(F=!0);return F}function g(l,u){var F,S,w=[];if(-1===r.indexOf(l))if("undefined"!==typeof n[l].dependencies&&"none"!==n[l].dependencies&&""!==n[l].dependencies){if(Array.isArray(n[l].dependencies))w=n[l].dependencies;else if(-1!==n[l].dependencies.toString().indexOf("|")||-1!==n[l].dependencies.toString().indexOf("&")||-1!==n[l].dependencies.toString().indexOf("!"))for(M=
n[l].dependencies.split("|"),y=[],F=0;F<M.length;F++)for(G=M[F].split("&"),S=0;S<G.length;S++)w.push(G[S].replace(/\(/g,"").replace(/\)/g,"").replace(/!/g,"").replace(/\s/g,""));else w[0]=n[l].dependencies;F=0;for(S=w.length;F<S;F+=1){if(-1===x.indexOf(w[F]))return;if(-1===r.indexOf(w[F])){if(x.indexOf(w[F])<x.indexOf(l))return;g(w[F],u+1)}if(-1===r.indexOf(w[F]))return}if(Array.isArray(n[l].dependencies)){z=!0;F=0;for(S=n[l].dependencies.length;F<S;F+=1)if(u=n[l].dependencies[F],!c(l,u)){z=!1;break}z&&
r.push(l)}else if(-1!==n[l].dependencies.toString().indexOf("|")||-1!==n[l].dependencies.toString().indexOf("&")||-1!==n[l].dependencies.toString().indexOf("!")){M=n[l].dependencies.split("|");y=[];for(F=0;F<M.length;F++)for(G=M[F].split("&"),S=0;S<G.length;S++)y.push(G[S].replace(/\(/g,"").replace(/\)/g,"").replace(/!/g,"").replace(/\s/g,""));J={};for(F=0;F<y.length;F++)c(l,y[F])?J[y[F]]=1:J[y[F]]=0;B=n[l].dependencies;B=B.replace(/\|/g," or ");B=B.replace(/&/g," and ");B=B.replace(/!/g,"not ");
if(!$.isEmptyObject(J)){try{K=compileExpression(B)}catch(la){}K(J)&&r.push(l)}}else u=n[l].dependencies,"undefined"!==typeof n[u]&&"undefined"!==typeof n[u].data&&c(l,u)&&r.push(l)}else r.push(l)}var h,f="",e,d=0;var m=0;var r=[],x=[];var v=[];var n={},H=aa.slicePriorToX("("),O=ea,D={},C="",k=null,I=null,t=null,p=null;m=null;var y=[],M=[],G=[],J={},K;"undefined"===typeof b&&(b="parseAll");"undefined"!==typeof NUTOOL_PIN&&(f="PeripheralConfigure//");m=f+W+"//"+a+".txt";try{var A=e=$.ajax({url:m,async:!1}).responseText.replace(/\r/g,
"")}catch(l){return}for(e=e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"");-1!==e.indexOf("<!");){f=e.sliceBetweenXandX("<!","!>").replace(/\r?\n|\r/g,"");for(m=0;-1!==f.indexOf(";");){var B=f.slicePriorToX(";");var E="";E=B.sliceAfterX(":").trim();B=B.slicePriorToX(":").replace(/\s/g,"");if("id"===B){var q=E;x.push(q);n[q]={}}"type"===B&&(n[q].type=E);"data"===B&&(n[q].data=E);"default"===B&&(n[q].default=E);"dependencies"===B&&(-1===E.indexOf("[")?n[q].dependencies=E.trim():n[q].dependencies=E.replace(/\[/g,
"").replace(/\]/g,"").replace(/\s/g,"").split(","));"dependenciesOption"===B&&(-1!==E.indexOf("{")&&-1!==E.indexOf("}")?n[q].dependenciesOption=JSON.parse(E.replace(/'/g,'"').trim()):n[q].dependenciesOption=E.trim());"dependenciesDefault"===B&&(n[q].dependenciesDefault=E.trim());"filterExp"===B&&(n[q].filterExp=E.trim());"header"===B&&(C=E.replace(/\//g,"\\"));"pin"===B&&(k=JSON.parse(E.replace(/'/g,'"').trim()),"undefined"!==typeof k[ea]&&(k=k[ea]),"undefined"!==typeof k[aa.slicePriorToX("(")]&&
(k=k[aa.slicePriorToX("(")]));"clock"===B&&(I=JSON.parse(E.replace(/'/g,'"').trim()),"undefined"!==typeof I[ea]&&(I=I[ea]),"undefined"!==typeof I[aa.slicePriorToX("(")]&&(I=I[aa.slicePriorToX("(")]));"peripheral"===B&&(t=JSON.parse(E.replace(/'/g,'"').trim()),"undefined"!==typeof t[ea]&&(t=t[ea]),"undefined"!==typeof t[aa.slicePriorToX("(")]&&(t=t[aa.slicePriorToX("(")]));"filter"===B&&(p=JSON.parse(E.replace(/'/g,'"').trim()));f=f.sliceAfterX(";");if(2E3<m)break;else m+=1}e=e.sliceAfterX(">");if(2E3<
d)break;else d+=1}if("parseAll"===b){null!==p&&(D=p);"undefined"!==typeof D[H]?D="function"==typeof D[H]?D[H]():D[H]:"undefined"!==typeof D[O]&&(D="function"==typeof D[O]?D[O]():D[O]);D.name=H;""!==O&&(D.type=O);for(h in Aa)Aa.hasOwnProperty(h)&&(D[h]=Aa[h]);b=0;for(h=x.length;b<h;b+=1)if(q=x[b],"undefined"!==typeof n[q].filterExp&&"none"!==n[q].filterExp&&""!==n[q].filterExp){try{var V=compileExpression(n[q].filterExp)}catch(l){}V(D)&&v.push(q)}else v.push(q);x=v;b=0;for(h=x.length;b<h;b+=1)q=x[b],
g(q,0);if(0<r.length){if(null!==k){delete P[a];b=0;for(h=r.length;b<h;b+=1)if(q=r[b],"undefined"!==typeof k[q]&&"undefined"!==typeof k[q][n[q].data])if("undefined"===typeof P[a]&&(P[a]=[]),m=k[q][n[q].data],Array.isArray(m))for(q=0,v=m.length;q<v;q+=1)-1===$.inArray(m[q],P[a])&&P[a].push(m[q]);else-1===$.inArray(m,P[a])&&P[a].push(m);if("undefined"!==typeof k.ALL)if("undefined"===typeof P[a]&&(P[a]=[]),Array.isArray(k.ALL))for(q=0,v=k.ALL.length;q<v;q+=1)-1===$.inArray(k.ALL[q],P[a])&&P[a].push(k.ALL[q]);
else-1===$.inArray(k.ALL,P[a])&&P[a].push(k.ALL)}if(null!==I){delete Q[a];b=0;for(h=r.length;b<h;b+=1)if(q=r[b],"undefined"!==typeof I[q]&&"undefined"!==typeof I[q][n[q].data])if("undefined"===typeof Q[a]&&(Q[a]=[]),m=I[q][n[q].data],Array.isArray(m))for(q=0,v=m.length;q<v;q+=1)-1===$.inArray(m[q],Q[a])&&Q[a].push(m[q]);else-1===$.inArray(m,Q[a])&&Q[a].push(m);if("undefined"!==typeof I.ALL)if("undefined"===typeof Q[a]&&(Q[a]=[]),Array.isArray(I.ALL))for(q=0,v=I.ALL.length;q<v;q+=1)-1===$.inArray(I.ALL[q],
Q[a])&&Q[a].push(I.ALL[q]);else-1===$.inArray(I.ALL,Q[a])&&Q[a].push(I.ALL)}if(null!==t){delete R[a];b=0;for(h=r.length;b<h;b+=1)if(q=r[b],"undefined"!==typeof t[q]&&"undefined"!==typeof t[q][n[q].data])if("undefined"===typeof R[a]&&(R[a]=[]),m=t[q][n[q].data],Array.isArray(m))for(q=0,v=m.length;q<v;q+=1)-1===$.inArray(m[q],R[a])&&R[a].push(m[q]);else-1===$.inArray(m,R[a])&&R[a].push(m);if("undefined"!==typeof t.ALL)if("undefined"===typeof R[a]&&(R[a]=[]),Array.isArray(t.ALL))for(q=0,v=t.ALL.length;q<
v;q+=1)-1===$.inArray(t.ALL[q],R[a])&&R[a].push(t.ALL[q]);else-1===$.inArray(t.ALL,R[a])&&R[a].push(t.ALL)}b=0;for(h=r.length;b<h;b+=1)if(q=r[b],"undefined"!==typeof n[q].data){var z=-1===q.toString().toLowerCase().indexOf("textonly")?n[q].data.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/,/g,"|").trim():"NUC_NULL";A=pa(A,q,z,"entireTag")}b=0;for(h=x.length;b<h;b+=1)q=x[b],-1!==$.inArray(q,r)||"multipleselect"!==n[q].type&&"checkbox"!==n[q].type||(z="0",A=pa(A,q,z,"entireTag")),-1===$.inArray(q,
r)&&(z="undefined"!==typeof n[q].default?n[q].default.toString().replace(/\[/g,"").replace(/\]/g,"").replace(/,/g,"|").trim():"NUC_NULL","undefined"!==typeof n[q].dependenciesDefault&&"true"!==n[q].dependenciesDefault&&(z="NUC_NULL"),A=pa(A,q,z,"entireTag"))}A=Bb(A);xa[a]=A;A=""}""!==C?-1!==C.indexOf(".h")?ra[a]=C:ra[a]=C+".h":ra[a]="periph_conf.h"}function ob(){var a,b="";b=[];var c="",g;c=[];var h="",f=[];var e=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;"undefined"!==typeof e&&-1!==e.indexOf("UIlanguage:")?
(e=e.sliceAfterX("UIlanguage:"),e=e.slicePriorToX("\r"),h="Simplified Chinese"===e?"\u9700\u68c0\u67e5\u7684\u6a21\u5757\u4e8e":"Traditional Chinese"===e?"\u9700\u6aa2\u67e5\u7684\u6a21\u7d44\u65bc":"Modules need checking in "):h="Modules need checking in ";if("undefined"!==typeof NUTOOL_PIN){$.toast().reset("all");NUTOOL_PIN.getGeneratedCodeByPin("primitiveDescription");NUTOOL_PIN.getGeneratedMFPFunctionList();b=NUTOOL_PIN.getg_generatedCodeByPinString();c=NUTOOL_PIN.getg_generatedMFPFunctionList();
f=[];for(g in P)if(P.hasOwnProperty(g)&&"undefined"!==typeof P[g])for(e=0,a=P[g].length;e<a;e++)-1===b.indexOf(":"+P[g][e]+"\n")&&-1!==c.indexOf("/"+P[g][e]+":")&&-1===$.inArray(P[g][e],f)&&f.push(P[g][e]);if(0<f.length){f.sort(qa);b="";e=0;for(a=f.length;e<a;e++)b+=f[e],e!==a-1&&(b+=", ");eb=$.toast({heading:h+"PinConfigure:",text:b+"<br />",icon:"warning",position:"bottom-right",hideAfter:!1,onClick:function(){pb()}})}NUTOOL_CLOCK.getGeneratedClockStatus();b=NUTOOL_CLOCK.getg_clockRegsString();
f=[];for(g in Q)if(Q.hasOwnProperty(g)&&"undefined"!==typeof Q[g])for(e=0,a=Q[g].length;e<a;e++)-1===b.indexOf(":"+Q[g][e]+"=Enabled")&&-1!==b.indexOf(":"+Q[g][e]+"/")&&-1===$.inArray(Q[g][e],f)&&f.push(Q[g][e]);if(0<f.length){f.sort(qa);b="";e=0;for(a=f.length;e<a;e++)b+=f[e],e!==a-1&&(b+=", ");fb=$.toast({heading:h+"ClockConfigure:",text:b+"<br />",icon:"warning",position:"bottom-right",hideAfter:!1,onClick:function(){qb()}})}c=[];for(g in fa)fa.hasOwnProperty(g)&&(1<fa[g].length?c.push(fa[g]):
c.push(g));Ib();b=gb.split("/");f=[];for(g in R)if(R.hasOwnProperty(g)&&"undefined"!==typeof R[g])for(e=0,a=R[g].length;e<a;e++)-1!==c.indexOf(R[g][e])&&-1===b.indexOf(R[g][e])&&-1===$.inArray(R[g][e],f)&&f.push(R[g][e]);if(0<f.length){f.sort(qa);b="";e=0;for(a=f.length;e<a;e++)b+=f[e],e!==a-1&&(b+=", ");Xa=$.toast({heading:h+"PeripheralConfigure:",text:b+"<br />",icon:"warning",position:"bottom-right",hideAfter:!1,onClick:function(){rb()}})}}}function pb(){sa("PeripheralConfigure/bootstrap-multiselect.css",
"","css");sa("PeripheralConfigure/bootstrap.min.css","","css");sa("PinConfigure/NUC_Pin_Configuration.css","ClockConfigure/NUC_Clock_Configuration.css","css");sa("ClockConfigure/pepper-grinder/jquery-ui-1.10.4.custom.css","PinConfigure/css/pepper-grinder/jquery-ui-1.10.3.custom.css","css");$("#ChipType_Peripheral").hide();$("#MCU_Peripheral").hide();$("#CodeGeneratorContainer").hide();$("#rootTree_Peripheral").hide();$("#parentOfPanel").show();$("#rootTree_Pin").show();$("#tabs")[0].style.visibility=
"hidden";$("#rootTree_Clock").hide();ob();"undefined"!==typeof fb&&fb.hide();"undefined"!==typeof Xa&&Xa.hide();hb="PinConfigure";Va()}function qb(){sa("PeripheralConfigure/bootstrap-multiselect.css","","css");sa("PeripheralConfigure/bootstrap.min.css","","css");sa("PinConfigure/NUC_Pin_Configuration.css","ClockConfigure/NUC_Clock_Configuration.css","css");sa("PinConfigure/css/pepper-grinder/jquery-ui-1.10.3.custom.css","ClockConfigure/pepper-grinder/jquery-ui-1.10.4.custom.css","css");$("#ChipType_Peripheral").hide();
$("#MCU_Peripheral").hide();$("#CodeGeneratorContainer").hide();$("#rootTree_Peripheral").hide();$("#parentOfPanel").hide();$("#rootTree_Pin").hide();$("#tabs")[0].style.visibility="visible";$("#rootTree_Clock").show();ob();"undefined"!==typeof eb&&eb.hide();"undefined"!==typeof Xa&&Xa.hide();hb="ClockConfigure";Va()}function rb(){sa("PinConfigure/NUC_Pin_Configuration.css","PeripheralConfigure/NUC_Peripheral_Configuration.css","css");sa("ClockConfigure/NUC_Clock_Configuration.css","PeripheralConfigure/bootstrap-multiselect.css",
"css");sa("ClockConfigure/NUC_Clock_Configuration.css","PeripheralConfigure/bootstrap.min.css","css");sa("ClockConfigure/pepper-grinder/jquery-ui-1.10.4.custom.css","PinConfigure/css/pepper-grinder/jquery-ui-1.10.3.custom.css","css");$("#ChipType_Peripheral").show();$("#MCU_Peripheral").show();$("#perFunctionTree").show();$("#thirdPartyLibTree").show();$("#supportedperFunctions").show();$("#supportedthirdPartyLibs").show();$("#CodeGeneratorContainer").css({left:ja-16+"px"});$("#CodeGeneratorContainer").css("width",
za-ja+16+"px");$("#CodeGeneratorContainer").show();$("#rootTree_Peripheral").show();$("#parentOfPanel").hide();$("#rootTree_Pin").hide();$("#tabs")[0].style.visibility="hidden";$("#rootTree_Clock").hide();ob();"undefined"!==typeof eb&&eb.show();"undefined"!==typeof fb&&fb.show();"undefined"!==typeof Xa&&Xa.show();$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click();
hb="PeripheralConfigure";Va()}function Ob(){function a(m,r){c=$(r).attr("id").slicePriorToX("_PeripheralConfigure");$("#"+c+"_PeripheralConfigure").hasClass("jstree-checked")?-1===$.inArray(c,h)&&(na(c),nb(c)):nb(c,"onlyParsingHeader")}var b,c,g=[];$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&($("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click(),$("#canvas_Peripheral").hide(),$("#GenerateCode_pre").empty(),
$("#GenerateCode_pre").hide(),$(".prettyprinted").removeClass("prettyprinted"));var h=va(xa);var f=va(fa);f.sort(qa);var e=0;for(b=f.length;e<b;e+=1){var d=f[e];0<$("#"+d+"_PeripheralConfigure").find("li").length?$("#"+d+"_PeripheralConfigure").find("li").each(a):$("#"+d+"_PeripheralConfigure").hasClass("jstree-checked")?-1===$.inArray(d,h)&&(na(d),nb(d)):nb(d,"onlyParsingHeader")}for(e in ra)-1!==ra[e].toString().indexOf(".h")&&"h"===ra[e].toString().slice(-1)&&-1===$.inArray(ra[e],g)&&g.push(ra[e]);
Za="";e=0;for(b=g.length;e<b;e++)Za+=g[e],e!==b-1&&(Za+=">")}function Ib(){function a(r,x){h=$(x).attr("id").slicePriorToX("_PeripheralConfigure");$("#"+h+"_PeripheralConfigure").hasClass("jstree-checked")&&c.push(h)}var b,c=[],g={},h,f;da="";var e=NUTOOL_PER.g_cfg_thirdPartyLibs;e.sort(qa);var d=0;for(b=e.length;d<b;d+=1){var m=e[d];$("#"+m.replaceSpecialCharacters()+"_PeripheralConfigure").hasClass("jstree-checked")&&c.push(m)}sb="";d=0;for(b=c.length;d<b;d+=1)sb+=c[d],d!==b-1&&(sb+="/");c=[];va(xa);
e=va(fa);e.sort(qa);d=0;for(b=e.length;d<b;d+=1)m=e[d],0<$("#"+m+"_PeripheralConfigure").find("li").length?$("#"+m+"_PeripheralConfigure").find("li").each(a):$("#"+m+"_PeripheralConfigure").hasClass("jstree-checked")&&c.push(m);"undefined"!==typeof NUTOOL_PIN&&(f="PeripheralConfigure//");gb=da="";d=0;for(b=c.length;d<b;d+=1)gb+=c[d],d!==b-1&&(gb+="/"),g[c[d]]=Jb(f+W+"//"+c[d]+".txt");0<c.length&&(da=JSON.stringify(g))}var ja=0,za,bb,mb=["M251","M031","NUC100"],Hb=["M253","M030G","DEMO"],W="",Da="",
Wa="",aa="",ea="",Aa={},Za="",da="",sb="",gb="",Ga="",L="",hb="PeripheralConfigure",lb={},Ta={},Ca={},wb=[],Ha=[],Ea={},ba=[],Z={},fa=[],cb=[],ha=[],xa=[],ra=[],P=[],Q=[],R=[],wa=[],Ya={},eb,fb,Xa,Ua=0,Ja=0,Qa=0,db,Y,Ia=!1,kb=!0,oa=!0,Ra=!0;window.onload=function(){if("undefined"!==typeof NUTOOL_PIN){if(Gb())return;Fa();try{external.updateCurrentDialogSize()}catch(a){kb=!1}xb();NUTOOL_PIN.loadPinConfigureTool();NUTOOL_CLOCK.loadClockConfigureTool();Ab()||(Ra=!1);rb();Eb();$("#rootTree_Peripheral")[0].setAttribute("style",
"width:"+ja+"px; height: "+g_NUC_TreeView_Height+"px;");U();T();N();try{external.changeDialogCaptionFromJS("NuTool - CodeGenerator_"+NUTOOL_PER.g_toolVersion)}catch(a){}}else{if(Gb())return;Fa();try{external.updateCurrentDialogSize()}catch(a){kb=!1}xb();Ab()||(Ra=!1);Eb();$("#rootTree_Peripheral")[0].setAttribute("style","width:"+ja+"px; height: "+g_NUC_TreeView_Height+"px;");U();T();N()}NUTOOL_PER.g_bFunctionalTesting=!1};NUTOOL_PER={getg_chipType:function(){return W},getg_partNumber_package:function(){return aa},
getg_generatedCodeFromPerString:function(){return da},getg_enabledThirdPartyLibString:function(){return sb},getg_enabledPeripheralFunctionString:function(){return gb},getg_userSelectUIlanguage:function(){return Y},getg_currentSnippetFilePath:function(){return Ga},getg_updatedSnippetFile:function(){return Da},getg_cfg_projectLoaction:function(){return"undefined"!==typeof NUTOOL_PER.g_cfg_projectLoaction[aa.slicePriorToX("(")]?NUTOOL_PER.g_cfg_projectLoaction[aa.slicePriorToX("(")]:"undefined"!==typeof NUTOOL_PER.g_cfg_projectLoaction.ByDefault?
NUTOOL_PER.g_cfg_projectLoaction.ByDefault:NUTOOL_PER.g_cfg_projectLoaction},getg_cfg_thidrPartyLibLoaction:function(){return NUTOOL_PER.g_cfg_thidrPartyLibLoaction},getg_currentTool:function(){return hb},getg_toolVersion:function(){return NUTOOL_PER.g_toolVersion},getg_bDevelopingTool:function(){return Ia},getg_perControls:function(){return Ca},getg_module_snippet_code:function(){return xa},g_bFunctionalTesting:!1,g_postRender_f1:{},g_postRender_control:{},checkAlpacaReady:X,decideNewChipType:yb,
chipTypeToChipSeries:zb,showPinConfigure:pb,showClockConfigure:qb,showPeripheralConfigure:rb,showCodeOnly:function(){"none"===$("#ChipType_Peripheral").css("display")?($("#ChipType_Peripheral").show(),$("#MCU_Peripheral").show(),$("#perFunctionTree").show(),$("#thirdPartyLibTree").show(),$("#supportedperFunctions").show(),$("#supportedthirdPartyLibs").show(),$("#CodeGeneratorContainer").css({left:ja-16+"px"}),$("#CodeGeneratorContainer").css("width",za-ja+16+"px")):($("#ChipType_Peripheral").hide(),
$("#MCU_Peripheral").hide(),$("#perFunctionTree").hide(),$("#thirdPartyLibTree").hide(),$("#supportedperFunctions").hide(),$("#supportedthirdPartyLibs").hide(),$("#CodeGeneratorContainer").css({left:"0px"}),$("#CodeGeneratorContainer").css("width",za+"px"))},restoreToDefault:function(){function a(m,r){g=$(r).attr("id");na(g.slicePriorToX("_PeripheralConfigure"));Ba(h+W+"//"+g.slicePriorToX("_PeripheralConfigure")+".txt");$("#"+g).hasClass("jstree-checked")&&$("#perFunctionTree").jstree("uncheck_node",
$("#"+g))}var b,c=va(fa),g,h="",f=Ga;if(X()){"undefined"!==typeof NUTOOL_PIN&&(h="PeripheralConfigure//");da="";c.sort(qa);var e=0;for(b=c.length;e<b;e+=1){var d=c[e];0<$("#"+d+"_PeripheralConfigure").find("li").length?$("#"+d+"_PeripheralConfigure").find("li").each(a):(na(d.slicePriorToX("_PeripheralConfigure")),Ba(h+W+"//"+d+".txt"),d=d.replaceSpecialCharacters()+"_PeripheralConfigure",$("#"+d).hasClass("jstree-checked")&&$("#perFunctionTree").jstree("uncheck_node",$("#"+d)))}Ga=f;c=NUTOOL_PER.g_cfg_thirdPartyLibs;
e=0;for(b=c.length;e<b;e+=1)d=c[e].replaceSpecialCharacters()+"_PeripheralConfigure",$("#"+d).hasClass("jstree-checked")&&$("#perFunctionTree").jstree("uncheck_node",$("#"+d));e=0;for(b=ba.length;e<b;e+=1)"undefined"!==typeof $("#"+ba[e])&&$("#"+ba[e]).alpaca("exists")&&($("#"+ba[e]).alpaca("destroy"),$("#"+ba[e]).remove());ba=[];Z={};$("#field1_canvas").remove();$("#field1_anchor").remove();N()}},redrawForResizingDialog:function(){xb();"none"===$("#perFunctionTree").css("display")?$("#CodeGeneratorContainer").width(za):
(0!==Qa?$("#perFunctionTree").height(g_NUC_TreeView_Height-$("#ChipType_Peripheral").height()-$("#MCU_Peripheral").height()-$("#supportedperFunctions").height()-Qa-20):$("#perFunctionTree").height(g_NUC_TreeView_Height-$("#ChipType_Peripheral").height()-$("#MCU_Peripheral").height()-$("#supportedperFunctions").height()),$("#CodeGeneratorContainer").width(za-ja+16));$("#CodeGeneratorContainer").height(bb)},concatenate_generated_cfg:Ib,concatenate_generated_code:function(){function a(n,H){h=$(H).attr("id").slicePriorToX("_PeripheralConfigure");
$("#"+h+"_PeripheralConfigure").hasClass("jstree-checked")&&(x=!0)}function b(n,H){h=$(H).attr("id").slicePriorToX("_PeripheralConfigure");"periph_conf.h"===NUTOOL_PER.g_perFunctionString&&(da=$("#"+h+"_PeripheralConfigure").hasClass("jstree-checked")?da+("#define NUCODEGEN_"+h+" 1\n"):da+("#define NUCODEGEN_"+h+" 0\n"),v=f[m].indexOf(h),-1!==v&&f[m].splice(v,1));NUTOOL_PER.g_perFunctionString!==ra[h]&&""!==NUTOOL_PER.g_perFunctionString||!$("#"+h+"_PeripheralConfigure").hasClass("jstree-checked")||
-1===$.inArray(h,r)||(local_module_snippet_code+=xa[h]+"\n")}var c,g,h,f=Fb(cb);da=local_module_snippet_code="";var e=NUTOOL_PER.g_cfg_thirdPartyLibs;e.sort(qa);var d=0;for(c=e.length;d<c;d+=1){var m=e[d];da=$("#"+m.replaceSpecialCharacters()+"_PeripheralConfigure").hasClass("jstree-checked")?da+("#define NUCODEGEN_"+m+" 1\n"):da+("#define NUCODEGEN_"+m+" 0\n")}"periph_conf.h"===NUTOOL_PER.g_perFunctionString&&(local_module_snippet_code="// MACROs above generated by the NuCodeGenerator tool\n\n");
NUTOOL_PER.g_bFunctionalTesting&&(local_module_snippet_code+="#define NUCODEGEN_UTEST 1\n\n");var r=va(xa);e=va(fa);e.sort(qa);d=0;for(c=e.length;d<c;d+=1)if(m=e[d],0<$("#"+m+"_PeripheralConfigure").find("li").length){if("periph_conf.h"===NUTOOL_PER.g_perFunctionString){var x=!1;$("#"+m+"_PeripheralConfigure").find("li").each(a);da=x?da+("#define NUCODEGEN_"+m+" 1\n"):da+("#define NUCODEGEN_"+m+" 0\n")}$("#"+m+"_PeripheralConfigure").find("li").each(b)}else{if("periph_conf.h"===NUTOOL_PER.g_perFunctionString){da=
$("#"+m+"_PeripheralConfigure").hasClass("jstree-checked")?da+("#define NUCODEGEN_"+m+" 1\n"):da+("#define NUCODEGEN_"+m+" 0\n");var v=f[m].indexOf(m);-1!==v&&f[m].splice(v,1)}NUTOOL_PER.g_perFunctionString!==ra[m]&&""!==NUTOOL_PER.g_perFunctionString||!$("#"+m+"_PeripheralConfigure").hasClass("jstree-checked")||-1===$.inArray(m,r)||(local_module_snippet_code+=xa[m]+"\n")}e=va(f);e.sort(qa);d=0;for(c=e.length;d<c;d+=1)for(m=e[d],0!==f[m].length&&f[m].length===cb[m].length&&(da+="#define NUCODEGEN_"+
m+" 0\n"),v=0,g=f[m].length;v<g;v+=1)f[m][v]!==m&&(da+="#define NUCODEGEN_"+f[m][v]+" 0\n");da=da+"\n"+local_module_snippet_code},loadConfig:function(){try{external.loadConfigFromJS()}catch(a){}},loadConfig_core:function(){Db();Ab()||(Ka("\u914d\u7f6e\u6863\u4e0d\u6b63\u786e\u3002","\u914d\u7f6e\u6a94\u4e0d\u6b63\u78ba\u3002","The config file is incorrect."),Ra=!1);U();T();N();if("undefined"!==typeof NUTOOL_PIN)try{external.changeDialogCaptionFromJS("NuTool - CodeGenerator_"+NUTOOL_PER.g_toolVersion)}catch(a){}},
saveConfig:function(){var a="";if(oa){$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&($("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click(),$("#canvas_Peripheral").hide(),$("#GenerateCode_pre").empty(),$("#GenerateCode_pre").hide(),$(".prettyprinted").removeClass("prettyprinted"));try{external.saveConfigFromJS("NUC_BROWSE_PROJECT_PATH")}catch(b){}}else"undefined"!==typeof NUTOOL_PIN&&(a="PeripheralConfigure//"),
Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(a+W+"//"+L.slicePriorToX("_PeripheralConfigure")+".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;$("#perFunctionTree").jstree("uncheck_node",$("#"+L))})},recordConfig:function(){},closeAPP:function(){$("#"+L).hasClass("jstree-checked")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("exists")&&$("#"+ha[L.slicePriorToX("_PeripheralConfigure")]).alpaca("get").form.getButtonEl("submit").click();try{external.closeFromJS()}catch(a){}},
settings:function(){var a="",b="",c="",g=hb,h=$("#ChipType_span_Peripheral"),f=$("#MCU_span_Peripheral"),e=$("#supportedthirdPartyLibs_span"),d=$("#supportedperFunctions_span");var m=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;if("undefined"!==typeof m&&-1!==m.indexOf("UIlanguage:"))if(m=m.sliceAfterX("UIlanguage:").slicePriorToX("\r"),"Simplified Chinese"===m){m="\u8bbe\u5b9a";var r="\u4ece\u4e0b\u9762\u9009\u53d6\u4e00\u4e2a\u8bed\u8a00\u663e\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002";
var x="\u82f1\u6587";var v="\u7b80\u4f53\u4e2d\u6587";var n="\u7e41\u4f53\u4e2d\u6587";b="checked";var H="\u786e\u5b9a";var O="\u79bb\u5f00"}else"Traditional Chinese"===m?(m="\u8a2d\u5b9a",r="\u5f9e\u4e0b\u9762\u9078\u53d6\u4e00\u500b\u8a9e\u8a00\u986f\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002",x="\u82f1\u6587",v="\u7b80\u9ad4\u4e2d\u6587",n="\u7e41\u9ad4\u4e2d\u6587",c="checked",H="\u78ba\u5b9a",O="\u96e2\u958b"):(m="Settings",r="Select one of the following languages displayed in UI.",x="English",
v="Simplified Chinese",n="Traditional Chinese",a="checked",H="Confirm",O="Leave");else m="Settings",r="1. Select one of the following languages displayed in UI.",x="English",v="Simplified Chinese",n="Traditional Chinese",a="checked",H="Confirm",O="Leave";Va();$('<div id="languageDialog"><p>'+r+'</p><input type="radio" id="engiish" value="English" name="UIlanguage" '+a+'><label for="engiish">'+x+'</label><br /><input type="radio" id="simplifiedChinese" value="Simplified Chinese" name="UIlanguage" '+
b+'><label for="simplifiedChinese">'+v+'</label><br /><input type="radio" id="traditionalChinese" value="Traditional Chinese" name="UIlanguage" '+c+'><label for="traditionalChinese">'+n+'</label><br /><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,draggable:!1,resizable:!1,title:m,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#languageDialog").dialog("destroy")},buttons:[{text:H,click:function(){$("input").each(function(){"UIlanguage"===
this.name&&!0===this.checked&&(Y=$(this).val(),-1!==Y.indexOf("Simplified")?(h.text("\u6676\u7247\u7cfb\u5217:"),f.text("\u578b\u53f7:"),e.text("\u7b2c\u4e09\u65b9\u51fd\u5f0f\u5e93"),d.text("\u5916\u8bbe\u529f\u80fd"),$("#field1_span").html("\u6b22\u8fce\u6765\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u8fd9\u91cc\u914d\u7f6e\u5916\u8bbe\u529f\u80fd\u5e76\u751f\u6210\u6e90\u4ee3\u7801\u3002<br />\u73a9\u5f97\u5f00\u5fc3\uff01 (\u89c2\u770b\u5feb\u901f\u4e0a\u624b&#128214;)")):
-1!==Y.indexOf("Traditional")?(h.text("\u6676\u7247\u7cfb\u5217:"),f.text("\u578b\u865f:"),e.text("\u7b2c\u4e09\u65b9\u51fd\u5f0f\u5eab"),d.text("\u9031\u908a\u529f\u80fd"),$("#field1_span").html("\u6b61\u8fce\u4f86\u5230NuTool - CodeGenerator\u3002<br />\u60a8\u53ef\u4ee5\u5728\u9019\u88e1\u914d\u7f6e\u9031\u908a\u529f\u80fd\u4e26\u751f\u6210\u539f\u59cb\u78bc\u3002<br />\u73a9\u5f97\u958b\u5fc3\uff01 (\u89c0\u770b\u5feb\u901f\u4e0a\u624b&#128214;)")):(h.text("Chip Series:"),f.text("Part No.:"),
e.text("Third Party Libraries"),d.text("Peripheral Functions"),$("#field1_span").html("Welcome to NuTool - CodeGenerator.<br />You can configure peripheral functions and generate code here.<br />Have fun! (Watch Quick Start &#128214;)")),window.external.saveUIlanguage("UIlanguage:"+Y),"undefined"!==typeof NUTOOL_PIN&&(pb(),NUTOOL_PIN.changeUIlanguage(),qb(),NUTOOL_CLOCK.changeUIlanguage()),"PinConfigure"===g?pb():"ClockConfigure"===g?qb():rb())});$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}},
{text:O,click:function(){""===Y&&(Y="English");$("#languageDialog").dialog("isOpen")&&$("#languageDialog").dialog("destroy")}}]})},generateCode:function(){var a,b,c="checked=true",g="checked=true",h="checked=true",f="checked=true",e="checked=true",d="",m="",r="",x="",v="",n="",H="",O="",D="",C=null,k=null,I,t=[],p=[],y="",M="",G=["Gitee","GitLab","GitHub"],J=[],K="",A="",B="",E="",q=[],V,z=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText,l="",u="",F=b=b=b=b=b=b=q="";var S=function(ua,$a){var tb,
Ma='*?"<>|'.split(""),ib=!0;var Na=0;for(tb=Ma.length;Na<tb;Na+=1){var Oa=Ma[Na];if(-1!==$a.indexOf(Ma[Na])){Ka("\u5de5\u7a0b\u8def\u5f84\u4e0d\u5e94\u8be5\u5305\u542b"+Oa+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u8def\u5f91\u4e0d\u61c9\u8a72\u5305\u542b"+Oa+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project path should not contain "+Oa+". Please fix it.");ib=!1;break}}Ma.push("\\");Ma.push("/");Ma.push(":");Na=0;for(tb=Ma.length;Na<tb;Na+=1)if(Oa=Ma[Na],-1!==ua.indexOf(Oa)){Ka("\u5de5\u7a0b\u540d\u79f0\u4e0d\u5e94\u8be5\u5305\u542b"+
Oa+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u540d\u7a31\u4e0d\u61c9\u8a72\u5305\u542b"+Oa+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project name should not contain "+Oa+". Please fix it.");ib=!1;break}$a.charAt(0).match(/^[a-zA-Z]/)&&$a.charAt(1).match(/^[:]/)&&$a.charAt(2).match(/^[\/\\]/)||(Ka("\u5de5\u7a0b\u8def\u5f84\u5f00\u5934\u5e94\u4e3a\u78c1\u789f\u673a\u4ee3\u53f7\u3001\u78c1\u789f\u533a\u5206\u9694\u7b26\u53f7\u548c\u5143\u4ef6\u5206\u9694\u7b26\u53f7(C:)\u3002\u8bf7\u4fee\u6b63\u5b83\u3002",
"\u5c08\u6848\u8def\u5f91\u958b\u982d\u61c9\u70ba\u78c1\u789f\u6a5f\u4ee3\u865f\u3001\u78c1\u789f\u5340\u5206\u9694\u7b26\u865f\u548c\u5143\u4ef6\u5206\u9694\u7b26\u865f(C:)\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project path should begin with a drive letter, a volume separator and a component separator (C:). Please fix it."),ib=!1);ua.slice(-1).match(/^[ .]/)&&(Ka("\u5de5\u7a0b\u540d\u79f0\u4e0d\u5e94\u4ee5\u7a7a\u683c\u6216\u53e5\u53f7\u7ed3\u5c3e\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u540d\u7a31\u4e0d\u61c9\u4ee5\u7a7a\u683c\u6216\u53e5\u865f\u7d50\u5c3e\u3002\u8acb\u4fee\u6b63\u5b83\u3002",
"The project name should not end with a space or peroid. Please fix it."),ib=!1);return ib};var w=function(){$("#generateCodeDialogTabs")[0]||(Pa='<div id="generateCodeDialogTabs"><ul>',Pa+='<li><a href="#generateCodeDialogTabs_Pin">'+d+"</a></li>",Pa+='<li><a href="#generateCodeDialogTabs_Clock">'+m+"</a></li></ul>",Pa+='<div id="generateCodeDialogTabs_Pin"></div>',Pa+='<div id="generateCodeDialogTabs_Clock"></div>',Pa+="</div>",$(Pa).insertAfter($("#generateCodeDialogMainPart_div")));t=NUTOOL_PIN.get_pin_descriptions();
I=10<t.length?"282px":"100%";0<t.length?(C=new Tabulator("#generateCodeDialogTabs_Pin",{height:I,data:t,layout:"fitColumns",columns:[{title:d,field:"pin",headerFilter:!0},{title:r,field:"description",headerFilter:!0},{title:x,field:"userDefined",headerFilter:!0,editor:!0,validator:["regex:^[a-zA-Z0-9 _]+$","maxLength:30"],tooltip:O}],cellEdited:function(ua){NUTOOL_PIN.setReviewReportTable(ua._cell.row.data.pinNumber,ua._cell.row.data.description,ua._cell.value)},langs:{Simplified:{headerFilters:{"default":"\u8fc7\u6ee4"}},
Traditional:{headerFilters:{"default":"\u904e\u6ffe..."}},English:{headerFilters:{"default":"filter..."}}}}),-1!==Y.indexOf("Simplified")?C.setLocale("Simplified"):-1!==Y.indexOf("Traditional")?C.setLocale("Traditional"):C.setLocale("English")):0===t.length&&(C=new Tabulator("#generateCodeDialogTabs_Pin",{height:I,placeholder:D}));p=NUTOOL_CLOCK.concatenate_generated_code_begin();I=10<p.length?"282px":"100%";0<p.length&&(k=new Tabulator("#generateCodeDialogTabs_Clock",{height:I,data:p,layout:"fitColumns",
columns:[{title:v,field:"module"},{title:n,field:"busClock"},{title:H,field:"engineClock"}],langs:{Simplified:{headerFilters:{"default":"\u8fc7\u6ee4"}},Traditional:{headerFilters:{"default":"\u904e\u6ffe..."}},English:{headerFilters:{"default":"filter..."}}}}),-1!==Y.indexOf("Simplified")?k.setLocale("Simplified"):-1!==Y.indexOf("Traditional")?k.setLocale("Traditional"):k.setLocale("English"))};var la=function(ua){z="Simplified Chinese"===z?"c":"Traditional Chinese"===z?"t":"e";if(NUTOOL_PER.g_cfg_downloadBSP.commitID.hasOwnProperty(NUTOOL_PER.g_toolVersion))K=
NUTOOL_PER.g_toolVersion;else for(J=va(NUTOOL_PER.g_cfg_downloadBSP.commitID),J.sort(qa),K=J[0],ta=0,a=J.length;ta<a;ta++)switch(Nb(NUTOOL_PER.g_toolVersion.toUpperCase().sliceAfterX("V"),J[ta].toUpperCase().sliceAfterX("V"))){case 1:K=J[ta];break;default:case -1:ta=a}K=NUTOOL_PER.g_cfg_downloadBSP.commitID[K];try{external.downloadBSPFromJS(NUTOOL_PER.g_toolVersion,ua,NUTOOL_PER.g_cfg_downloadBSP.repository,K,z)}catch($a){}};if(X())if(oa){if("undefined"!==typeof z&&-1!==z.indexOf("UIlanguage:")){l=
z.sliceAfterX("ProjectName:");l=l.slicePriorToX("\r");u=z.sliceAfterX("ProjectLocation:");u=u.slicePriorToX("\r");q=z.sliceAfterX("ProjectLocationHistory:");q=q.slicePriorToX("\r");b=z.sliceAfterX("CheckBSPCompatibility:");b=b.slicePriorToX("\r");b=z.sliceAfterX("CheckProjfile:");b=b.slicePriorToX("\r");"No"===b&&(c="");b=z.sliceAfterX("CheckCppcmd:");b=b.slicePriorToX("\r");"No"===b&&(g="");b=z.sliceAfterX("CheckRename:");b=b.slicePriorToX("\r");"No"===b&&(h="");b=z.sliceAfterX("CheckAStyle:");b=
b.slicePriorToX("\r");"No"===b&&(f="");b=z.sliceAfterX("CheckModularizeCode:");b=b.slicePriorToX("\r");if("No"===b||""===b)e="";z=z.sliceAfterX("UIlanguage:");z=z.slicePriorToX("\r");if("Simplified Chinese"===z){b="\u4ea7\u751f\u7a0b\u5f0f\u7801";var ia="\u5de5\u7a0b\u540d\u79f0";var ma="\u8bf7\u8f93\u5165\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u4f8b\u5982 BSP\\...\\SampleCode\uff0c\u7528\u4e8e\u5b58\u653e\u751f\u6210\u7684\u4ee3\u7801:";var ya="\u8bf7\u6ce8\u610f\uff0c\u672c\u8f6f\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u672f\u53c2\u8003\u624b\u518c\u6216\u89c4\u683c\u4e66\u3002\u7528\u6237\u5fc5\u987b\u53c2\u8003\u6700\u65b0\u6587\u6863\u4ee5\u786e\u4fdd\u6b63\u786e\u6027\u3002";
y="\u6765\u81ea";B="\u6216\u662f\u60a8\u53ef\u4ee5\u4ece\u6700\u8fd1\u7684\u5de5\u7a0b\u4e2d\u9009\u62e9\u4e00\u4e2a";E="\u6d4f\u89c8";var ka="\u6a21\u7ec4\u5316\u4ee3\u7801";var La="\u68c0\u9605\u62a5\u544a";d="\u811a\u4f4d";m="\u65f6\u8109";r="\u63cf\u8ff0";x="\u7528\u6237\u5b9a\u4e49";O="\u4ec5\u9650\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u5e95\u7ebf\u3002\n\u6700\u5927\u8f93\u5165\u957f\u5ea6\u4e3a30\u3002";D="\u6ca1\u6709\u53ef\u7528\u6570\u636e\uff0c\u56e0\u4e3a\u5c1a\u672a\u914d\u7f6e\u3002";
v="\u6a21\u5757";n="\u6c47\u6d41\u6392\u9891\u7387";H="\u5f15\u64ce\u9891\u7387";var ub="\u786e\u5b9a";var vb="\u4e0b\u8f7dBSP"}else"Traditional Chinese"===z?(b="\u7522\u751f\u7a0b\u5f0f\u78bc",ia="\u5c08\u6848\u540d\u7a31",ma="\u8acb\u8f38\u5165\u8cc7\u6599\u593e\u8def\u5f91\uff0c\u4f8b\u5982 BSP\\...\\SampleCode\uff0c\u7528\u65bc\u5b58\u653e\u751f\u6210\u7684\u7a0b\u5f0f\u78bc:",ya="\u8acb\u6ce8\u610f\uff0c\u672c\u8edf\u4ef6\u4e0d\u80fd\u53d6\u4ee3\u6280\u8853\u53c3\u8003\u624b\u518a\u6216\u898f\u683c\u66f8\u3002\u7528\u6236\u5fc5\u9808\u53c3\u8003\u6700\u65b0\u6587\u6a94\u4ee5\u78ba\u4fdd\u6b63\u78ba\u6027\u3002",
y="\u4f86\u81ea",B="\u6216\u662f\u60a8\u53ef\u4ee5\u5f9e\u6700\u8fd1\u7684\u5c08\u6848\u4e2d\u9078\u64c7\u4e00\u500b",E="\u700f\u89bd",ka="\u6a21\u7d44\u5316\u7a0b\u5f0f\u78bc",La="\u6aa2\u95b1\u5831\u544a",d="\u8173\u4f4d",m="\u6642\u8108",r="\u63cf\u8ff0",x="\u7528\u6236\u5b9a\u7fa9",O="\u50c5\u9650\u82f1\u6587\u5b57\u6bcd\u3001\u6578\u5b57\u548c\u5e95\u7dda\u3002\n\u6700\u5927\u8f38\u5165\u9577\u5ea6\u70ba30\u3002",D="\u6c92\u6709\u53ef\u7528\u6578\u64da\uff0c\u56e0\u70ba\u5c1a\u672a\u914d\u7f6e\u3002",
v="\u6a21\u7d44",n="\u532f\u6d41\u6392\u983b\u7387",H="\u5f15\u64ce\u983b\u7387",ub="\u78ba\u5b9a",vb="\u4e0b\u8f09BSP"):(b="Generate Code",ia="Project Name",ma="Please input a folder path, e.g. BSP\\...\\SampleCode, for storing the generated code:",ya="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",y="From ",B="Or you can choose a folder from recent projects",E="Browse",ka="Modularize Code",
La="Review Report",d="Pin",m="Clock",r="Description",x="User Defined",O="English letters, digits and underscores only.\nMaximum length of input is 30.",D="No data available because not configured yet.",v="Module",n="Bus Clock",H="Engine Clock",ub="Confirm",vb="Download BSP")}else b="Generate Code",ia="Project Name",ma="Please input a folder path, e.g. BSP\\...\\SampleCode, for storing the generated code:",ya="Please note that the tool is not a replacement for the technical reference manual or datasheet. The user must refer to the latest documentation for the correctness.",
y="BSP From ",B="Or you can choose a folder from recent projects",E="Browse",ka="Modularize Code",La="Review Report",ub="Confirm",vb="Download BSP";""===l.trim()&&(l="MyProject");if(""!==q.trim()){q=q.split(">");A='<br /><select id="generateCodeDialogSelect" style="width: 450px;height:30px;"><option value="default">'+B+"</option>";var ta=0;for(a=q.length-1;ta<a;ta++)A+='<option value="'+q[ta]+'">'+q[ta]+"</option>";A+="</select>"}-1==="MA35D1 ML51 ML56 ML5156 MS51_8K MS51_8KDB MS51_16K MS51_32K".split(" ").indexOf(W)&&
0!==NUTOOL_PIN.g_cfg_gpiosDefines.length&&1<NUTOOL_PIN.g_cfg_gpiosDefines[0].f.length&&0===NUTOOL_PIN.g_cfg_gpiosDefines[0].f[1].indexOf("GPIO:")||(e=ka="");Va();Ob();ob();var Pa=Ia?'<div id="generateCodeDialogMainPart_div"><label>'+ia+': <input type="text" id="inputText_projectName" value="'+l+'" style="width:250px;height:30px;"></label><br /><br /><label><p>'+ma+'</p></label><label><input id="generateCodeDialogInput" type="text" style="width:370px;height:30px;" value="'+u+'"><button id="generateCodeDialogBrowseFolder" style="width:80px;height:30px;">'+
E+"</button></label>"+A+'<br /><br /><label><input type="checkbox" id="projfileCheckbox" '+c+'/> Run Projfile</label><br /><label><input type="checkbox" id="cppcmdCheckbox" '+g+'/> Run Cppcmd</label><br /><label><input type="checkbox" id="astyleCheckbox" '+f+'/> Run AStyle</label><br /><label><input type="checkbox" id="renameCheckbox" '+h+"/> Run Rename</label><p>"+ya+'</p><label><input type="checkbox" id="checkbox_ModularizeCode" '+e+"/> "+ka+'</label><input type="text" size="1" style="position:relative;top:-5000px;"/></div>':
'<div id="generateCodeDialogMainPart_div"><label>'+ia+': <input type="text" id="inputText_projectName" value="'+l+'" style="width:250px;height:30px;"></label><br /><br /><label><p>'+ma+'</p></label><label><input id="generateCodeDialogInput" type="text" style="width:370px;height:30px;" value="'+u+'"><button id="generateCodeDialogBrowseFolder" style="width:80px;height:30px;">'+E+"</button></label>"+A+"<br /><br /><p>"+ya+'</p><label><input type="checkbox" id="checkbox_ModularizeCode" '+e+"/> "+ka+'</label><input type="text" size="1" style="position:relative;top:-5000px;"/></div>';
$('<div id="generateCodeDialog">'+Pa+"</div>").dialog({modal:!1,resizable:!1,title:b,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},create:function(ua,$a){M+="<div class='btn-group dropup'>";M+="<button type='button' class='ui-widget ui-state-default ui-corner-all ui-button-text-only dropdown-toggle' data-toggle='dropdown' style='height:31px;'>"+vb+"  <span class='caret'></span></button>";M+="<ul class='dropdown-menu' role='menu'>";ta=
0;for(a=G.length;ta<a;ta++)M+="<li><a id="+G[ta]+">"+y+G[ta]+"</a></li>";M+="</ul></div>";$(this).closest(".ui-dialog").find(".ui-dialog-buttonset").prepend(M);$("<label class='generateCodeDialog_ReviewReport' ><input type='checkbox' id='checkbox_ReviewReport'/> "+La+"</label>").prependTo($(this).dialog("widget").find(".ui-dialog-buttonpane"))},buttons:[{id:"generateCodeDialog_buttonOk",text:ub,click:function(){$("#generateCodeDialog_buttonOk").button("disable");$("#generateCodeDialog_buttonDownload").button("disable");
""===$("#inputText_projectName").val().trim()&&$("#inputText_projectName").val("MyProject");if(S($("#inputText_projectName").val(),$("#generateCodeDialogInput").val())){if(Ia)try{V=external.generateCodeFromJS($("#inputText_projectName").val(),$("#generateCodeDialogInput").val(),"checkVersionCheckbox:"+$("#checkVersionCheckbox").is(":checked")+"/projfileCheckbox:"+$("#projfileCheckbox").is(":checked")+"/cppcmdCheckbox:"+$("#cppcmdCheckbox").is(":checked")+"/renameCheckbox:"+$("#renameCheckbox").is(":checked")+
"/astyleCheckbox:"+$("#astyleCheckbox").is(":checked")+"/CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"),Za)}catch(ua){}else try{V=external.generateCodeFromJS($("#inputText_projectName").val(),$("#generateCodeDialogInput").val(),"checkVersionCheckbox:"+$("#checkVersionCheckbox").is(":checked")+"/projfileCheckbox:true/cppcmdCheckbox:true/renameCheckbox:true/astyleCheckbox:true/CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"),Za)}catch(ua){}V&&$("#generateCodeDialog").dialog("isOpen")&&
$("#generateCodeDialog").dialog("destroy")}$("#generateCodeDialog_buttonOk").button("enable");$("#generateCodeDialog_buttonDownload").button("enable")}}]});$("#generateCodeDialogInput").keypress(function(ua){switch(ua.which){case 22:$("#generateCodeDialogInput").val(window.clipboardData.getData("Text"))}});$("#generateCodeDialogBrowseFolder").click(function(){""===$("#inputText_projectName").val().trim()&&$("#inputText_projectName").val("MyProject");try{external.generateCodeFromJS($("#inputText_projectName").val(),
"generateCodeDialogInput:none","checkVersionCheckbox:"+$("#checkVersionCheckbox").is(":checked")+"/projfileCheckbox:"+$("#projfileCheckbox").is(":checked")+"/cppcmdCheckbox:"+$("#cppcmdCheckbox").is(":checked")+"/renameCheckbox:"+$("#renameCheckbox").is(":checked")+"/astyleCheckbox:"+$("#astyleCheckbox").is(":checked")+"/CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"),Za)}catch(ua){}""!==NUTOOL_PER.g_perFunctionString&&-1!==NUTOOL_PER.g_perFunctionString.indexOf(":")&&$("#generateCodeDialogInput").val(NUTOOL_PER.g_perFunctionString);
$("#generateCodeDialog").focus()});$("#generateCodeDialogSelect").change(function(){"default"!==$("#generateCodeDialogSelect").val()&&($("#generateCodeDialogInput").val($("#generateCodeDialogSelect").val()),$("#generateCodeDialogSelect").val($("#generateCodeDialogSelect option:first-child").val()))});$("#checkbox_ReviewReport").change(function(){$("#checkbox_ReviewReport").is(":checked")?(w(),$("#generateCodeDialogTabs").tabs(),$("#generateCodeDialogTabs ul li").css({width:"70px"}),$("#generateCodeDialogMainPart_div").hide(),
$(this).closest(".ui-dialog").find(".ui-dialog-buttonset").hide()):($("#generateCodeDialogTabs").remove(),$("#generateCodeDialogMainPart_div").show(),$(this).closest(".ui-dialog").find(".ui-dialog-buttonset").show())});$("#GitHub").click(function(){la("GitHub")});$("#GitLab").click(function(){la("GitLab")});$("#Gitee").click(function(){la("Gitee")})}else"undefined"!==typeof NUTOOL_PIN&&(F="PeripheralConfigure//"),Sa(L.slicePriorToX("_PeripheralConfigure"),function(){Ba(F+W+"//"+L.slicePriorToX("_PeripheralConfigure")+
".txt");delete Z[L.slicePriorToX("_PeripheralConfigure")];oa=!0;$("#perFunctionTree").jstree("uncheck_node",$("#"+L))})},executePDFfail:function(){Ka("\u60a8\u7684\u7535\u8111\u4e0d\u80fd\u6267\u4ecePDF\u6863\u3002\u8bf7\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u6765\u652f\u63f4\u5b83\u3002","\u60a8\u7684\u96fb\u8166\u4e0d\u80fd\u57f7\u5f9ePDF\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")},
generateCodeFail:function(){Ka("\u5728\u4ea7\u751f\u7a0b\u5f0f\u8fc7\u7a0b\u4e2d\u51fa\u4e86\u70b9\u95ee\u9898\u3002","\u5728\u7522\u751f\u7a0b\u5f0f\u78bc\u904e\u7a0b\u4e2d\u51fa\u4e86\u9ede\u554f\u984c\u3002","Something was wrong during generating code.")},alpacaValidationSuccess:function(){oa=!0},alpacaValidationFailure:function(){oa=!1},g_readConfigFilePath:"",g_perFunctionString:""}})(NUTOOL_PER,this);
