var $jscomp=$jscomp||{};$jscomp.scope={};$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(Ca,Ta,Fa){if(Ca==Array.prototype||Ca==Object.prototype)return Ca;Ca[Ta]=Fa.value;return Ca};
$jscomp.getGlobal=function(Ca){Ca=["object"==typeof globalThis&&globalThis,Ca,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var Ta=0;Ta<Ca.length;++Ta){var Fa=Ca[Ta];if(Fa&&Fa.Math==Math)return Fa}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(Ca,Ta){var Fa=$jscomp.propertyToPolyfillSymbol[Ta];if(null==Fa)return Ca[Ta];Fa=Ca[Fa];return void 0!==Fa?Fa:Ca[Ta]};$jscomp.polyfill=function(Ca,Ta,Fa,Na){Ta&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(Ca,Ta,Fa,Na):$jscomp.polyfillUnisolated(Ca,Ta,Fa,Na))};
$jscomp.polyfillUnisolated=function(Ca,Ta,Fa,Na){Fa=$jscomp.global;Ca=Ca.split(".");for(Na=0;Na<Ca.length-1;Na++){var Xa=Ca[Na];if(!(Xa in Fa))return;Fa=Fa[Xa]}Ca=Ca[Ca.length-1];Na=Fa[Ca];Ta=Ta(Na);Ta!=Na&&null!=Ta&&$jscomp.defineProperty(Fa,Ca,{configurable:!0,writable:!0,value:Ta})};
$jscomp.polyfillIsolated=function(Ca,Ta,Fa,Na){var Xa=Ca.split(".");Ca=1===Xa.length;Na=Xa[0];Na=!Ca&&Na in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var Sb=0;Sb<Xa.length-1;Sb++){var yc=Xa[Sb];if(!(yc in Na))return;Na=Na[yc]}Xa=Xa[Xa.length-1];Fa=$jscomp.IS_SYMBOL_NATIVE&&"es6"===Fa?Na[Xa]:null;Ta=Ta(Fa);null!=Ta&&(Ca?$jscomp.defineProperty($jscomp.polyfills,Xa,{configurable:!0,writable:!0,value:Ta}):Ta!==Fa&&(void 0===$jscomp.propertyToPolyfillSymbol[Xa]&&(Fa=1E9*Math.random()>>>0,
$jscomp.propertyToPolyfillSymbol[Xa]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(Xa):$jscomp.POLYFILL_PREFIX+Fa+"$"+Xa),$jscomp.defineProperty(Na,$jscomp.propertyToPolyfillSymbol[Xa],{configurable:!0,writable:!0,value:Ta})))};$jscomp.polyfill("Array.prototype.fill",function(Ca){return Ca?Ca:function(Ta,Fa,Na){var Xa=this.length||0;0>Fa&&(Fa=Math.max(0,Xa+Fa));if(null==Na||Na>Xa)Na=Xa;Na=Number(Na);0>Na&&(Na=Math.max(0,Xa+Na));for(Fa=Number(Fa||0);Fa<Na;Fa++)this[Fa]=Ta;return this}},"es6","es3");
$jscomp.typedArrayFill=function(Ca){return Ca?Ca:Array.prototype.fill};$jscomp.polyfill("Int8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Int32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float64Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.findInternal=function(Ca,Ta,Fa){Ca instanceof String&&(Ca=String(Ca));for(var Na=Ca.length,Xa=0;Xa<Na;Xa++){var Sb=Ca[Xa];if(Ta.call(Fa,Sb,Xa,Ca))return{i:Xa,v:Sb}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(Ca){return Ca?Ca:function(Ta,Fa){return $jscomp.findInternal(this,Ta,Fa).v}},"es6","es3");var NUTOOL_CLOCK={};
(function(){function Ca(b){function a(l,z,fa){var ma=fa(l);if(l&&(z(l),ma)){var ua=ma.length;for(l=0;l<ua;l++)a(ma[l],z,fa)}}function d(){zc.sort(function(l,z){return z.name.toLowerCase()<l.name.toLowerCase()?1:-1})}function e(l,z){var fa=[];cc();eb=l;Ha.selectAll("g.node").sort(function(ma){return ma.id!=eb.id?1:-1});Ha.selectAll("path.link").filter(function(ma){return ma.target.id==eb.id?!0:!1}).remove();va=eb.name;if("SYSTICK"!==va){if(ja=NUTOOL_CLOCK.g_Module.hasOwnProperty(va)?NUTOOL_CLOCK.g_Module[va][0]:
va+Ka,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(Ma=0,w=NUTOOL_CLOCK.g_CLKSEL[ja].length;Ma<w;Ma+=1)fa.push(NUTOOL_CLOCK.g_CLKSEL[ja][Ma].slicePriorToX(":").slicePriorToX("/").toString())}else{ja=NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ca)?ca:NUTOOL_CLOCK.g_Module[va][0];if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(Ma=0,w=NUTOOL_CLOCK.g_CLKSEL[ja].length;Ma<w;Ma+=1)fa.push(NUTOOL_CLOCK.g_CLKSEL[ja][Ma].slicePriorToX(":").slicePriorToX("/").toString());else fa.push(ja.slicePriorToX("/").toString());
fa.push("CPUCLK")}Ha.selectAll("g.node").data(zc.nodes(ub),function(ma){return ma.id||(ma.id=++Ma)}).select("circle.nodeCircle").style("fill",function(ma){var ua=!1;if(0<fa.length&&-1!==$.inArray(ma.name,fa)||ma.name===ja)ua=!0;return ua?"blue":"#41AF88"});d3.select(z).select(".ghostCircle").attr("pointer-events","none");d3.selectAll(".ghostCircle").data(zc.nodes(ub),function(ma){return ma.id||(ma.id=++Ma)}).attr("class",function(ma){var ua=!1;if(0<fa.length&&-1!==$.inArray(ma.name,fa)||ma.name===
ja)ua=!0;return ua?"ghostCircle show":"ghostCircle"});d3.select(z).attr("class","node activeDrag");Ua=!1}function h(l){var z=-ub.y;var fa=-ub.x;z*=l;fa=fa*l+3*Ic/4;d3.select("g").transition().duration(oa).attr("transform","translate("+z+","+fa+")scale("+l+")");Ac.scale(l);Ac.translate([z,fa])}function f(l){Ha.selectAll("path.selected").data([]).exit().remove();Ha.selectAll("path.selected").data(l).enter().append("svg:path").attr("class","selected").attr("d",Lc)}function g(l){var z;cc();if(l.enabled){"RTC"===
l.name&&"undefined"!==typeof NUTOOL_CLOCK.g_Module.CLKO_1Hz&&-1!==NUTOOL_CLOCK.g_Module.CLKO_1Hz[0].indexOf("RTC")&&-1!==$.inArray("CLKO_1Hz",G)?Ba(l.name,["CLKO_1Hz"]):Ba(l.name);Va(l.name,!0);for(z=[];!_.isUndefined(l);)z.push(l),l=l.parent;var fa=[];Ha.selectAll("path.link").filter(function(ma){return _.any(z,function(ua){return ua===ma.target})}).each(function(ma){fa.push(ma)});f(fa)}}function m(l){var z;cc();oc=!0;if(-1===$.inArray(l.name,c)){nb(l.name,l.enabled);E(l);if(l.enabled){var fa=[];
for(z=l;!_.isUndefined(z);)fa.push(z),z=z.parent;var ma=[];Ha.selectAll("path.link").filter(function(ua){return _.any(fa,function(aa){return aa===ua.target})}).each(function(ua){ma.push(ua)});f(ma)}else Ha.selectAll("path.selected").data([]).exit().remove();dc.hide(l);$("#tabs").tabs("option","active")+1==gb&&dc.show(l)}else 0===l.name.indexOf("LIRC")||0===l.name.indexOf(Q)||0===l.name.indexOf("HIRC48")||0===l.name.indexOf("MIRC")||0===l.name.indexOf("LXT")||0===l.name.indexOf(Y)||0===l.name.indexOf("RTC32k")?
$("#tabs").tabs({active:0}):-1!==l.name.indexOf("PLL")?$("#tabs").tabs({active:1}):(0===l.name.indexOf(bb)||0===l.name.indexOf(Qa)||0===l.name.indexOf("CPUCLK"))&&$("#tabs").tabs({active:$("#tabs").tabs("option","active")-1}),dc.hide(l)}function D(l){if("undefined"!==typeof l.parent){if(k(l.parent))return 1;-1!==T.indexOf("Simplified")?Da("\u56e0\u524d\u9762\u7684\u65f6\u8109\u6e90\u662f\u5173\u95ed\u72b6\u6001\uff0c\u6240\u4ee5"+l.name+" \u4e0d\u80fd\u88ab\u5f00\u542f\u3002"):-1!==T.indexOf("Traditional")?
Da("\u56e0\u524d\u9762\u7684\u6642\u8108\u6e90\u662f\u95dc\u9589\u72c0\u614b\uff0c\u6240\u4ee5"+l.name+" \u4e0d\u80fd\u88ab\u958b\u555f\u3002"):Da("Since the preceding clock source is disabled, "+l.name+" cannot be enabled.");return 0}}function k(l){if("undefined"!==typeof l.parent)var z=k(l.parent);else return l.enabled;return z?l.enabled:0}function L(l){var z,fa;d3.selectAll("g.node").each(function(aa){aa.name.toLowerCase()===l.toLowerCase()&&(z=aa)});var ma=[];for(fa=z;!_.isUndefined(fa);)ma.push(fa),
fa=fa.parent;var ua=[];Ha.selectAll("path.link").filter(function(aa){return _.any(ma,function(qb){return qb===aa.target})}).each(function(aa){ua.push(aa)});f(ua)}function H(l,z,fa,ma,ua){var aa={},qb={};"undefined"===typeof fa&&(fa=!1);d3.selectAll("g.node").each(function(Tb){Tb.name===z&&(aa=Tb)});d3.selectAll("g.node").each(function(Tb){Tb.name===l&&(qb=Tb)});Ha.selectAll("path.selected").data([]).exit().remove();Ha.selectAll("path.link").filter(function(Tb){return Tb.target.id==qb.id?!0:!1}).remove();
var ob=qb.parent.children.indexOf(qb);-1<ob&&qb.parent.children.splice(ob,1);"undefined"!==typeof aa.children||"undefined"!==typeof aa._children?"undefined"!==typeof aa.children?aa.children.push(qb):aa._children.push(qb):(aa.children=[],aa.children.push(qb));ob=$.inArray(l,G);-1!==ob&&(G.splice(ob,1),J.splice(ob,1),G.push(l),qb.freq=$("#"+l+"_span_showRealFreq").text(),J.push(qb.freq));ua!==ma&&rb(l,z);fa&&E(ub)}function W(l,z,fa){var ma={};"undefined"===typeof z&&(z=!1);d3.selectAll("g.node").each(function(aa){aa.name===
l&&(ma=aa)});var ua=$.inArray(l,G);-1!==ua&&(G.splice(ua,1),J.splice(ua,1),G.push(l),ma.freq=$("#"+l+"_span_showRealFreq").text(),J.push(ma.freq));va=l;-1!==fa&&xb!==fa&&rb(va);z&&E(ub)}function E(l){var z=zc.nodes(ub).reverse(),fa=zc.links(z);z.forEach(function(aa){aa.y=10*aa.depth*(Oa+3)});var ma=Ha.selectAll("g.node").data(z,function(aa){return aa.id||(aa.id=++Ma)});var ua=ma.enter().append("g").call(Od).attr("class","node").attr("id",function(aa){return aa.name}).attr("transform",function(){return"translate("+
l.y0+","+l.x0+")"}).on("click",g).on("dblclick",m).on("updateFromCanvas",H).on("updateFromDividerDialog",W).on("zoomFromToolbar",h).on("searchFromInput",L).on("mouseover",function(aa){d3.select(this).classed("hover",!0);aa==ub||-1!==$.inArray(aa.name,c)?d3.select(this).classed("notDraggable",!0):d3.select(this).classed("notDraggable",!1);dc.hide(aa);$("#tabs").tabs("option","active")+1!=gb||ic||aa===ub||dc.show(aa)}).on("mouseout",function(aa){d3.select(this).classed("hover",!1);dc.hide(aa)});ua.append("circle").attr("class",
"nodeCircle");ua.append("text").attr("x",function(){return 10}).attr("dy",".35em").attr("class","nodeText").attr("text-anchor",function(){return"start"}).text(function(aa){return aa.enabled&&-1!==aa.freq?aa.name+":"+aa.freq:aa.name}).style("fill-opacity",0);ua.append("circle").attr("class","ghostCircle").attr("r",30).attr("opacity",.2).style("fill","lightyellow").attr("pointer-events","mouseover").on("mouseover",function(aa){Pd(aa)}).on("mouseout",function(aa){Qd(aa)});ma.select("text").attr("x",
function(){return 10}).attr("text-anchor",function(){return"start"}).attr("font-weight",function(aa){return aa.children||aa._children?"bold":"normal"}).text(function(aa){return aa.enabled&&-1!==aa.freq?aa.name+":"+aa.freq:aa.name});ma.select("circle.nodeCircle").attr("r",4.5).style("fill",function(aa){return aa.enabled?"#41AF88":"#fff"});ma.transition().duration(oa).attr("transform",function(aa){return"translate("+aa.y+","+aa.x+")"}).select("text").style("fill-opacity",1);ma=ma.exit().transition().duration(oa).attr("transform",
function(){return"translate("+l.y+","+l.x+")"}).remove();ma.select("circle").attr("r",0);ma.select("text").style("fill-opacity",0);fa=Ha.selectAll("path.link").data(fa,function(aa){return aa.target.id});fa.enter().insert("path","g").attr("class","link").style("stroke",function(){return"LightSteelBlue"}).attr("d",function(){var aa={x:l.x0,y:l.y0};return Lc({source:aa,target:aa})});fa.transition().duration(oa).attr("d",Lc);fa.exit().transition().duration(oa).attr("d",function(){var aa={x:l.x,y:l.y};
return Lc({source:aa,target:aa})}).remove();z.forEach(function(aa){aa.x0=aa.x;aa.y0=aa.y})}var w,q,A,R=$("#tabs"),S={},c=[],na=[],u=[],n=[],M=[],F=[],ka=[],O=[],wa=[],C=[],B=[],N=[],U=[],ra=[],Ia=[],r=[],I=[],y=[],x=[],G=[],J=[],pa=Ab(NUTOOL_CLOCK.g_Module),Pa="OSC10K_EN".toEquivalent().toString(),qa="OSC22M_EN".toEquivalent().toString(),ha="XTL32K_EN".toEquivalent().toString(),K="XTL12M_EN".toEquivalent().toString(),Ja="PWRCON".toEquivalent().toString(),v="HCLK_S".toEquivalent().toString(),ca="STCLK_S".toEquivalent().toString(),
da="CLKO".toEquivalent().toString(),la="CLKO_Divider".toEquivalent().toString(),Ga="CLKO1".toEquivalent().toString(),Aa="CLKO1_Divider".toEquivalent().toString(),za="SYST_CSR".toEquivalent().toString(),Ka="_S".toEquivalent().toString(),Y="HXT".toEquivalent().toString(),ea="PLL".toEquivalent().toString(),Q="HIRC".toEquivalent().toString(),bb="HCLK".toEquivalent().toString(),Qa="PCLK".toEquivalent().toString(),$b,Ya,ib,vb,$a,xa,hb,oc=!1,Ua;var pb=function(l,z){l=l.slicePriorToX("/").toString();"CPUCLK"===
l?na.push(z):"LIRC"===l?u.push(z):"HIRC48"===l?M.push(z):l===Q?n.push(z):"MIRC"===l?F.push(z):"MIRC1P2M"===l?ka.push(z):"RTC32k"===l?O.push(z):"LXT"===l?wa.push(z):l===Y?C.push(z):l===ea?B.push(z):"PLL2"===l?N.push(z):"PLL480M"===l?U.push(z):"APLL"===l?ra.push(z):"HSUSB_OTG_PHY"===l?Ia.push(z):l===bb?r.push(z):l===Qa?I.push(z):"PCLK0"===l?y.push(z):"PCLK1"===l&&x.push(z)};var jb=function(l){var z,fa=[];var ma=0;for(z=l.length;ma<z;ma+=1){var ua={};ua.name=l[ma];var aa=$.inArray(ua.name,G);-1!==aa?
(ua.enabled=1,ua.freq=J[aa]):(ua.enabled=0,ua.freq=-1);aa="CPUCLK"===ua.name?na:"LIRC"===ua.name?u:"HIRC48"===ua.name?M:ua.name===Q?n:"MIRC"===ua.name?F:"MIRC1P2M"===ua.name?ka:"RTC32k"===ua.name?O:"LXT"===ua.name?wa:ua.name===Y?C:ua.name===ea?B:"PLL2"===ua.name?N:"PLL480M"===ua.name?U:"APLL"===ua.name?ra:"HSUSB_OTG_PHY"===ua.name?Ia:ua.name===bb?r:ua.name===Qa?I:"PCLK0"===ua.name?y:"PCLK1"===ua.name?x:{};0<aa.length&&(ua.children=jb(aa));(Mc&&ua.enabled||!Mc)&&fa.push(ua)}return fa};var nb=function(l,
z){z?Ba(l):Va(l,!0)};var Va=function(l,z){var fa;"undefined"===typeof z&&(z=!1);d3.selectAll("g.node").each(function(ma){ma.name===l&&(fa=ma)});if(!D(fa))return!1;if("undefined"!==typeof NUTOOL_CLOCK.g_Module[l]){l===da?(Ba(la),Ba("CLKO_1Hz")):l===la&&(Ba(da),Ba("CLKO_1Hz"));l===Ga?Ba(Aa):l===Aa?Ba(Ga):"CLKO_1Hz"==l&&(Ba(da),Ba(la));z?($("#"+wb+"_div")[0]&&($("#"+wb+"_div").hide(),$("#"+wb+"_canvas").hide(),$("#"+wb+"_div_protection").hide(),$("#"+wb+"_div_showRealFreq").hide()),l===da||l===la||l===
Ga||l===Aa?Fa("tab-4",l,"","",NUTOOL_CLOCK.g_Module[l][2]):Ta("tab-4",l,"","",NUTOOL_CLOCK.g_Module[l][2]),wb=l):Na("tab-4",l,"","");Ra=NUTOOL_CLOCK.g_Module[l][1];sa=[];ta=0;if(-1!==Ra.indexOf("/"))for(;-1!==Ra.indexOf("/")&&!(sa.push(Ra.slicePriorToX("/")),Ra=Ra.sliceAfterX("/"),ta+=1,10<ta););sa.push(Ra);V=0;for(q=sa.length;V<q;V+=1)ya(sa[V],1,"",Bc);G.push(l);J.push($("#"+l+"_span_showRealFreq").text());d3.selectAll("g.node").each(function(ma){ma.name===l&&(ma.enabled=1,ma.freq=$("#"+l+"_span_showRealFreq").text())});
"WWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.WDT&&-1===$.inArray("WDT",G)&&(Va("WDT")||Ba("WWDT")):"WDT"===l&&"undefined"!==typeof NUTOOL_CLOCK.g_Module.WWDT&&-1===$.inArray("WWDT",G)&&(Va("WWDT")||Ba("WDT"));"EWWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.EWDT&&-1===$.inArray("EWDT",G)&&(Va("EWDT")||Ba("EWWDT")):"EWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.EWWDT&&-1===$.inArray("EWWDT",G)&&(Va("EWWDT")||Ba("EWDT")):"CLKO_1Hz"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.RTC&&
-1===$.inArray("RTC",G)&&(Va("RTC")||Ba("CLKO_1Hz")):"USBH"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.HSUSBH&&-1===$.inArray("HSUSBH",G)&&(Va("HSUSBH")||Ba("USBH")):"HSUSBH"===l&&"undefined"!==typeof NUTOOL_CLOCK.g_Module.USBH&&-1===$.inArray("USBH",G)&&(Va("USBH")||Ba("HSUSBH"))}return!0};var Ba=function(l,z){z="undefined"!==typeof z?z:[];if("undefined"!==typeof NUTOOL_CLOCK.g_Module[l]){$("#"+l+"_div").remove();$("#"+l+"_canvas").remove();$("#"+l+"_div_protection").remove();$("#"+l+"_div_showRealFreq").remove();
Ra=NUTOOL_CLOCK.g_Module[l][1];sa=[];ta=0;if(-1!==Ra.indexOf("/"))for(;-1!==Ra.indexOf("/")&&!(sa.push(Ra.slicePriorToX("/")),Ra=Ra.sliceAfterX("/"),ta+=1,10<ta););sa.push(Ra);V=0;for(q=sa.length;V<q;V+=1)ya(sa[V],0,"",Bc);var fa=G.indexOf(l);-1!==fa&&(G.splice(fa,1),J.splice(fa,1));d3.selectAll("g.node").each(function(ma){ma.name===l&&(ma.enabled=0,ma.freq=-1)});"WWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.WDT&&-1!==$.inArray("WDT",G)&&-1===$.inArray("WDT",z)&&Ba("WDT"):"WDT"===l&&"undefined"!==
typeof NUTOOL_CLOCK.g_Module.WWDT&&-1!==$.inArray("WWDT",G)&&-1===$.inArray("WWDT",z)&&Ba("WWDT");"EWWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.EWDT&&-1!==$.inArray("EWDT",G)&&-1===$.inArray("EWDT",z)&&Ba("EWDT"):"EWDT"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.EWWDT&&-1!==$.inArray("EWWDT",G)&&-1===$.inArray("EWWDT",z)&&Ba("EWWDT"):"RTC"===l?"undefined"!==typeof NUTOOL_CLOCK.g_Module.CLKO_1Hz&&-1!==$.inArray("CLKO_1Hz",G)&&-1===$.inArray("CLKO_1Hz",z)&&Ba("CLKO_1Hz"):"USBH"===l?"undefined"!==
typeof NUTOOL_CLOCK.g_Module.HSUSBH&&-1!==$.inArray("HSUSBH",G)&&-1===$.inArray("HSUSBH",z)&&Ba("HSUSBH"):"HSUSBH"===l&&"undefined"!==typeof NUTOOL_CLOCK.g_Module.USBH&&-1!==$.inArray("USBH",G)&&-1===$.inArray("USBH",z)&&Ba("USBH")}};var rb=function(l,z){function fa(Vb){Vb.name===z&&(qb=Vb)}function ma(Vb){Vb.name===yb&&(ob=Vb)}var ua,aa,qb,ob;var Tb=function(Vb,Cc){var Ub=null,La=null;if(""===Cc)return!0;d3.selectAll("g.node").each(function(pc){pc.name===Cc&&(La=pc)});d3.selectAll("g.node").each(function(pc){pc.name===
Vb&&(Ub=pc)});if(null===Ub||null===La)return!1;Ha.selectAll("path.link").filter(function(pc){return pc.target.id==Ub.id?!0:!1}).remove();var Ad=Ub.parent.children.indexOf(Ub);-1<Ad&&Ub.parent.children.splice(Ad,1);"undefined"!==typeof La.children||"undefined"!==typeof La._children?"undefined"!==typeof La.children?La.children.push(Ub):La._children.push(Ub):(La.children=[],La.children.push(Ub));return!0};"undefined"===typeof z&&(z="");var jc=aa="";"undefined"!==typeof NUTOOL_CLOCK.g_Module[l]&&(aa=
NUTOOL_CLOCK.g_Module[l][0],jc=NUTOOL_CLOCK.g_Module[l][2]);if(-1!==aa.indexOf(Ka)||"none"!==jc){var qc=0;for(ua=pa.length;qc<ua;qc+=1){var yb=pa[qc];if(yb!==l&&"undefined"!==typeof NUTOOL_CLOCK.g_Module[yb]){var Bb=NUTOOL_CLOCK.g_Module[yb][0];var ec=NUTOOL_CLOCK.g_Module[yb][2];if(-1!==aa.indexOf(Ka)&&Bb.slicePriorToX("/").toString()===aa.slicePriorToX("/").toString()||"none"!==ec&&ec===jc)d3.selectAll("g.node").each(fa),d3.selectAll("g.node").each(ma),""!==z?Tb(yb,z)&&qb.enabled&&ob.enabled?(Bb=
$.inArray(yb,G),-1!==Bb&&(G.splice(Bb,1),J.splice(Bb,1),Na("tab-4",yb,"",""),G.push(yb),ob.freq=$("#"+yb+"_span_showRealFreq").text(),J.push(ob.freq))):!qb.enabled&&ob.enabled&&Ba(ob.name):ob.enabled&&(Bb=$.inArray(yb,G),-1!==Bb&&(G.splice(Bb,1),J.splice(Bb,1),Na("tab-4",yb,"",""),G.push(yb),ob.freq=$("#"+yb+"_span_showRealFreq").text(),J.push(ob.freq)))}}}};t(Pa)&&(G.push("LIRC"),J.push(Kb.toHzString()));if(t(qa)||t("HIRC1EN"))G.push(Q),J.push(Lb.toHzString());t("HIRC48EN")&&(G.push("HIRC48"),J.push(Mb.toHzString()));
t("MIRCEN")&&(G.push("MIRC"),J.push(Nb.toHzString()));t("MIRC1P2MEN")&&(G.push("MIRC1P2M"),J.push(Ob.toHzString()));0!==Pb&&(G.push("RTC32k"),J.push(Pb.toHzString()));if(t(ha)||t("LIRC32KEN"))G.push("LXT"),J.push(sb.toHzString());t(K)&&(G.push(Y),J.push(fb.toHzString()));if("undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]){switch(X("PLL_SRC")){case 1:n.push(ea);break;case 2:case 3:F.push(ea);break;case 0:C.push(ea);break;default:t(Pa)?n.push(ea):t("MIRCEN")?F.push(ea):C.push(ea)}t("PD")&&
!t("PLLEN")||-1===$.inArray(ea,Za)||(G.push(ea),J.push(ia.toHzString()))}"undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&(C.push("PLL2"),t("PLL2CKEN")&&-1!==$.inArray("PLL2",Za)&&(G.push("PLL2"),J.push(cb.toHzString())));0!==NUTOOL_CLOCK.g_PLL480Mfrequency&&(C.push("PLL480M"),t("PLL2CKEN")&&-1!==$.inArray("PLL480M",Za)&&(G.push("PLL480M"),J.push(Ib.toHzString())));"undefined"!==typeof NUTOOL_CLOCK.g_register_map.APLLCTL&&(C.push("APLL"),t("APD")||-1===$.inArray("APLL",Za)||(G.push("APLL"),
J.push(Wa.toHzString())));0!==NUTOOL_CLOCK.g_HSUSBOTGPHYfrequency&&(C.push("HSUSB_OTG_PHY"),t(K)&&-1!==$.inArray("HSUSB_OTG_PHY",Za)&&(G.push("HSUSB_OTG_PHY"),J.push(Yb.toHzString())));var ja=v;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja)){var Ma=0;for(w=NUTOOL_CLOCK.g_CLKSEL[ja].length;Ma<w;Ma+=1){var db=NUTOOL_CLOCK.g_CLKSEL[ja][Ma];var ac=X(ja);var Qb=parseInt(db.sliceAfterX(":"),10);if(ac===Qb){db=db.slicePriorToX(":").slicePriorToX("/").toString();pb(db,bb);break}}}G.push(bb);J.push(tb.toHzString());
"CPUCLK"!==bb&&(r.push("CPUCLK"),G.push("CPUCLK"),J.push(tb.toHzString()));0<Eb&&(pb(bb,Qa),G.push(Qa),J.push(Eb.toHzString()));0<Cb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("PCLK0SEL".toEquivalent().toString())&&(pb(bb,"PCLK0"),G.push("PCLK0"),J.push(Cb.toHzString()));0<Fb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("PCLK1SEL".toEquivalent().toString())&&(pb(bb,"PCLK1"),G.push("PCLK1"),J.push(Fb.toHzString()));c=[];0!==NUTOOL_CLOCK.g_LIRCfrequency&&c.push("LIRC");0!==NUTOOL_CLOCK.g_HIRCfrequency&&c.push(Q);
0!==NUTOOL_CLOCK.g_HIRC48frequency&&c.push("HIRC48");0!==NUTOOL_CLOCK.g_MIRCfrequency&&c.push("MIRC");0!==NUTOOL_CLOCK.g_MIRC1P2Mfrequency&&c.push("MIRC1P2M");0!==NUTOOL_CLOCK.g_RTC32kfrequency&&c.push("RTC32k");0!==_.filter(NUTOOL_CLOCK.g_register_map[Ja],function(l){return-1!==l.indexOf(ha+":")}).length&&c.push("LXT");0!==_.filter(NUTOOL_CLOCK.g_register_map[Ja],function(l){return-1!==l.indexOf(K+":")}).length&&c.push(Y);var kc=0;for(A=b.length;kc<A;kc+=1){var va=b[kc];ja="SYSTICK"!==va?NUTOOL_CLOCK.g_Module[va][0]:
t("CLKSRC")?"CPUCLK":NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ca)?ca:NUTOOL_CLOCK.g_Module[va][0];if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(Ma=0,w=NUTOOL_CLOCK.g_CLKSEL[ja].length;Ma<w;Ma+=1){if(NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(ja)){var Wb=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[ja][0];var lc=parseInt(Wb.sliceAfterX(":"),10);Wb=Wb.slicePriorToX(":");ac=X(ja)+(X(Wb)<<lc)>>>0}else ac=X(ja);db=NUTOOL_CLOCK.g_CLKSEL[ja][Ma];Qb=parseInt(db.sliceAfterX(":"),10);if(ac===Qb){db=db.slicePriorToX(":").slicePriorToX("/").toString();
pb(db,va);ja=db;break}else Ma===w-1&&(db=NUTOOL_CLOCK.g_CLKSEL[ja][0],Qb=parseInt(db.sliceAfterX(":"),10),ya(ja,Qb,!1,!1),db=db.slicePriorToX(":").slicePriorToX("/").toString(),pb(db,va),ja=db)}else ja=ja.slicePriorToX("/").toString(),pb(ja,va);var Ra=NUTOOL_CLOCK.g_Module[va][1];var sa=[];var ta=0;if(-1!==Ra.indexOf("/"))for(;-1!==Ra.indexOf("/")&&!(sa.push(Ra.slicePriorToX("/")),Ra=Ra.sliceAfterX("/"),ta+=1,10<ta););sa.push(Ra);var Ea=!0;var V=0;for(q=sa.length;V<q;V+=1)if(!Dc(sa[V])){Ea=!1;break}Ea&&
(-1!==$.inArray(ja,G)?(G.push(va),Na("tab-4",va,"",""),J.push($("#"+va+"_span_showRealFreq").text())):Ba(va))}S.name=kb.slicePriorToX("(");S.enabled=1;S.freq=-1;S.children=jb(c);c.push(ea,"PLL2","PLL480M","APLL","HSUSB_OTG_PHY",bb,Qa,"PCLK0","PCLK1","CPUCLK");var Oa=xa=0;var eb=hb=null;var oa=750;var ic=!1;var rc=R.width();var Ic=Nc;var zc=d3.layout.tree().size([Ic,rc]).nodeSize([15,70]);var Lc=d3.svg.diagonal().projection(function(l){return[l.y,l.x]});a(S,function(l){xa++;Oa=Math.max(l.name.length,
Oa)},function(l){return l.children&&0<l.children.length?l.children:null});d();var Ac=d3.behavior.zoom().scaleExtent([.1,3]).on("zoom",function(){Ha.attr("transform","translate("+d3.event.translate+")scale("+d3.event.scale+")")});var Rd=d3.behavior.drag().on("dragstart",function(){$("#"+wb+"_div")[0]&&($("#"+wb+"_div").hide(),$("#"+wb+"_canvas").hide(),$("#"+wb+"_div_protection").hide(),$("#"+wb+"_div_showRealFreq").hide())});var Bd=d3.select("#tab-4").append("svg").attr("width",rc).attr("height",
Ic).attr("class","overlay").call(Rd).call(Ac).on("dblclick.zoom",null).on("mouseover",function(){d3.select(this).classed("baseDraggable",!0)}).on("mouseout",function(){d3.select(this).classed("baseDraggable",!1)});$("html").hasClass("ie10+")&&$("#tab-4").dblclick(function(){oc||Cd("reviewReport");oc=!1});var dc=d3.tip().attr("class","d3-tip").html(function(l){var z="";var fa=[];if(!ic){if(-1!==T.indexOf("Simplified")){var ma="\u542f\u7528\u4e2d\u3002";var ua="\u505c\u7528\u4e2d\u3002";var aa="\u53cc\u51fb\u8282\u70b9\u53ef\u4ee5\u542f\u7528\u5b83\u3002";
var qb="\u53cc\u51fb\u8282\u70b9\u53ef\u4ee5\u505c\u7528\u5b83\u3002";var ob="\u62d6\u66f3\u8282\u70b9\u81f3\u5176\u4e2d\u4e00\u4e2a\u84dd\u8272\u8282\u70b9</br>\u53ef\u4ee5\u6539\u53d8\u5176\u65f6\u8109\u6e90\u3002</br>\u6eda\u52a8\u9f20\u6807\u6eda\u8f6e\u6765\u653e\u5927\u6216\u7f29\u5c0f\u3002</br>\u53cc\u51fb\u80cc\u666f\u53ef\u4ee5\u68c0\u9605\u62a5\u544a\u3002";var Tb="\u5355\u51fb\u8282\u70b9\u53ef\u4ee5\u663e\u793a\u5176\u7ec6\u90e8\u3002";var jc="\u53cc\u51fb\u8282\u70b9\u53ef\u4ee5\u663e\u793a\u5176\u7ec6\u90e8\u3002";
var qc="\u5b83\u6709";var yb="\u500b\u65f6\u8109\u6e90\u53ef\u4f9b\u4f7f\u7528:";var Bb="\u542f\u7528\u5668: ";var ec="\u9009\u62e9\u5668: ";var Vb="\u9664\u6cd5\u5668: ";var Cc="\u6c47\u6d41\u6392\u9891\u7387";var Ub="\u5f15\u64ce\u9891\u7387"}else-1!==T.indexOf("Traditional")?(ma="\u555f\u7528\u4e2d\u3002",ua="\u505c\u7528\u4e2d\u3002",aa="\u96d9\u64ca\u7bc0\u9ede\u53ef\u4ee5\u555f\u7528\u5b83\u3002",qb="\u96d9\u64ca\u7bc0\u9ede\u53ef\u4ee5\u505c\u7528\u5b83\u3002",ob="\u62d6\u66f3\u7bc0\u9ede\u81f3\u5176\u4e2d\u4e00\u500b\u85cd\u8272\u7bc0\u9ede</br>\u53ef\u4ee5\u6539\u8b8a\u5176\u6642\u8108\u6e90\u3002</br>\u6efe\u52d5\u9f20\u6a19\u6efe\u8f2a\u4f86\u653e\u5927\u6216\u7e2e\u5c0f\u3002</br>\u96d9\u64ca\u80cc\u666f\u53ef\u4ee5\u6aa2\u95b1\u5831\u544a\u3002",
Tb="\u55ae\u64ca\u7bc0\u9ede\u53ef\u4ee5\u986f\u793a\u5176\u7d30\u90e8\u3002",jc="\u96d9\u64ca\u7bc0\u9ede\u53ef\u4ee5\u986f\u793a\u5176\u7d30\u90e8\u3002",qc="\u5b83\u6709",yb="\u500b\u6642\u8108\u6e90\u53ef\u4f9b\u4f7f\u7528:",Bb="\u555f\u7528\u5668: ",ec="\u9078\u64c7\u5668: ",Vb="\u9664\u6cd5\u5668: ",Cc="\u532f\u6d41\u6392\u983b\u7387",Ub="\u5f15\u64ce\u983b\u7387"):(ma=" is enabled.",ua=" is disabled.",aa="Dblclicking on the node can enable it.",qb="Dblclicking on the node can disable it.",
ob="Dragging the node into one of the blue nodes</br>can change its clock source.</br>Rolling the mouse wheel can zoom in or out.</br>Dblclicking on the background can review report.",Tb="Clicking on the node can show details.",jc="Dblclicking on the node can show details.",qc="It has ",yb=" clock sources for use:",Bb="Activator: ",ec="Selector: ",Vb="Divider: ",Cc="Bus Clock",Ub="Engine Clock");va=l.name;if("SYSTICK"!==va)if(ja=NUTOOL_CLOCK.g_Module.hasOwnProperty(va)?NUTOOL_CLOCK.g_Module[va][0]:
va+Ka,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(Ma=0,w=NUTOOL_CLOCK.g_CLKSEL[ja].length;Ma<w;Ma+=1){var La=NUTOOL_CLOCK.g_CLKSEL[ja][Ma].slicePriorToX(":").slicePriorToX("/").toString();-1===$.inArray(La,fa)&&fa.push(La)}else ja!==va+Ka&&fa.push(ja);else{if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ca))for(Ma=0,w=NUTOOL_CLOCK.g_CLKSEL[ca].length;Ma<w;Ma+=1)La=NUTOOL_CLOCK.g_CLKSEL[ca][Ma].slicePriorToX(":").slicePriorToX("/").toString(),-1===$.inArray(La,fa)&&fa.push(La);else fa.push(NUTOOL_CLOCK.g_Module[va][0].slicePriorToX("/").toString());
fa.push("CPUCLK")}z=va;l.enabled?(l!==ub&&-1===$.inArray(va,c)?(z=z+ma+"</br>("+qb,$("#"+wb+"_div").is(":visible")&&wb===va||(z=z+"</br>"+Tb),z=z+"</br>"+ob):z=z+ma+"</br>("+jc,z+=")</br>"):z=l!==ub&&-1===$.inArray(va,c)?z+ua+"</br>("+aa+"</br>"+ob+")</br>":z+ua+"</br>("+jc+")</br>";if(0<fa.length)for(z=z+"<hr>"+qc+fa.length+yb+"</br>",Ma=0,w=fa.length;Ma<w;Ma+=1)z=z+(Ma+1)+". "+fa[Ma]+"</br>";if(NUTOOL_CLOCK.g_Module.hasOwnProperty(va)){z+="<hr>";Ra=NUTOOL_CLOCK.g_Module[va][1];sa=[];ta=0;if(-1!==
Ra.indexOf("/"))for(;-1!==Ra.indexOf("/")&&!(sa.push(Ra.slicePriorToX("/")),Ra=Ra.sliceAfterX("/"),ta+=1,10<ta););sa.push(Ra);z+=Bb;V=0;for(q=sa.length;V<q;V+=1)La=lb(sa[V]),0!==V&&""!==La&&(z+=" / "),z+=La;z+="</br>";Ya=[];if(-1!==NUTOOL_CLOCK.g_Module[va][0].indexOf(Ka)){ja=NUTOOL_CLOCK.g_Module[va][0];ta=0;if(-1!==ja.indexOf("/"))for(;-1!==ja.indexOf("/")&&!(Ya.push(ja.slicePriorToX("/")),ja=ja.sliceAfterX("/"),ta+=1,10<ta););Ya.push(ja);z+=ec;V=0;for(q=Ya.length;V<q;V+=1)0===V||md(Ya[V])||(z+=
" / "),z+=lb(Ya[V]),NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(Ya[V])&&(z=z+" / "+lb(NUTOOL_CLOCK.g_CLKSEL_EXTENDED[Ya[V]][0].slicePriorToX(":")));z+="</br>"}0===Ya.length&&"SYSTICK"===va&&(z=z+ec+za+"[2]</br>");"none"!==NUTOOL_CLOCK.g_Module[va][2]&&(z=z+Vb+lb(NUTOOL_CLOCK.g_Module[va][2])+"</br>")}else if(va===ea||"APLL"===va){sa=["PD","OE","PLLEN"];z=z+"<hr>"+Bb;V=0;for(q=sa.length;V<q;V+=1)z.lastIndexOf(Bb)+Bb.length!==z.length&&""!==lb(sa[V])&&(z+=" / "),z+=lb(sa[V]);Ya=["PLL_SRC"];V=0;for(q=
Ya.length;V<q;V+=1)if(""!==lb(Ya[V])){z+="</br>";z+=ec;z+=lb(Ya[V]);break}z+="</br>"}else{fa=La="";switch(va){case "LIRC":La=lb(Pa);break;case Q:La=lb(qa);""!==lb("HIRC1EN")&&(La=La+" / "+lb("HIRC1EN"));break;case "HIRC48":La=lb("HIRC48EN");break;case "MIRC":La=lb("MIRCEN");break;case "MIRC1P2M":La=lb("MIRC1P2MEN");break;case "LXT":La=lb(ha);break;case Y:La=lb(K);break;case "PLL2":La=lb("PLL2CKEN");break;case "PLL480M":La=lb("PLL2CKEN");break;case "HSUSB_OTG_PHYOTGPHY":La=lb(K)}""!==La&&(fa=fa+Bb+
La+"</br>");La=lb(va+Ka);""!==La&&(fa=fa+ec+La+"</br>");La=lb(va+"DIV");""!==La&&(fa=fa+Vb+La+"</br>");""!==fa&&(z=z+"<hr>"+fa)}}l.enabled&&NUTOOL_CLOCK.g_Module.hasOwnProperty(va)&&-1===NUTOOL_CLOCK.g_BusNonExistent.indexOf(va)&&(z=z+"<hr>"+Cc+" "+Dd(va)+"</br>",Ed(va)&&(z=z+Ub+" ("+va+"): "+l.freq+"</br>"));return Fd=z});Bd.call(dc);dc.direction("e").offset([0,5]);var Od=d3.behavior.drag().on("dragstart",function(l){l!=ub&&-1===$.inArray(l.name,c)&&(d3.event.sourceEvent.stopPropagation(),$("#"+
wb+"_div")[0]&&($("#"+wb+"_div").hide(),$("#"+wb+"_canvas").hide(),$("#"+wb+"_div_protection").hide(),$("#"+wb+"_div_showRealFreq").hide()),Ha.selectAll("path.selected").data([]).exit().remove(),Ua=!0,zc.nodes(l))}).on("drag",function(l){ic=!0;l!=ub&&-1===$.inArray(l.name,c)&&(Ua&&($a=this,e(l,$a)),l.x0+=d3.event.dy,l.y0+=d3.event.dx,d3.select(this).attr("transform","translate("+l.y0+","+l.x0+")"),Oc())}).on("dragend",function(l){ic=!1;if(l!=ub&&-1===$.inArray(l.name,c)){$a=this;if(hb){var z=eb.parent.children.indexOf(eb);
-1<z&&eb.parent.children.splice(z,1);"undefined"!==typeof hb.children||"undefined"!==typeof hb._children?"undefined"!==typeof hb.children?hb.children.push(eb):hb._children.push(eb):(hb.children=[],hb.children.push(eb));Qb=ac=-1;var fa=hb.name;var ma=eb.name;if("SYSTICK"!==ma){if(ja=NUTOOL_CLOCK.g_Module[ma][0],NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(V=0,q=NUTOOL_CLOCK.g_CLKSEL[ja].length;V<q;V+=1)if(db=NUTOOL_CLOCK.g_CLKSEL[ja][V],db.slicePriorToX(":").slicePriorToX("/").toString()===fa){NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(ja)?
(Wb=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[ja][0],lc=parseInt(Wb.sliceAfterX(":"),10),Wb=Wb.slicePriorToX(":"),ac=X(ja)+(X(Wb)<<lc)>>>0,Qb=parseInt(db.sliceAfterX(":"),10),$b=Math.pow(2,lc)-1,ib=Qb&$b,vb=Qb-ib>>lc>>>0,ya(ja,ib),ya(Wb,vb)):(ac=X(ja),Qb=parseInt(db.sliceAfterX(":"),10),ya(ja,Qb));break}}else if(-1!==fa.indexOf("CPUCLK"))ya("CLKSRC",1,za);else if(ya("CLKSRC",0,za),ja=ca,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja))for(V=0,q=NUTOOL_CLOCK.g_CLKSEL[ja].length;V<q;V+=1)if(db=NUTOOL_CLOCK.g_CLKSEL[ja][V],
-1!==db.indexOf(fa)){ya(ja,parseInt(db.sliceAfterX(":"),10),"",!1);break}hb.enabled?(z=$.inArray(ma,G),-1!==z&&(G.splice(z,1),J.splice(z,1),Na("tab-4",ma,"",""),G.push(ma),l.freq=$("#"+ma+"_span_showRealFreq").text(),J.push(l.freq))):Ba(ma);Qb!==ac&&rb(ma,fa);d()}hb=null;d3.selectAll(".ghostCircle").attr("class","ghostCircle");d3.select($a).select(".ghostCircle").attr("pointer-events","");Oc();E(ub);dc.hide()}});var Pd=function(l){var z=[];hb=null;if(eb){va=eb.name;"SYSTICK"!==va?(ja=NUTOOL_CLOCK.g_Module.hasOwnProperty(va)?
NUTOOL_CLOCK.g_Module[va][0]:va+Ka,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ja)&&(z=NUTOOL_CLOCK.g_CLKSEL[ja].slice())):(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ca)?z=NUTOOL_CLOCK.g_CLKSEL[ca].slice():z.push(NUTOOL_CLOCK.g_Module[va][0]),z.push("CPUCLK"));if(0<z.length)for(Ma=0,w=z.length;Ma<w;Ma+=1){if(db=z[Ma].slicePriorToX(":").slicePriorToX("/").toString(),l.name===db){hb=l;break}}else l.name===ja&&(hb=l);Oc()}};var Qd=function(){hb=null;Oc()};var Oc=function(){var l=[];null!==eb&&null!==hb&&(l=[{source:{x:hb.y0,
y:hb.x0},target:{x:eb.y0,y:eb.x0}}]);l=Ha.selectAll(".templink").data(l);l.enter().append("path").attr("class","templink").attr("d",d3.svg.diagonal()).attr("pointer-events","none");l.attr("d",d3.svg.diagonal());l.exit().remove()};Ha=Bd.append("g").attr("id","g_svgGroup");var ub=S;ub.x0=Ic/2;ub.y0=rc/2;E(ub);(function(l){var z=Ac.scale();var fa=-l.y0;l=-l.x0;fa*=z;l=l*z+3*Ic/4;d3.select("g").transition().duration(oa).attr("transform","translate("+fa+","+l+")scale("+z+")");Ac.scale(z);Ac.translate([fa,
l])})(ub)}function Ta(b,a,d,e,h){var f,g,m,D=[],k="";d=[];var L=0,H,W,E,w,q=!0,A=0,R=[],S=[];D=k=0;var c,na,u,n=[],M,F,ka,O,wa,C,B,N,U,ra="STCLK_S".toEquivalent().toString(),Ia="SYST_CSR".toEquivalent().toString();D="HXT".toEquivalent().toString();var r="PLL".toEquivalent().toString();var I="HIRC".toEquivalent().toString();var y="HCLK".toEquivalent().toString();A="PCLK".toEquivalent().toString();var x=function(za,Ka){c=za.getBoundingClientRect();na=Ka.clientX-c.left;u=Ka.clientY-c.top;return this};
var G=function(){M=!1;K=0;for(f=n.length;K<f;K+=1)na>=n[K].x&&na<=n[K].x+n[K].textLength&&u>=n[K].y-18-3&&u<=n[K].y?"#DF630E"!==n[K].color&&(n[K].lastColor=n[K].color,n[K].color="#DF630E",M=!0):n[K].color!==n[K].lastColor&&(n[K].color=n[K].lastColor,M=!0);if(M)for(K=0,f=n.length;K<f;K+=1)v.fillStyle="#FFFFFF",v.fillRect(n[K].x,n[K].y-18,n[K].textLength+10,18),v.fillStyle=n[K].color,v.fillText(n[K].name,n[K].x,n[K].y);M=!1;da.name&&(na>=da.x&&na<=da.x+da.textLength&&u>=da.y-18&&u<=da.y?"#DF630E"!==
da.color&&(da.lastColor=da.color,da.color="#DF630E",M=!0):da.color!==da.lastColor&&(da.color=da.lastColor,M=!0));M&&(v.fillStyle="#FFFFFF",v.fillRect(da.x,da.y-18,da.textLength,25),v.fillStyle=da.color,v.fillText(da.name,da.x,da.y))};var J=function(){var za;var Ka=wa=0;for(za=n.length;Ka<za;Ka+=1){if("#C62A39"===n[Ka].color){la=n[Ka].name;wa=-1!==la.indexOf("MHz")?1E6*parseFloat(la.sliceAfterX(":").sliceAfterX(":"),la.length-3):-1!==la.indexOf("kHz")?1E3*parseFloat(la.sliceAfterX(":").sliceAfterX(":"),
la.length-3):parseFloat(la.sliceAfterX(":").sliceAfterX(":"),la.length-2);break}if(Ka===za-1)return this}if(da.name)if("#C62A39"===da.color)wa/=X(NUTOOL_CLOCK.g_Module[a][2])+1;else return this;$("#"+a+"_span_showRealFreq").text(wa.toHzString());return this};var pa=function(za){var Ka,Y,ea=!1;$("#dividerConfigureDialog").is(":visible")&&$("#dividerConfigureDialog").dialog("destroy");var Q=0;for(Ka=Z.length;Q<Ka;Q+=1){H=Z[Q];var bb=0;for(Y=NUTOOL_CLOCK.g_register_map[H].length;bb<Y;bb+=1)if(la=NUTOOL_CLOCK.g_register_map[H][bb],
-1!==la.indexOf(za)&&la.indexOf(":")===za.length){L=-1!==la.indexOf("-")?parseInt(la.sliceBetweenXandX(":","-"),10)-parseInt(la.sliceAfterX("-"),10)+1:parseInt(la.sliceAfterX(":"),10);L=Math.pow(2,L)-1;break}}-1!==T.indexOf("Simplified")?(F="\u8bf7\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668"+za+"\u3002\u5408\u7406\u7684\u8303\u56f4\u4ece0\u5230"+L+"\u3002",ka="\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668",O="\u786e\u8ba4"):-1!==T.indexOf("Traditional")?(F="\u8acb\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+
za+"\u3002\u5408\u7406\u7684\u7bc4\u570d\u5f9e0\u5230"+L+"\u3002",ka="\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668",O="\u78ba\u8a8d"):(F="Please configure a value to "+za+". The feasible range is from 0 to "+L+".",ka="Configure a value to the divider",O="Confirm");$('<div id="dividerConfigureDialog"><p>'+F+'</p><p class = "div_clock_composite">'+za+': </p><input id="'+za+'_input_dialog" type="text" value="0" class = "div_clock_composite"/><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:ka,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:O,click:function(){xb=parseInt($("#"+za+"_input_dialog").val(),10);ea=!1;Q=0;for(Ka=n.length;Q<Ka;Q+=1)if(-1!==n[Q].name.indexOf(za)){ea=!0;break}if(ea){Q=0;for(Ka=n.length;Q<Ka;Q+=1)if(la=n[Q].name,-1!==la.indexOf(za)){n[Q].name=la.slicePriorToX(":")+":"+xb+"+1):"+(fc(la.slicePriorToX("/"))/(xb+1)).toHzString();v.fillStyle="#FFFFFF";n[Q].textLength=v.measureText(la).width;v.fillRect(n[Q].x,n[Q].y-18,n[Q].textLength,
20);v.fillStyle=n[Q].lastColor=n[Q].color="#C62A39";v.fillText(n[Q].name,n[Q].x,n[Q].y);break}C=-1}else da.name="1/("+za+": "+xb+" + 1)",v.fillStyle="#FFFFFF",da.textLength=v.measureText(da.name).width,v.fillRect(da.x,da.y-18,da.textLength,25),v.fillStyle=da.lastColor=da.color="#C62A39",da.x+=(da.textLength-v.measureText(da.name).width)/2,v.fillText(da.name,da.x,da.y),C=X(NUTOOL_CLOCK.g_Module[a][2]);ya(za,xb);J();Ha.selectAll("g.node").on("updateFromDividerDialog")(a,!0,C);$(this).is(":visible")&&
$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}});$("#"+za+"_input_dialog").val(X(za)).width(35);$("#"+za+"_input_dialog").width(35).change(function(){if("undefined"===typeof this.value||""===this.value||4<this.value.length||!/^\d+$/.test(this.value)||parseInt(this.value,10)>L||0>parseInt(this.value,10))"none"!==NUTOOL_CLOCK.g_Module[a][2]?$("#"+za+"_input_dialog").val(X(NUTOOL_CLOCK.g_Module[a][2])).width(35):$("#"+za+"_input_dialog").val("0"),-1!==T.indexOf("Simplified")?
Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):Da("The inputted content is incorrect. Please try again.")})};var Pa=function(za){var Ka=!1;-1!==Gb&&100!==Gb&&(za=Gb);"undefined"===typeof za&&(za=-1);if(-1===za)for(K=0,f=n.length;K<f;K+=1)na>=n[K].x&&na<=n[K].x+n[K].textLength&&u>=n[K].y-
18-3&&u<=n[K].y&&(za=K,-1!==n[K].name.indexOf("DIV:")&&(Ka=!0));if(za===n.length)for(K=0,f=n.length;K<f;K+=1)if("#BC8484"!==n[K].color){za=K;break}C=B=-1;if(-1!==za&&-1===n[za].name.indexOf("Disabled"))for(K=0,f=n.length;K<f;K+=1){if(K===za){n[K].lastColor=n[K].color="#C62A39";E=n[K].name.slicePriorToLastX(":");-1!==E.indexOf("DIV")&&-1!==E.indexOf(":")&&(w=E,E=w.slicePriorToX(":")+"+"+w.sliceAfterX("+"));if("SYSTICK"!==a){if(e=NUTOOL_CLOCK.g_Module[a][0],NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(e))for(g=
0,m=NUTOOL_CLOCK.g_CLKSEL[e].length;g<m;g+=1)if(la=NUTOOL_CLOCK.g_CLKSEL[e][g],-1!==la.indexOf(E)&&la.indexOf(":")===E.length){NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(e)?(Ga=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[e][0],Aa=parseInt(Ga.sliceAfterX(":"),10),Ga=Ga.slicePriorToX(":"),C=X(e)+(X(Ga)<<Aa)>>>0,B=parseInt(la.sliceAfterX(":"),10),W=Math.pow(2,Aa)-1,N=B&W,U=B-N>>Aa>>>0,ya(e,N),ya(Ga,U)):(C=X(e),B=parseInt(la.sliceAfterX(":"),10),ya(e,B));break}}else if(-1!==E.indexOf("CPUCLK"))ya("CLKSRC",1,Ia);
else if(ya("CLKSRC",0,Ia),e=ra,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(e))for(g=0,m=NUTOOL_CLOCK.g_CLKSEL[e].length;g<m;g+=1)if(la=NUTOOL_CLOCK.g_CLKSEL[e][g],-1!==la.indexOf(E)&&la.indexOf(":")===E.length){ya(e,parseInt(la.sliceAfterX(":"),10),"",!1);break}J();q||Ha.selectAll("g.node").on("updateFromCanvas")(a,E.slicePriorToX("/").toString(),!0,C,B);Ka&&(qa=n[K].name,ha=qa.sliceAfterX("("),ha=ha.slicePriorToX(":"),pa(ha))}else"#BC8484"!==n[K].color&&(n[K].lastColor=n[K].color="black");v.fillStyle="#FFFFFF";
v.fillRect(n[K].x,n[K].y-18,n[K].textLength+10,18);v.fillStyle=n[K].color;v.fillText(n[K].name,n[K].x,n[K].y)}da.name&&(na>=da.x&&na<=da.x+da.textLength&&u>=da.y-18&&u<=da.y||100===Gb)&&pa(h)};d="<div id='"+a+"_div'></div>";$("#"+b).append(d);d=[];k=NUTOOL_CLOCK.g_Module.hasOwnProperty(a)?NUTOOL_CLOCK.g_Module[a][0]:e;if(-1!==k.indexOf("DIV+")){var qa=k;var ha=qa.sliceAfterX("(");ha=ha.slicePriorToX("+");k=qa.slicePriorToX("+")+":"+X(ha)+"+1)";d.push(k)}else if(0===k.indexOf(y)||0===k.indexOf("RTC32k")||
0===k.indexOf("LIRC")||0===k.indexOf(I)||0===k.indexOf("MIRC")||0===k.indexOf("LXT")||0===k.indexOf(D)||0===k.indexOf(r)||0===k.indexOf("PLL2")||0===k.indexOf("PLL480M")||0===k.indexOf("APLL")||0===k.indexOf("HSUSB_OTG_PHY")||0===k.indexOf(A)||0===k.indexOf("PCLK0")||0===k.indexOf("PCLK1"))d.push(k);else if(k==="HCLK_S".toEquivalent())d.push(y);else if(k==="PCLK_S".toEquivalent())d.push(A);else if(0===k.indexOf("STCLK_S/SYST_CSR[2]".toEquivalent())){D=NUTOOL_CLOCK.g_CLKSEL[ra];var K=0;for(f=D.length;K<
f;K+=1)d.push(D[K].slicePriorToX(":"))}else if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(k))for(D=NUTOOL_CLOCK.g_CLKSEL[k],K=0,f=D.length;K<f;K+=1)qa=D[K],-1!==qa.indexOf("DIV+")?(ha=qa.sliceAfterX("("),ha=ha.slicePriorToX("+"),k=qa.slicePriorToX("+")+":"+X(ha)+"+1)",d.push(k)):d.push(qa.slicePriorToX(":"));"SYSTICK"===a&&d.push("CPUCLK");$("#"+b)[0].appendChild(zb("canvas",a+"_canvas"));var Ja=$("#"+a+"_canvas");Ja[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:30px; top:70px; border: 1px solid black;");
Hb.addEvent(Ja[0],"mousemove",function(za){x(Ja[0],za);G()});Hb.addEvent(Ja[0],"click",function(){Pa()});var v=Hb.getContext(Ja[0]);v.font="18px Arial";v.fillStyle="black";I=20;A=0;R=[];S=[];K=0;for(f=d.length;K<f;K+=1)R.push(d[K]+": "+fc(d[K]).toHzString()),v.measureText(R[R.length-1]).width>A&&(A=v.measureText(R[R.length-1]).width),-1!==$.inArray(d[K].slicePriorToX("/").toString(),Za)||"CPUCLK"===d[K]?S[K]="black":S[K]="#BC8484";A+=30;if(1<d.length){if("none"===h)k=20+A+30+45+v.measureText(a).width+
20;else{var ca=45+v.measureText("1/("+h+": 0 + 1)").width;k=20+A+30+ca+45+v.measureText(a).width+20}D=22*(d.length-1)+80}else k="none"===h?20+A+v.measureText(a).width+20:20+A+v.measureText("1/("+h+": 0 + 1)").width+45+v.measureText(a).width+20,D=80;Ja[0].setAttribute("width",k);Ja[0].setAttribute("height",D);v.font="18px Arial";v.fillStyle="black";I=20;n=[];var da={name:""};if(1<d.length){K=0;for(f=d.length;K<f;K+=1)y=22*K+40,v.fillStyle=S[K],v.fillText(R[K],I,y),r=new Db(I,y+2,I+A,y+2),r.drawWithArrowheads(v),
n.push({name:R[K],x:I,y:y,textLength:v.measureText(R[K]).width,color:S[K],lastColor:S[K]});v.beginPath();v.moveTo(20+A,20);v.lineTo(20+A,22*(d.length-1)+60);v.lineTo(20+A+30,22*(d.length-1)+40);v.lineTo(20+A+30,40);v.lineTo(20+A,20);v.stroke();ca=0;"none"!==h&&(r=new Db(20+A+30,22*(d.length-1)/2+40,20+A+30+45,22*(d.length-1)/2+40),r.drawWithArrowheads(v),ca+=45,I=20+A+30+45,y=22*(d.length-1)/2+49-2,v.fillText("1/("+h+": 0 + 1)",I,y),ca+=v.measureText("1/("+h+": 0 + 1)").width,da={name:"1/("+h+": 0 + 1)",
x:I,y:y,textLength:v.measureText("1/("+h+": 0 + 1)").width,color:"black",lastColor:"black"});r=new Db(20+A+30+ca,22*(d.length-1)/2+40,20+A+30+ca+45,22*(d.length-1)/2+40);r.drawWithArrowheads(v);v.fillText(a,20+A+30+ca+45,22*(d.length-1)/2+49-2)}else y=40,v.fillText(R[0],I,y),r=new Db(I,y+2,I+A,y+2),r.drawWithArrowheads(v),n.push({name:R[0],x:I,y:y,textLength:v.measureText(R[0]).width,color:S[0],lastColor:S[0]}),ca=0,"none"!==h?(I=20+A,v.fillText("1/("+h+": 0 + 1)",I,y+9-2),ca+=v.measureText("1/("+
h+": 0 + 1)").width,da={name:"1/("+h+": 0 + 1)",x:I,y:y+9-2,textLength:v.measureText("1/("+h+": 0 + 1)").width,color:"black",lastColor:"black"},r=new Db(20+A+ca,y,20+A+ca+45,y),r.drawWithArrowheads(v),v.fillText(a,20+A+ca+45,y+9-2)):v.fillText(a,20+A,y+9-2);d="<div id='"+a+"_div_protection'></div>";$("#"+b).append(d);d="<div id='"+a+"_div_showRealFreq'><p class = 'div_clock_composite'><span class=realOutput_before_span>The clock of </span>"+a+"<span class=realOutput_after_span>: </span><span id='"+
a+"_span_showRealFreq'></span></p></div>";$("#"+b).append(d);-1!==T.indexOf("Simplified")?($(".realOutput_before_span").text("\u6a21\u5757"),$(".realOutput_after_span").text("\u7684\u65f6\u8109\u9891\u7387: ")):-1!==T.indexOf("Traditional")?($(".realOutput_before_span").text("\u6a21\u7d44"),$(".realOutput_after_span").text("\u7684\u6642\u8108\u983b\u7387: ")):($(".realOutput_before_span").text("The clock of "),$(".realOutput_after_span").text(": "));$("#"+a+"_div_protection")[0].setAttribute("style",
"background-color:#ECEADF; position:absolute; left:0px; top:50px; width:"+(4*k/3+32)+"px;height:"+(20+D+60)+"px;");$("#"+a+"_div_showRealFreq")[0].setAttribute("style","background-color: #ECEADF; position:absolute; left:30px; top:"+(70+D+10+10)+"px;");$("#"+a+"_span_showRealFreq").css("color","#2E2EFE");"none"!==NUTOOL_CLOCK.g_Module[a][2]&&(xb=X(NUTOOL_CLOCK.g_Module[a][2]),da.name="1/("+h+": "+xb+" + 1)",v.fillStyle="#FFFFFF",da.textLength=v.measureText(da.name).width,v.fillRect(da.x,da.y-18,da.textLength,
25),v.fillStyle=da.lastColor=da.color="#C62A39",da.x+=(da.textLength-v.measureText(da.name).width)/2,v.fillText(da.name,da.x,da.y));qa="";if("SYSTICK"!==a){var la=NUTOOL_CLOCK.g_Module[a][0];if(NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(la)){var Ga=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[la][0];var Aa=parseInt(Ga.sliceAfterX(":"),10);Ga=Ga.slicePriorToX(":");ha=X(la)+(X(Ga)<<Aa)>>>0}else ha=X(la);if(-1!==ha&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(la))for(K=0,f=NUTOOL_CLOCK.g_CLKSEL[la].length;K<f;K+=1)if(NUTOOL_CLOCK.g_CLKSEL[la][K].sliceAfterX(":")===
ha.toString()){qa=NUTOOL_CLOCK.g_CLKSEL[la][K].slicePriorToX(":");break}}else if(t("CLKSRC"))qa="CPUCLK";else if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(ra)){if(la=ra,ha=X(la).toString(),NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(la))for(K=0,f=NUTOOL_CLOCK.g_CLKSEL[la].length;K<f;K+=1)if(NUTOOL_CLOCK.g_CLKSEL[la][K].sliceAfterX(":")===ha){qa=NUTOOL_CLOCK.g_CLKSEL[la][K].slicePriorToX(":");break}}else qa=NUTOOL_CLOCK.g_Module[a][0];ha=n.length;if(""!==qa)for(K=0,f=n.length;K<f;K+=1)if(la=n[K].name,-1!==la.indexOf("DIV")&&
-1!==la.indexOf(":")&&(b=la,la=b.slicePriorToX(":")+"+"+b.sliceAfterX("+")),-1!==la.indexOf(qa)&&la.indexOf(":")===qa.length&&"#BC8484"!==n[K].color){ha=K;break}Pa(ha);q=!1}function Fa(b,a,d,e,h){var f,g,m,D=[];D="";var k=[];var L=0,H,W,E,w=!0,q=0,A=[];d=[];var R=D=0,S,c,na,u=[],n,M,F,ka,O,wa,C;var B=function(ha,K){S=ha.getBoundingClientRect();c=K.clientX-S.left;na=K.clientY-S.top;return this};var N=function(){n=!1;r=0;for(f=u.length;r<f;r+=1)c>=u[r].x&&c<=u[r].x+u[r].textLength&&na>=u[r].y-18-3&&
na<=u[r].y?"#DF630E"!==u[r].color&&(u[r].lastColor=u[r].color,u[r].color="#DF630E",n=!0):u[r].color!==u[r].lastColor&&(u[r].color=u[r].lastColor,n=!0);if(n)for(r=0,f=u.length;r<f;r+=1)y.fillStyle="#FFFFFF",y.fillRect(u[r].x,u[r].y-18,u[r].textLength+10,18),y.fillStyle=u[r].color,y.fillText(u[r].name,u[r].x,u[r].y);n=!1;J.name&&(c>=J.x&&c<=J.x+J.textLength&&na>=J.y-18&&na<=J.y?"#DF630E"!==J.color&&(J.lastColor=J.color,J.color="#DF630E",n=!0):J.color!==J.lastColor&&(J.color=J.lastColor,n=!0));n&&(y.fillStyle=
"#FFFFFF",y.fillRect(J.x,J.y-18,J.textLength,25),y.fillStyle=J.color,y.fillText(J.name,J.x,J.y))};var U=function(){var ha;var K=O=0;for(ha=u.length;K<ha;K+=1){if("#C62A39"===u[K].color){qa=u[K].name;O=-1!==qa.indexOf("MHz")?1E6*parseFloat(qa.sliceAfterX(":"),qa.length-3):-1!==qa.indexOf("kHz")?1E3*parseFloat(qa.sliceAfterX(":"),qa.length-3):parseFloat(qa.sliceAfterX(":"),qa.length-2);break}if(K===ha-1)return this}if(J.name)if("#C62A39"===J.color)O/=Math.pow(2,xb+1);else return this;$("#"+a+"_span_showRealFreq").text(O.toHzString());
return this};var ra=function(ha){$("#dividerConfigureDialog").is(":visible")&&$("#dividerConfigureDialog").dialog("destroy");r=0;for(f=Z.length;r<f;r+=1)for(H=Z[r],g=0,m=NUTOOL_CLOCK.g_register_map[H].length;g<m;g+=1)if(qa=NUTOOL_CLOCK.g_register_map[H][g],-1!==qa.indexOf(ha)&&qa.indexOf(":")===ha.length){L=-1!==qa.indexOf("-")?parseInt(qa.sliceBetweenXandX(":","-"),10)-parseInt(qa.sliceAfterX("-"),10)+1:parseInt(qa.sliceAfterX(":"),10);L=Math.pow(2,L)-1;break}-1!==T.indexOf("Simplified")?(M="\u8bf7\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668"+
ha+"\u3002\u5408\u7406\u7684\u8303\u56f4\u4ece0\u5230"+L+"\u3002",F="\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668",ka="\u786e\u8ba4"):-1!==T.indexOf("Traditional")?(M="\u8acb\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+ha+"\u3002\u5408\u7406\u7684\u7bc4\u570d\u5f9e0\u5230"+L+"\u3002",F="\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668",ka="\u78ba\u8a8d"):(M="Please configure a value to "+ha+". The feasible range is from 0 to "+L+".",F="Configure a value to the divider",ka="Confirm");$('<div id="dividerConfigureDialog"><p>'+
M+'</p><p class = "div_clock_composite">'+ha+': </p><input id="'+ha+'_input_dialog" type="text" value="0" class = "div_clock_composite"/><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:F,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:ka,click:function(){xb=parseInt($("#"+ha+"_input_dialog").val(),10);J.name="1/2^("+ha+": "+xb+" + 1)";y.fillStyle="#FFFFFF";J.textLength=y.measureText(J.name).width;y.fillRect(J.x,J.y-18,
J.textLength,25);y.fillStyle=J.lastColor=J.color="#C62A39";J.x+=(J.textLength-y.measureText(J.name).width)/2;y.fillText(J.name,J.x,J.y);wa=X(NUTOOL_CLOCK.g_Module[a][2]);ya(ha,xb);U();Ha.selectAll("g.node").on("updateFromDividerDialog")(a,!0,wa);$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}});"none"!==NUTOOL_CLOCK.g_Module[a][2]&&$("#"+ha+"_input_dialog").val(X(NUTOOL_CLOCK.g_Module[a][2])).width(35);$("#"+ha+"_input_dialog").width(35).change(function(){if("undefined"===
typeof this.value||""===this.value||4<this.value.length||!/^\d+$/.test(this.value)||parseInt(this.value,10)>L||0>parseInt(this.value,10))"none"!==NUTOOL_CLOCK.g_Module[a][2]?$("#"+ha+"_input_dialog").val(X(NUTOOL_CLOCK.g_Module[a][2])).width(35):$("#"+ha+"_input_dialog").val("0"),-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):
Da("The inputted content is incorrect. Please try again.")})};var Ia=function(ha){-1!==Gb&&100!==Gb&&(ha=Gb);"undefined"===typeof ha&&(ha=-1);if(-1===ha)for(r=0,f=u.length;r<f;r+=1)c>=u[r].x&&c<=u[r].x+u[r].textLength&&na>=u[r].y-18-3&&na<=u[r].y&&(ha=r);if(ha===u.length)for(r=0,f=u.length;r<f;r+=1)if("#BC8484"!==u[r].color){ha=r;break}wa=C=-1;if(-1!==ha&&-1===u[ha].name.indexOf("Disabled"))for(r=0,f=u.length;r<f;r+=1){if(r===ha){u[r].lastColor=u[r].color="#C62A39";W=u[r].name.slicePriorToLastX(":");
-1!==W.indexOf("DIV")&&-1!==W.indexOf(":")&&(E=W,W=E.slicePriorToX(":")+"+"+E.sliceAfterX("+"));e=NUTOOL_CLOCK.g_Module[a][0];if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(e))for(g=0,m=NUTOOL_CLOCK.g_CLKSEL[e].length;g<m;g+=1)if(qa=NUTOOL_CLOCK.g_CLKSEL[e][g],-1!==qa.indexOf(W)&&qa.indexOf(":")===W.length){wa=X(e);C=parseInt(qa.sliceAfterX(":"),10);ya(e,C);break}U();w||Ha.selectAll("g.node").on("updateFromCanvas")(a,W.slicePriorToX("/").toString(),!0,wa,C)}else"#BC8484"!==u[r].color&&(u[r].lastColor=u[r].color=
"black");y.fillStyle="#FFFFFF";y.fillRect(u[r].x,u[r].y-18,u[r].textLength+10,18);y.fillStyle=u[r].color;y.fillText(u[r].name,u[r].x,u[r].y)}J.name&&(c>=J.x&&c<=J.x+J.textLength&&na>=J.y-18&&na<=J.y||100===Gb)&&ra(h)};k="<div id='"+a+"_div'></div>";$("#"+b).append(k);k=[];D=NUTOOL_CLOCK.g_Module.hasOwnProperty(a)?NUTOOL_CLOCK.g_Module[a][0]:e;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(D)){D=NUTOOL_CLOCK.g_CLKSEL[D];var r=0;for(f=D.length;r<f;r+=1)e=D[r],e=-1===e.indexOf("/")?e.slicePriorToX(":"):e.slicePriorToX("/"),
k.push(D[r].slicePriorToX(":"))}$("#"+b)[0].appendChild(zb("canvas",a+"_canvas"));var I=$("#"+a+"_canvas");I[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:30px; top:70px; border: 1px solid black;");Hb.addEvent(I[0],"mousemove",function(ha){B(I[0],ha);N()});Hb.addEvent(I[0],"click",function(){Ia()});var y=Hb.getContext(I[0]);y.font="18px Arial";y.fillStyle="black";var x=20;q=0;A=[];r=0;for(f=k.length;r<f;r+=1)A.push(k[r]+": "+fc(k[r]).toHzString()),y.measureText(A[A.length-
1]).width>q&&(q=y.measureText(A[A.length-1]).width),-1!==$.inArray(k[r].slicePriorToX("/").toString(),Za)?d[r]="black":d[r]="#BC8484";q+=30;if(1<k.length){if("none"===h)D=20+q+30+45+y.measureText(a).width+20;else{var G=45+y.measureText("1/2^("+h+": 0 + 1)").width;D=20+q+30+G+45+y.measureText(a).width+20}R=22*(k.length-1)+80}else D="none"===h?20+q+y.measureText(a).width+20:20+q+y.measureText("1/2^("+h+" + 1)").width+45+y.measureText(a).width+20,R=80;I[0].setAttribute("width",D);I[0].setAttribute("height",
R);y.font="18px Arial";y.fillStyle="black";x=20;u=[];var J={name:""};if(1<k.length){r=0;for(f=k.length;r<f;r+=1){var pa=22*r+40;y.fillStyle=d[r];y.fillText(A[r],x,pa);var Pa=new Db(x,pa+2,x+q,pa+2);Pa.drawWithArrowheads(y);u.push({name:A[r],x:x,y:pa,textLength:y.measureText(A[r]).width,color:d[r],lastColor:d[r]})}y.beginPath();y.moveTo(20+q,20);y.lineTo(20+q,22*(k.length-1)+60);y.lineTo(20+q+30,22*(k.length-1)+40);y.lineTo(20+q+30,40);y.lineTo(20+q,20);y.stroke();G=0;"none"!==h&&(Pa=new Db(20+q+30,
22*(k.length-1)/2+40,20+q+30+45,22*(k.length-1)/2+40),Pa.drawWithArrowheads(y),G+=45,x=20+q+30+45,pa=22*(k.length-1)/2+49-2,y.fillText("1/2^("+h+": 0 + 1)",x,pa),G+=y.measureText("1/2^("+h+": 0 + 1)").width,J={name:"1/2^("+h+": 0 + 1)",x:x,y:pa,textLength:y.measureText("1/2^("+h+": 0 + 1)").width,color:"black",lastColor:"black"});Pa=new Db(20+q+30+G,22*(k.length-1)/2+40,20+q+30+G+45,22*(k.length-1)/2+40);Pa.drawWithArrowheads(y);y.fillText(a,20+q+30+G+45,22*(k.length-1)/2+49-2)}else pa=40,y.fillText(A[0],
x,pa),Pa=new Db(x,pa+2,x+q,pa+2),Pa.drawWithArrowheads(y),u.push({name:A[0],x:x,y:pa,textLength:y.measureText(A[0]).width,color:d[0],lastColor:d[0]}),G=0,"none"!==h?(x=20+q,y.fillText("1/2^("+h+": 0 + 1)",x,pa+9-2),G+=y.measureText("1/2^("+h+": 0 + 1)").width,J={name:"1/2^("+h+": 0 + 1)",x:x,y:pa+9-2,textLength:y.measureText("1/2^("+h+": 0 + 1)").width,color:"black",lastColor:"black"},Pa=new Db(20+q+G,pa,20+q+G+45,pa),Pa.drawWithArrowheads(y),y.fillText(a,20+q+G+45,pa+9-2)):y.fillText(a,20+q,pa+9-
2);k="<div id='"+a+"_div_protection'></div>";$("#"+b).append(k);k="<div id='"+a+"_div_showRealFreq'><p class = 'div_clock_composite'><span class=realOutput_before_span>The clock of </span>"+a+"<span class=realOutput_after_span>: </span><span id='"+a+"_span_showRealFreq'></span></p></div>";$("#"+b).append(k);-1!==T.indexOf("Simplified")?($(".realOutput_before_span").text("\u6a21\u5757"),$(".realOutput_after_span").text("\u7684\u65f6\u8109\u9891\u7387: ")):-1!==T.indexOf("Traditional")?($(".realOutput_before_span").text("\u6a21\u7d44"),
$(".realOutput_after_span").text("\u7684\u6642\u8108\u983b\u7387: ")):($(".realOutput_before_span").text("The clock of "),$(".realOutput_after_span").text(": "));$("#"+a+"_div_protection")[0].setAttribute("style","background-color:#ECEADF; position:absolute; left:0px; top:50px; width:"+(4*D/3+32)+"px;height:"+(20+R+60)+"px;");$("#"+a+"_div_showRealFreq")[0].setAttribute("style","background-color: #ECEADF; position:absolute; top:"+(70+R+10+10)+"px;");$("#"+a+"_span_showRealFreq").css("color","#2E2EFE");
"none"!==NUTOOL_CLOCK.g_Module[a][2]&&(xb=X(NUTOOL_CLOCK.g_Module[a][2]),J.name="1/2^("+h+": "+xb+" + 1)",y.fillStyle="#FFFFFF",J.textLength=y.measureText(J.name).width,y.fillRect(J.x,J.y-18,J.textLength,25),y.fillStyle=J.lastColor=J.color="#C62A39",J.x+=(J.textLength-y.measureText(J.name).width)/2,y.fillText(J.name,J.x,J.y));d="";var qa=NUTOOL_CLOCK.g_Module[a][0];k=X(qa).toString();if(-1!==k&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(qa))for(r=0,f=NUTOOL_CLOCK.g_CLKSEL[qa].length;r<f;r+=1)if(NUTOOL_CLOCK.g_CLKSEL[qa][r].sliceAfterX(":")===
k){d=NUTOOL_CLOCK.g_CLKSEL[qa][r].slicePriorToX(":");break}k=u.length;if(""!==d)for(r=0,f=u.length;r<f;r+=1)if(qa=u[r].name,-1!==qa.indexOf("DIV")&&-1!==qa.indexOf(":")&&(b=qa,qa=b.slicePriorToX(":")+"+"+b.sliceAfterX("+")),-1!==qa.indexOf(d)&&qa.indexOf(":")===d.length&&"#BC8484"!==u[r].color){k=r;break}Ia(k);w=!1}function Na(b,a,d,e){d=[];var h="HXT".toEquivalent().toString();var f="PLL".toEquivalent().toString();var g="HIRC".toEquivalent().toString();var m="HCLK".toEquivalent().toString();var D=
"PCLK".toEquivalent().toString();e=NUTOOL_CLOCK.g_Module.hasOwnProperty(a)?NUTOOL_CLOCK.g_Module[a][0]:e;if(0===e.indexOf(m)||0===e.indexOf("RTC32k")||0===e.indexOf("LIRC")||0===e.indexOf(g)||0===e.indexOf("MIRC")||0===e.indexOf("LXT")||0===e.indexOf(h)||0===e.indexOf(f)||0===e.indexOf("PLL2")||0===e.indexOf("PLL480M")||0===e.indexOf("APLL")||0===e.indexOf("HSUSB_OTG_PHY")||0===e.indexOf("PCLK0")||0===e.indexOf("PCLK1"))d.push(e);else if(e==="HCLK_S".toEquivalent())d.push(m);else if(e==="PCLK_S".toEquivalent()||
e===D)d.push(D);else if(0===e.indexOf("STCLK_S/SYST_CSR[2]".toEquivalent()))for(h=NUTOOL_CLOCK.g_CLKSEL["STCLK_S".toEquivalent()],g=0,m=h.length;g<m;g+=1)e=h[g],e=-1===e.indexOf("/")?e.slicePriorToX(":"):e.slicePriorToX("/"),-1!==$.inArray(e,Za)&&d.push(h[g].slicePriorToX(":"));else if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(e))for(h=NUTOOL_CLOCK.g_CLKSEL[e],g=0,m=h.length;g<m;g+=1)e=h[g],e=-1===e.indexOf("/")?e.slicePriorToX(":"):e.slicePriorToX("/"),-1!==$.inArray(e,Za)&&d.push(h[g].slicePriorToX(":"));
"SYSTICK"===a&&d.push("CPUCLK");xb=0;"none"!==NUTOOL_CLOCK.g_Module[a][2]&&(xb=X(NUTOOL_CLOCK.g_Module[a][2]));h="";if("SYSTICK"!==a){if(h=f=NUTOOL_CLOCK.g_Module[a][0],NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(h)?(g=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[h][0],m=parseInt(g.sliceAfterX(":"),10),g=g.slicePriorToX(":"),e=X(h)+(X(g)<<m)>>>0):e=X(h),-1!==e&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(f))for(g=0,m=NUTOOL_CLOCK.g_CLKSEL[f].length;g<m;g+=1)if(NUTOOL_CLOCK.g_CLKSEL[f][g].sliceAfterX(":")===e.toString()){h=
NUTOOL_CLOCK.g_CLKSEL[f][g].slicePriorToX(":");break}}else if(t("CLKSRC"))h="CPUCLK";else if(f="STCLK_S".toEquivalent().toString(),e=X(f).toString(),NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(f))for(g=0,m=NUTOOL_CLOCK.g_CLKSEL[f].length;g<m;g+=1){if(NUTOOL_CLOCK.g_CLKSEL[f][g].sliceAfterX(":")===e){h=NUTOOL_CLOCK.g_CLKSEL[f][g].slicePriorToX(":");break}}else h=NUTOOL_CLOCK.g_Module[a][0];if(-1===$.inArray(h,d)&&(h=d[0],e=NUTOOL_CLOCK.g_Module[a][0],NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(e)))for(d=0,g=NUTOOL_CLOCK.g_CLKSEL[e].length;d<
g;d+=1)if(f=NUTOOL_CLOCK.g_CLKSEL[e][d],-1!==f.indexOf(h)&&f.indexOf(":")===h.length){NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(e)?(g=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[e][0],m=parseInt(g.sliceAfterX(":"),10),g=g.slicePriorToX(":"),X(e),X(g),d=parseInt(f.sliceAfterX(":"),10),f=Math.pow(2,m)-1,f&=d,d=d-f>>m>>>0,ya(e,f),ya(g,d)):(X(e),d=parseInt(f.sliceAfterX(":"),10),ya(e,d));break}d=a==="CLKO_Divider".toEquivalent().toString()||a==="CLKO1_Divider".toEquivalent().toString()?fc(h)/Math.pow(2,xb+1):
fc(h)/(xb+1);$("#"+a+"_div_showRealFreq")[0]||(e="<div id='"+a+"_div_showRealFreq'><p class = 'div_clock_composite'><span class=realOutput_before_span>The clock of </span>"+a+"<span class=realOutput_after_span>: </span><span id='"+a+"_span_showRealFreq'></span></p></div>",$("#"+b).append(e));$("#"+a+"_span_showRealFreq").text(d.toHzString());$("#"+a+"_div_showRealFreq").hide()}function Xa(){var b=$("#tabs");cc();$("#tabs ul").append("<li id='li-4'><a href='#tab-4'><span id=module_span>Modules</span></a></li>");
$("#tabs").append("<div id='tab-4' style='overflow: hidden;'></div>");-1!==T.indexOf("Simplified")?$("#module_span").text("\u6a21\u5757"):-1!==T.indexOf("Traditional")?$("#module_span").text("\u6a21\u7d44"):$("#module_span").text("Modules");$("#tabs").tabs("refresh");$("#tabs").tabs({active:3});3!==$("#tabs").tabs("option","active")&&$("#tabs").tabs({active:2});"none"!==$("#clockRegsTree").css("display")?(b.css("width",mb-ab-8+"px"),$("#tab-4").css("width",mb-ab-8+"px")):(b.css("width",mb-8+"px"),
$("#tab-4").css("width",mb-8+"px"));b.css("height",Xb-8+"px");$("#tab-4").css("height",Xb-8+"px");Ca(Ab(NUTOOL_CLOCK.g_Module));$("#tabs")[0].style.visibility="visible";"none"!==$("#clockRegsTree").css("display")&&$("#searchModule").show()}function Sb(b){var a,d,e,h=$("#tabs"),f="Select one of the following frequencies to be the frequency of HCLK.",g,m,D="",k,L,H,W,E,w,q,A=[],R=[],S,c,na=0,u,n,M,F=[],ka,O,wa,C,B;F="HXT".toEquivalent().toString();var N="PLL".toEquivalent().toString();var U="HIRC".toEquivalent().toString(),
ra="HCLK".toEquivalent().toString(),Ia="PCLK".toEquivalent().toString(),r="HCLK_N".toEquivalent().toString(),I="PCLK_N".toEquivalent().toString(),y="HCLK_S".toEquivalent().toString(),x="PCLK_S".toEquivalent().toString(),G="PCLK0SEL".toEquivalent().toString(),J="PCLK1SEL".toEquivalent().toString(),pa="XTL32K_EN".toEquivalent().toString(),Pa="XTL12M_EN".toEquivalent().toString();var qa=function(la,Ga,Aa,za,Ka){var Y=Hb.getContext(la),ea=[],Q={},bb,Qa,$b=function(xa){-1!==Gb&&100!==Gb&&(xa=Gb);"undefined"===
typeof xa&&(xa=-1);if(-1===xa)for(a=0,d=ea.length;a<d;a+=1)C>=ea[a].x&&C<=ea[a].x+ea[a].textLength&&B>=ea[a].y-18-3&&B<=ea[a].y&&(xa=a);if(xa===ea.length)for(a=0,d=ea.length;a<d;a+=1)if("#BC8484"!==ea[a].color){xa=a;break}if(-1!==xa&&-1===ea[xa].name.indexOf("Disabled"))for(a=0,d=ea.length;a<d;a+=1){if(a===xa){ea[a].lastColor=ea[a].color="#C62A39";-1!==Ga.indexOf("BASECLK")?(v="BASESEL",k=ea[a].name.slicePriorToLastX(":")):-1!==Ga.indexOf(ra)?NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")?(v="CPUCKDIV",
k=ea[a].name):(v=y,k=ea[a].name.slicePriorToLastX(":")):(v=-1!==Ga.indexOf("PCLK0")?G:-1!==Ga.indexOf("PCLK1")?J:x,k=ea[a].name);-1!==k.indexOf("DIV")&&-1!==k.indexOf(":")&&(L=k,k=L.slicePriorToX(":")+"+"+L.sliceAfterX("+"));if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)if(H=NUTOOL_CLOCK.g_CLKSEL[v][ca],-1!==H.indexOf(k)&&H.indexOf(":")===k.length){ya(v,parseInt(H.sliceAfterX(":"),10));break}Ya()}else"#BC8484"!==ea[a].color&&(ea[a].lastColor=ea[a].color=
"black");Y.fillStyle="white";Y.fillRect(ea[a].x,ea[a].y-18,ea[a].textLength+10,18);Y.fillStyle=ea[a].color;Y.fillText(ea[a].name,ea[a].x,ea[a].y)}Q.name&&C>=Q.x&&C<=Q.x+Q.textLength&&B>=Q.y-18&&B<=Q.y&&ib(Aa)},Ya=function(){a=Qa=0;for(d=ea.length;a<d;a+=1){if("#C62A39"===ea[a].color){H=ea[a].name;-1===H.indexOf(ra)&&-1===H.indexOf("BASECLK")&&(Qa=-1!==H.indexOf("MHz")?1E6*parseFloat(H.sliceAfterX(":"),H.length-3):-1!==H.indexOf("kHz")?1E3*parseFloat(H.sliceAfterX(":"),H.length-3):parseFloat(H.sliceAfterX(":"),
H.length-2));break}if(a===d-1)return this}if(0===Qa&&(v=y,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v)))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)if(H=NUTOOL_CLOCK.g_CLKSEL[v][ca],X(v)===parseInt(H.sliceAfterX(":"),10)){Qa=fc(H.slicePriorToLastX(":"));break}if(-1!==X(r))if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(r)){vb=X(r).toString();ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[r].length;ca<e;ca+=1)if(NUTOOL_CLOCK.g_CLKSEL[r][ca].sliceAfterX(":")===vb){$a=NUTOOL_CLOCK.g_CLKSEL[r][ca].slicePriorToX(":");
break}-1!==$a.indexOf("/")&&(Qa/=parseInt($a.sliceAfterX("/"),10))}else Qa/=X(r)+1;0!==Qa&&(tb=Qa,$("#HCLK_span_showRealFreq").text(tb.toHzString()));H=$("#HCLK_span_showRealFreq").text();if(""!==H)if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(G))Cb=0<X(G)?H.toFloat()/Math.pow(2,X(G)):H.toFloat(),$("#PCLK0_span_showRealFreq").text(Cb.toHzString()),Fb=0<X(J)?H.toFloat()/Math.pow(2,X(J)):H.toFloat(),$("#PCLK1_span_showRealFreq").text(Fb.toHzString()),Eb=0;else{if(-1!==X(x))if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(x)){vb=
X(x).toString();ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[x].length;ca<e;ca+=1)if(NUTOOL_CLOCK.g_CLKSEL[x][ca].sliceAfterX(":")===vb){$a=NUTOOL_CLOCK.g_CLKSEL[x][ca].slicePriorToX(":");break}Qa=-1===$a.indexOf("/")?H.toFloat():H.toFloat()/parseInt($a.sliceAfterX("/"),10)}else Qa=H.toFloat()/Math.pow(2,X(x));else Qa=H.toFloat();-1!==X(I)&&(Qa/=X(I)+1);Eb=Qa;$("#PCLK_span_showRealFreq").text(Eb.toHzString());Fb=Cb=0}sc();return this},ib=function(xa){$("#dividerConfigureDialog").is(":visible")&&$("#dividerConfigureDialog").dialog("destroy");
if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(xa)){w=[];ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[xa].length;ca<e;ca+=1)w.push(NUTOOL_CLOCK.g_CLKSEL[xa][ca].slicePriorToX(":").sliceAfterX("/"));-1!==T.indexOf("Simplified")?(f="\u8bf7\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668"+xa+"\u3002\u5408\u7406\u7684\u6570\u503c\u5e94\u8be5\u4e3a"+w+"\u7684\u5176\u4e2d\u4e00\u4e2a\u3002",g="\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668!"+xa,m="\u786e\u8ba4"):-1!==T.indexOf("Traditional")?(f="\u8acb\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+
xa+"\u3002\u5408\u7406\u7684\u6578\u503c\u61c9\u8a72\u70ba"+w+"\u7684\u5176\u4e2d\u4e00\u500b\u3002",g="\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+xa,m="\u78ba\u8a8d"):(f="Please configure a value to "+xa+". The feasible value should be one of "+w+".",g="Configure a value to "+xa,m="Confirm");$('<div id="dividerConfigureDialog"><p>'+f+'</p><p class = "div_clock_composite">'+xa+': </p><input id="'+xa+'_input_dialog" type="text" value="0" class = "div_clock_composite"/><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:g,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:m,click:function(){M=parseInt($("#"+xa+"_input_dialog").val(),10).toString();ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[xa].length;ca<e;ca+=1)if(NUTOOL_CLOCK.g_CLKSEL[xa][ca].slicePriorToX(":").sliceAfterX("/")===M){$a=NUTOOL_CLOCK.g_CLKSEL[xa][ca];break}Q.name="1/("+xa+": "+M+")";Y.fillStyle="#FFFFFF";Q.textLength=Y.measureText(Q.name).width;Y.fillRect(Q.x,Q.y-18,Q.textLength,25);Y.fillStyle=Q.lastColor=Q.color="#C62A39";Q.x+=
(Q.textLength-Y.measureText(Q.name).width)/2;Y.fillText(Q.name,Q.x,Q.y);ya(xa,$a.sliceAfterX(":"));Ya();$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}});M=X(xa).toString();ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[xa].length;ca<e;ca+=1)if(NUTOOL_CLOCK.g_CLKSEL[xa][ca].sliceAfterX(":")===M){$a=NUTOOL_CLOCK.g_CLKSEL[xa][ca];break}$("#"+xa+"_input_dialog").val($a.slicePriorToX(":").sliceAfterX("/")).width(35).change(function(){if("undefined"===typeof this.value||
""===this.value||4<this.value.length||!/^\d+$/.test(this.value)||-1===w.indexOf(this.value))$("#"+xa+"_input_dialog").val("1"),-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):Da("The inputted content is incorrect. Please try again.")})}else{a=0;for(d=Z.length;a<
d;a+=1)for(E=Z[a],ca=0,e=NUTOOL_CLOCK.g_register_map[E].length;ca<e;ca+=1)if(H=NUTOOL_CLOCK.g_register_map[E][ca],-1!==H.indexOf(xa)&&H.indexOf(":")===xa.length){w=-1!==H.indexOf("-")?parseInt(H.sliceBetweenXandX(":","-"),10)-parseInt(H.sliceAfterX("-"),10)+1:parseInt(H.sliceAfterX(":"),10);w=Math.pow(2,w)-1;break}-1!==T.indexOf("Simplified")?(f="\u8bf7\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668"+xa+"\u3002\u5408\u7406\u7684\u8303\u56f4\u4ece0\u5230"+w+"\u3002",g="\u8bbe\u7f6e\u503c\u7ed9\u9664\u9891\u5668!"+
xa,m="\u786e\u8ba4"):-1!==T.indexOf("Traditional")?(f="\u8acb\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+xa+"\u3002\u5408\u7406\u7684\u7bc4\u570d\u5f9e0\u5230"+w+"\u3002",g="\u8a2d\u7f6e\u503c\u7d66\u9664\u983b\u5668"+xa,m="\u78ba\u8a8d"):(f="Please configure a value to "+xa+". The feasible range is from 0 to "+w+".",g="Configure a value to "+xa,m="Confirm");$('<div id="dividerConfigureDialog"><p>'+f+'</p><p class = "div_clock_composite">'+xa+': </p><input id="'+xa+'_input_dialog" type="text" value="0" class = "div_clock_composite"/><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:g,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:m,click:function(){M=parseInt($("#"+xa+"_input_dialog").val(),10);Q.name="1/("+xa+": "+M+" + 1)";Y.fillStyle="#FFFFFF";Q.textLength=Y.measureText(Q.name).width;Y.fillRect(Q.x,Q.y-18,Q.textLength,25);Y.fillStyle=Q.lastColor=Q.color="#C62A39";Q.x+=(Q.textLength-Y.measureText(Q.name).width)/2;Y.fillText(Q.name,Q.x,Q.y);ya(xa,M);Ya();$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}});
$("#"+xa+"_input_dialog").val(X(xa)).width(35).change(function(){if("undefined"===typeof this.value||""===this.value||4<this.value.length||!/^\d+$/.test(this.value)||parseInt(this.value,10)>w||0>parseInt(this.value,10))$("#"+xa+"_input_dialog").val("0"),-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):
Da("The inputted content is incorrect. Please try again.")})}};Y.font="18px Arial";Y.fillStyle="black";na=za.length;q=0;A=[];R=[];a=0;for(d=na;a<d;a+=1)-1===za[a].indexOf(ra)&&-1===za[a].indexOf("BASECLK")?A.push(za[a]+": "+fc(za[a]).toHzString()):A.push(za[a]),Y.measureText(A[A.length-1]).width>q&&(q=Y.measureText(A[A.length-1]).width),-1!==$.inArray(za[a].slicePriorToX("/").toString(),Za)?R[a]="black":R[a]="#BC8484";q+=30;1<na?(u=""!==Aa?45+Y.measureText("1/("+Aa+": 0 + 1)").width:0,ka=20+q+30+
u+45+Y.measureText(Ga).width+20,O=22*(za.length-1)+80):(ka=""!==Aa?20+q+Y.measureText("1/("+Aa+": 0 + 1)").width+45+Y.measureText(Ga).width+20:20+q+Y.measureText(Ga).width+20,O=80);"undefined"!==typeof Ka&&0!==Ka.length&&(O=22*(Ka.length-1)+80);la.setAttribute("width",ka);la.setAttribute("height",O);Y.font="18px Arial";Y.fillStyle="black";S=20;ea=[];Q={name:""};if(1<na){a=0;for(d=na;a<d;a+=1)c=22*a+40,Y.fillStyle=R[a],Y.fillText(A[a],S,c),n=new Db(S,c+2,S+q,c+2),n.drawWithArrowheads(Y),ea.push({name:A[a],
x:S,y:c,textLength:Y.measureText(A[a]).width,color:R[a],lastColor:R[a]});Y.beginPath();Y.moveTo(20+q,20);Y.lineTo(20+q,22*(na-1)+60);Y.lineTo(20+q+30,22*(na-1)+40);Y.lineTo(20+q+30,40);Y.lineTo(20+q,20);Y.stroke();u=0;""!==Aa&&(n=new Db(20+q+30,22*(na-1)/2+40,20+q+30+45,22*(na-1)/2+40),n.drawWithArrowheads(Y),u+=45,S=20+q+30+45,c=22*(na-1)/2+49-2,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(Aa)?(Y.fillText("1/("+Aa+": 0)",S,c),u+=Y.measureText("1/("+Aa+": 0)").width,Q={name:"1/("+Aa+": 0)",x:S,y:c,textLength:Y.measureText("1/("+
Aa+": 0)").width,color:"black",lastColor:"black"}):(Y.fillText("1/("+Aa+": 0 + 1)",S,c),u+=Y.measureText("1/("+Aa+": 0 + 1)").width,Q={name:"1/("+Aa+": 0 + 1)",x:S,y:c,textLength:Y.measureText("1/("+Aa+": 0 + 1)").width,color:"black",lastColor:"black"}));n=new Db(20+q+30+u,22*(na-1)/2+40,20+q+30+u+45,22*(na-1)/2+40);n.drawWithArrowheads(Y);Y.fillText(Ga,20+q+30+u+45,22*(na-1)/2+49-2)}else c=40,Y.fillText(A[0],S,c),n=new Db(S,c+2,S+q,c+2),n.drawWithArrowheads(Y),ea.push({name:A[0],x:S,y:c,textLength:Y.measureText(A[0]).width,
color:R[0],lastColor:R[0]}),u=0,""!==Aa&&(S=20+q,NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(Aa)?(Y.fillText("1/("+Aa+": 0)",S,c+9-2),u+=Y.measureText("1/("+Aa+": 0)").width,Q={name:"1/("+Aa+": 0)",x:S,y:c+9-2,textLength:Y.measureText("1/("+Aa+": 0)").width,color:"black",lastColor:"black"}):(Y.fillText("1/("+Aa+": 0 + 1)",S,c+9-2),u+=Y.measureText("1/("+Aa+": 0 + 1)").width,Q={name:"1/("+Aa+": 0 + 1)",x:S,y:c+9-2,textLength:Y.measureText("1/("+Aa+": 0 + 1)").width,color:"black",lastColor:"black"}),n=new Db(20+
q+u,c,20+q+u+45,c),n.drawWithArrowheads(Y),u+=45),Y.fillText(Ga,20+q+u,c+9-2);Hb.addEvent(la,"mousemove",function(xa){ha(la,xa);bb=!1;a=0;for(d=ea.length;a<d;a+=1)C>=ea[a].x&&C<=ea[a].x+ea[a].textLength&&B>=ea[a].y-18-3&&B<=ea[a].y?"#DF630E"!==ea[a].color&&(ea[a].lastColor=ea[a].color,ea[a].color="#DF630E",bb=!0):ea[a].color!==ea[a].lastColor&&(ea[a].color=ea[a].lastColor,bb=!0);if(bb)for(a=0,d=ea.length;a<d;a+=1)Y.fillStyle="#FFFFFF",Y.fillRect(ea[a].x,ea[a].y-18,ea[a].textLength+10,18),Y.fillStyle=
ea[a].color,Y.fillText(ea[a].name,ea[a].x,ea[a].y);bb=!1;Q.name&&(C>=Q.x&&C<=Q.x+Q.textLength&&B>=Q.y-18&&B<=Q.y?"#DF630E"!==Q.color&&(Q.lastColor=Q.color,Q.color="#DF630E",bb=!0):Q.color!==Q.lastColor&&(Q.color=Q.lastColor,bb=!0));bb&&(Y.fillStyle="#FFFFFF",Y.fillRect(Q.x,Q.y-18,Q.textLength,25),Y.fillStyle=Q.color,Y.fillText(Q.name,Q.x,Q.y))});Hb.addEvent(la,"click",function(){$b()});-1!==Ga.indexOf(ra)?(D="<div id='HCLK_div_showRealFreq'><p class = 'div_clock_composite'><span class=specificRealOutput_before_span>The clock of </span>"+
ra+"<span class=realOutput_after_span>: </span><span id='HCLK_span_showRealFreq'></span></p></div>",Ja.append(D),$("#HCLK_div_showRealFreq")[0].setAttribute("style","position:absolute; top:"+(85+O+30)+"px; width: 90%;"),$("#HCLK_div_showRealFreq").css("border-bottom","8px solid black"),$("#HCLK_span_showRealFreq").css("color","#2E2EFE")):-1!==Ga.indexOf("PCLK0")?(D="<div id='PCLK0_div_showRealFreq'><p class = 'div_clock_composite'><span class=specificRealOutput_before_span>The clock of </span>PCLK0<span class=realOutput_after_span>: </span><span id='PCLK0_span_showRealFreq'></span></p></div>",
Ja.append(D),$("#PCLK0_div_showRealFreq")[0].setAttribute("style","position:absolute; top:"+(da+O+30)+"px;"),$("#PCLK0_span_showRealFreq").css("color","#2E2EFE")):-1!==Ga.indexOf("PCLK1")?(D="<div id='PCLK1_div_showRealFreq'><p class = 'div_clock_composite'><span class=specificRealOutput_before_span>The clock of </span>PCLK1<span class=realOutput_after_span>: </span><span id='PCLK1_span_showRealFreq'></span></p></div>",Ja.append(D),$("#PCLK1_div_showRealFreq")[0].setAttribute("style","position:absolute; top:"+
(da+O+60)+"px;"),$("#PCLK1_span_showRealFreq").css("color","#2E2EFE")):-1!==Ga.indexOf(Ia)&&(D="<div id='PCLK_div_showRealFreq'><p class = 'div_clock_composite'><span class=specificRealOutput_before_span>The clock of </span>"+Ia+"<span class=realOutput_after_span>: </span><span id='PCLK_span_showRealFreq'></span></p></div>",Ja.append(D),$("#PCLK_div_showRealFreq")[0].setAttribute("style","position:absolute; top:"+(da+O+30)+"px;"),$("#PCLK_span_showRealFreq").css("color","#2E2EFE"));-1!==T.indexOf("Simplified")?
($(".specificRealOutput_before_span").text(""),$(".realOutput_after_span").text("\u7684\u65f6\u8109\u9891\u7387: ")):-1!==T.indexOf("Traditional")?($(".specificRealOutput_before_span").text(""),$(".realOutput_after_span").text("\u7684\u6642\u8108\u983b\u7387: ")):($(".specificRealOutput_before_span").text("The clock of "),$(".realOutput_after_span").text(": "));if(""!==Aa){if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(Aa)){var vb=X(Aa).toString();a=0;for(d=NUTOOL_CLOCK.g_CLKSEL[Aa].length;a<d;a+=1)if(NUTOOL_CLOCK.g_CLKSEL[Aa][a].sliceAfterX(":")===
vb){var $a=NUTOOL_CLOCK.g_CLKSEL[Aa][a].slicePriorToX(":");break}-1===$a.indexOf("/")?Q.name="1/("+Aa+": 1)":Q.name="1/("+Aa+": "+$a.sliceAfterX("/")+")"}else Q.name="1/("+Aa+": "+X(Aa)+" + 1)";Y.fillStyle="#FFFFFF";Q.textLength=Y.measureText(Q.name).width;Y.fillRect(Q.x,Q.y-18,Q.textLength,25);Y.fillStyle=Q.lastColor=Q.color="#C62A39";Q.x+=(Q.textLength-Y.measureText(Q.name).width)/2;Y.fillText(Q.name,Q.x,Q.y)}$a="";H="BASECLK"===Ga?"BASESEL":Ga===ra?NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")?
"CPUCKDIV":y:"PCLK0"===Ga?G:"PCLK1"===Ga?J:x;vb=X(H).toString();if(-1!==vb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(H))for(a=0,d=NUTOOL_CLOCK.g_CLKSEL[H].length;a<d;a+=1)if(NUTOOL_CLOCK.g_CLKSEL[H][a].sliceAfterX(":")===vb){$a=NUTOOL_CLOCK.g_CLKSEL[H][a].slicePriorToX(":");break}vb=ea.length;if(""!==$a)for(a=0,d=ea.length;a<d;a+=1)if(H=ea[a].name,-1!==H.indexOf("DIV")&&-1!==H.indexOf(":")&&(W=H,H=W.slicePriorToX(":")+"+"+W.sliceAfterX("+")),-1!==H.indexOf(":")){if(-1!==H.indexOf($a)&&H.indexOf(":")===
$a.length&&"#BC8484"!==ea[a].color){vb=a;break}}else if(-1!==H.indexOf($a)){vb=a;break}$b(vb)};var ha=function(la,Ga){wa=la.getBoundingClientRect();C=Ga.clientX-wa.left;B=Ga.clientY-wa.top;return this};var K=function(){var la=md(NUTOOL_CLOCK.g_CPUCLKLimit)?NUTOOL_CLOCK.g_CPUCLKLimit:parseInt(NUTOOL_CLOCK.g_CPUCLKLimit[kb.slicePriorToX("(")],10);tc?tc=!1:"none"!==$("#add-tab-3").css("display")&&(tb>la?-1!==T.indexOf("Simplified")?Da("CPU\u9891\u7387\u4e0a\u9650\u4e3a"+la.toHzString()+"\u3002 "+ra+
"\u9891\u7387\u4e0d\u5e94\u8d85\u8fc7\u5176\u9650\u5236\u3002"):-1!==T.indexOf("Traditional")?Da("CPU\u983b\u7387\u4e0a\u9650\u70ba"+la.toHzString()+"\u3002 "+ra+"\u983b\u7387\u4e0d\u61c9\u8d85\u904e\u5176\u9650\u5236\u3002"):Da("The upper limit of CPU frequency is "+la.toHzString()+". The "+ra+" frequency should not run beyond the limit."):($("#tab-4")[0]||Xa(),$("#add-tab-3").hide(),gb<$("#tabs").tabs("option","active")+1&&(gb=$("#tabs").tabs("option","active")+1)))};cc();$("#tab-4")[0]?($("<li id='li-3'><a href='#tab-3'>"+
ra+"/"+Ia+"</a></li>").insertBefore("#li-4"),$("<div id='tab-3'></div>").insertBefore("#tab-4")):($("#tabs ul").append("<li id='li-3'><a href='#tab-3'>"+ra+"/"+Ia+"</a></li>"),$("#tabs").append("<div id='tab-3'></div>"));var Ja=$("#tab-3");fb=sb=Pb=Ob=Nb=Mb=Lb=Kb=0;Za=[];t("OSC10K_EN".toEquivalent())&&(Kb=NUTOOL_CLOCK.g_LIRCfrequency,Za.push("LIRC"));if(t("OSC22M_EN".toEquivalent())||t("HIRC1EN"))Lb=NUTOOL_CLOCK.g_HIRCfrequency,Za.push(U);t("HIRC48EN")&&(Mb=NUTOOL_CLOCK.g_HIRC48frequency,Za.push("HIRC48"));
t("MIRCEN")&&(Nb=NUTOOL_CLOCK.g_MIRCfrequency,Za.push("MIRC"));t("MIRC1P2MEN")&&(Ob=NUTOOL_CLOCK.g_MIRC1P2Mfrequency,Za.push("MIRC1P2M"));0!==NUTOOL_CLOCK.g_RTC32kfrequency&&(Pb=NUTOOL_CLOCK.g_RTC32kfrequency,Za.push("RTC32k"));t(pa)&&(sb=32768,Za.push("LXT"));t("LIRC32KEN")&&(sb=32E3,Za.push("LXT"));t(Pa)&&(fb=1E6*parseFloat($("#"+Pa+"_input").val()),Yb=NUTOOL_CLOCK.g_HSUSBOTGPHYfrequency,Za.push(F),Za.push("HSUSB_OTG_PHY"));(!t("PD")||t("PLLEN"))&&0<ia&&Za.push(N);!t("APD")&&0<Wa&&Za.push("APLL");
t("PLL2CKEN")&&0<cb&&Za.push("PLL2");t("PLL2CKEN")&&0<Ib&&Za.push("PLL480M");NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")&&Za.push("BASECLK");Za.push(ra);F=[];var v=y;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v)){var ca=0;for(e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)F.push(NUTOOL_CLOCK.g_CLKSEL[v][ca].slicePriorToX(":"))}-1!==T.indexOf("Simplified")?Ja[0].appendChild(zb("button","add-tab-3","\u4e0b\u4e00\u6b65")):-1!==T.indexOf("Traditional")?Ja[0].appendChild(zb("button","add-tab-3","\u4e0b\u4e00\u6b65")):
Ja[0].appendChild(zb("button","add-tab-3","Next Step"));Ja[0].appendChild(zb("canvas","HCLK_canvas"));N=$("#HCLK_canvas");N[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:30px; top:85px; border: 1px solid black;");if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")){qa(N[0],"BASECLK","",F,NUTOOL_CLOCK.g_CLKSEL.CPUCKDIV);F=[];v="CPUCKDIV";if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)F.push(NUTOOL_CLOCK.g_CLKSEL[v][ca].slicePriorToX(":"));
Ja[0].appendChild(zb("canvas","HCLK_canvas1"));N=$("#HCLK_canvas1");N[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:400px; top:85px; border: 1px solid black;");qa(N[0],ra,"",F)}else qa(N[0],ra,r,F);if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(G)){Za.push("PCLK0");Za.push("PCLK1");F=[];v=G;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)F.push(NUTOOL_CLOCK.g_CLKSEL[v][ca].slicePriorToX(":"));Ja[0].appendChild(zb("canvas",
"PCLK0_canvas"));N=$("#PCLK0_canvas");var da=85+O+30+60;N[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:30px; top:"+da+"px; border: 1px solid black;");qa(N[0],"PCLK0","",F);F=[];v=J;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(v))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)F.push(NUTOOL_CLOCK.g_CLKSEL[v][ca].slicePriorToX(":"));Ja[0].appendChild(zb("canvas","PCLK1_canvas"));N=$("#PCLK1_canvas");N[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:300px; top:"+
da+"px; border: 1px solid black;");qa(N[0],"PCLK1","",F);$("#add-tab-3")[0].setAttribute("style","position:absolute; left:450px; top:"+(da+O+30)+"px;")}else{Za.push(Ia);F=[];v=x;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(x))for(ca=0,e=NUTOOL_CLOCK.g_CLKSEL[v].length;ca<e;ca+=1)F.push(NUTOOL_CLOCK.g_CLKSEL[v][ca].slicePriorToX(":"));else F=[ra];Ja[0].appendChild(zb("canvas","PCLK_canvas"));N=$("#PCLK_canvas");da=85+O+30+60;N[0].setAttribute("style","z-index:1; position:absolute; background-color: #FFFFFF; left:30px; top:"+
da+"px; border: 1px solid black;");-1===X(I)?qa(N[0],Ia,"",F):qa(N[0],Ia,I,F);$("#add-tab-3")[0].setAttribute("style","position:absolute; top:"+(da+O+30+40)+"px;")}$("#add-tab-3").addClass("css_btn_class");Hb.addEvent($("#add-tab-3")[0],"click",K);$("#tabs").tabs("refresh");$("#tabs").tabs({active:2});2!==$("#tabs").tabs("option","active")&&$("#tabs").tabs({active:1});"none"!==$("#clockRegsTree").css("display")?(h.css("width",mb-ab-8+"px"),$("#tab-3").css("width",mb-ab-8+"px")):(h.css("width",mb-
8+"px"),$("#tab-3").css("width",mb-8+"px"));h.css("height",Xb-8+"px");$("#tab-3").css("height",Xb-8+"px");"single"!==b&&gb>$("#tabs").tabs("option","active")+1&&K();$("#tab-4")[0]&&$("#add-tab-3").hide()}function yc(b){var a,d,e=$("#tabs"),h,f,g=0,m=0,D=0,k,L=0,H,W,E,w,q,A={},R,S=[],c=[],na,u,n,M,F,ka,O,wa,C,B,N,U,ra,Ia,r=!1,I,y,x,G,J=6,pa=[],Pa,qa,ha,K,Ja,v,ca=!1,da="",la="",Ga="",Aa="",za="",Ka="",Y="",ea="",Q="",bb="",Qa,$b="HXT".toEquivalent().toString(),Ya="PLL".toEquivalent().toString(),ib=
"HIRC".toEquivalent().toString(),vb="HCLK_S".toEquivalent().toString(),$a="PLLCON".toEquivalent().toString(),xa="OSC10K_EN".toEquivalent().toString(),hb="OSC22M_EN".toEquivalent().toString(),oc="XTL32K_EN".toEquivalent().toString(),Ua="XTL12M_EN".toEquivalent().toString();var pb=Qa=0;if("NUC400"===p)J=4,0===ia&&(g=84E6),0===cb&&(m=24E7);else if(0===p.indexOf("M25")){var jb=4E6;var nb=8E6;var Va=64E6;var Ba=1E8;Qa=16E6;pb=1E8;0===ia&&(g=48E6)}else if("M2351"===p||"M2354"===p||"M261"===p)jb=2E6,nb=
8E6,Va=96E6,Ba=2E8,Qa=24E6,pb=144E6,0===ia&&(g=48E6);else if("M451"===p||"NUC1262"===p||0===p.indexOf("M030")||0===p.indexOf("M031")){var rb=32E5;var ja=15E7;jb=8E5;nb=8E6;Va=2E8;Ba=5E8;0===ia&&(g=0===p.indexOf("M030")||0===p.indexOf("M031")?96E6:"NUC1262"===p?144E6:72E6)}else if(0===p.indexOf("M480"))jb=4E6,nb=8E6,Va=2E8,Ba=5E8,Qa=5E7,pb=5E8,0===ia&&(g=72E6);else if(0===p.indexOf("KM1M7"))rb=4E6,ja=2E7,Va=12E7,Ba=24E7,Qa=6E7,pb=16E7,0===ia&&(g=1E8);else if("NUC100AN"===p||"NUC100BN"===p||"NUC100CN"===
p||"M051AN"===p||"M0519"===p||"NM1500"===p)rb=32E5,ja=15E7,jb=8E5,nb=8E6,Va=1E8,Ba=2E8,0===ia&&(g=48E6);else if("NUC100DN"===p||"NUC131"===p||"M0518"===p||"NUC200AN"===p||"NUC200AE"===p||"NUC2201"===p||"NUC029xDE"===p||"NUC029xEE"===p)rb=32E5,ja=15E7,jb=8E5,nb=75E5,Va=1E8,Ba=2E8,0===ia&&(g=48E6);else if("NUC122AN"===p)rb=32E5,ja=15E7,jb=8E5,nb=75E5,Va=1E8,Ba=5E8,0===ia&&(g=48E6);else if("NUC121AE"===p)rb=4E6,ja=24E6,jb=8E5,nb=8E6,Va=2E8,Ba=5E8,0===ia&&(g=96E6);else if("NUC123AN_AE"===p||"M0564"===
p||0===p.indexOf("NUC126")||"NUC029xGE"===p)rb=4E6,ja=24E6,jb=8E5,nb=8E6,Va=1E8,Ba=2E8,0===ia&&(g=48E6);else if("MINI58"===p)rb=4E6,ja=24E6,jb=8E5,nb=75E5,Va=1E8,Ba=2E8,0===ia&&(g=5E7);else if("NANO100AN"===p)Qa=Va=nb=jb=ja=rb=0,pb=Ba=12E7,0===ia&&(g=96E6);else if("NANO100BN"===p)nb=jb=ja=rb=0,Qa=Va=48E6,pb=Ba=96E6,0===ia&&(g=96E6);else if("NANO112"===p)rb=8E5,ja=2E6,nb=jb=0,Qa=Va=16E6,pb=Ba=32E6,0===ia&&(g=16E6);else if("NANO103"===p)rb=8E5,ja=2E6,nb=jb=0,Qa=Va=16E6,pb=Ba=36E6,0===ia&&(g=16E6);else if("NUC505"===
p){J=2;ja=rb=0;jb=5E6;nb=8E7;Va=3E8;Ba=1E9;var Ma=25E5;var db=8E7;var ac=2E8;var Qb=5E8;0===ia&&(g=24E7);0===Wa&&(D=24E7)}else rb=4E6,ja=24E6,jb=8E5,nb=75E5,Va=1E8,Ba=2E8,0===ia&&(g=48E6);var kc=function(sa,ta,Ea,V,Oa,eb,oa){h=oa?eb?"<div id='"+ta+"_div'><br /><p class='field switch div_clock_composite'><input type='radio' id='radio_"+ta+"_enable' name='field'/><input type='radio' id='radio_"+ta+"_disable' name='field'/><label for='radio_"+ta+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+
ta+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Ea+": </p><input id='"+ta+"_input' title='Input the expected value' type='text' value='"+V+"' class = 'div_clock_composite'/><p class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Oa+"  &#177</p><select id ='"+Ea+"_inaccuracy_select'></select><br /></div>":"<div id='"+ta+"_div'><br /><p class='field switch div_clock_composite'><input type='radio' id='radio_"+
ta+"_enable' name='field'/><input type='radio' id='radio_"+ta+"_disable' name='field'/><label for='radio_"+ta+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+ta+"_disable' class='cb-disable selected'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Ea+": </p><input id='"+ta+"_input' title='Input the expected value' type='text' value='"+V+"' class = 'div_clock_composite'/><p class = '"+
Ea+"_"+ta+"_p div_clock_composite'>"+Oa+"  &#177</p><select id ='"+Ea+"_inaccuracy_select'></select><br /></div>":eb?"<div id='"+ta+"_div'><br /><p class='field switch div_clock_composite'><input type='radio' id='radio_"+ta+"_enable' name='field'/><input type='radio' id='radio_"+ta+"_disable' name='field'/><label for='radio_"+ta+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+ta+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = '"+
Ea+"_"+ta+"_p div_clock_composite'>"+Ea+": </p><input id='"+ta+"_input' title='Input the expected value' type='text' value='"+V+"' class = 'div_clock_composite'/><p class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Oa+" / PLL480M: 480MHz</p><br /></div>":"<div id='"+ta+"_div'><br /><p class='field switch div_clock_composite'><input type='radio' id='radio_"+ta+"_enable' name='field'/><input type='radio' id='radio_"+ta+"_disable' name='field'/><label for='radio_"+ta+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+
ta+"_disable' class='cb-disable selected'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Ea+": </p><input id='"+ta+"_input' title='Input the expected value' type='text' value='"+V+"' class = 'div_clock_composite'/><p class = '"+Ea+"_"+ta+"_p div_clock_composite'>"+Oa+" / PLL480M: 480MHz</p><br /></div>";sa.append(h);h="<div id='"+Ea+"_div_showRealFreq'><br /><p class = 'div_clock_composite'><span class=specificRealOutput_before_span>The clock of </span>"+
Ea+"<span class=realOutput_after_span>: </span><span id='"+Ea+"_span_showRealFreq'></span></p></div><br /><br />";sa.append(h);if(oa){R=$("#"+Ea+"_inaccuracy_select");for(a=0;11>a;a+=1){A=window.document.createElement("option");try{A.innerHTML=A.value=a+"%",A.id=Ea+"_inaccuracy_"+a+"%"}catch(ic){}R[0].appendChild(A)}R.val("0%");R.on("change",function(){Ea===Ya?va($("#PD_input").val(),!1,R.val(),$a):va($("#APD_input").val(),!1,R.val(),"APLLCTL")})}-1!==T.indexOf("Simplified")?($("#pll_clocks_span").text(Ya),
$(".enable_span").text("\u542f\u7528"),$(".disable_span").text("\u505c\u7528"),$(".specificRealOutput_before_span").text(""),$(".realOutput_after_span").text("\u7684\u65f6\u8109\u9891\u7387: "),$("[title]").prop("title","\u8f93\u5165\u671f\u671b\u503c")):-1!==T.indexOf("Traditional")?($("#pll_clocks_span").text(Ya),$(".enable_span").text("\u555f\u7528"),$(".disable_span").text("\u505c\u7528"),$(".specificRealOutput_before_span").text(""),$(".realOutput_after_span").text("\u7684\u6642\u8108\u983b\u7387: "),
$("[title]").prop("title","\u8f38\u5165\u671f\u671b\u503c")):($("#pll_clocks_span").text(Ya),$(".enable_span").text("Enable"),$(".disable_span").text("Disable"),$(".specificRealOutput_before_span").text("The clock of "),$(".realOutput_after_span").text(": "),$("[title]").prop("title","Input the expected value"));$("#"+Ea+"_span_showRealFreq").css("color","#2E2EFE");$("#"+ta+"_input").width(85);$("#PLL2CKEN_input").width(78)};var va=function(sa,ta,Ea,V){var Oa="General",eb=null;if("undefined"!==typeof Ea){V===
$a?$("#PLLCTLtable").dataTable().fnDestroy():$("#APLLCTLtable").dataTable().fnDestroy();Ea=parseInt(Ea.slice(0,Ea.length-1),10);sa=1E6*parseFloat(sa,10);S=[];(t(hb)||t("HIRC1EN"))&&-1===p.indexOf("KM1M7")&&("NUC121AE"===p||"NUC1262"===p?S.push(ib+"/2"):0===p.indexOf("M25")||0===p.indexOf("M030")||0===p.indexOf("M031")?S.push(ib+"/4"):S.push(ib));!t("MIRCEN")||0!==p.indexOf("M25")&&"NANO103"!==p||S.push("MIRC");t(Ua)&&S.push($b);c=[];ta?(ca=!1,ra=ba[V]&Math.pow(2,16)-1,U=ba[V]&1048576?1:0,Ia=1===X("PLL_SRC")?
"NUC121AE"===p||"NUC1262"===p?ib+"/2":0===p.indexOf("M25")||0===p.indexOf("M030")||0===p.indexOf("M031")?ib+"/4":ib:2===X("PLL_SRC")?"MIRC":3===X("PLL_SRC")?"MIRC":$b):ca=!0;Oa="General";a=0;for(d=NUTOOL_CLOCK.g_register_map[V].length;a<d;a+=1){if("FB_DV:5-0"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="NANO100AN_BN";break}if("PLL_MLP:5-0"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="NANO112_103";break}if("PLLREMAP:20"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="NUC400";break}if("FBDIV:6-0"===NUTOOL_CLOCK.g_register_map[V][a]){Oa=
"NUC505(PLL)";break}if("FRAC:31-20"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="NUC505(APLL)";break}if("FBDIV:5-0"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="M251";break}if("PLLMUL:5-0"===NUTOOL_CLOCK.g_register_map[V][a]){Oa="KM1M7";break}}if(0===p.indexOf("M480")||"M2351"===p||"M2354"===p||"M261"===p)Oa="M480";if("NANO100AN_BN"===Oa)for(a=0,d=S.length;a<d;a+=1){var oa=S[a];I=oa===ib?NUTOOL_CLOCK.g_HIRCfrequency:1E6*parseFloat($("#"+Ua+"_input").val());M=0;for(N=Math.pow(2,6);M<N;M+=1)for(n=0,B=Math.pow(2,
2);n<B;n+=1)for(u=0,C=Math.pow(2,1);u<C;u+=1)O=u+1,x=I*(M+32)/Math.pow(2,n+1)/O,x>=Va&&x<=Ba&&(G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<12)+(n<<8)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0x"+Sa((u<<12)+(n<<8)+M,4).toUpperCase(),c[0][2]=oa,c[0][3]=(x/1E6).toFixed(4)+"MHz",c[0][4]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0x"+Sa((u<<12)+(n<<8)+M,4).toUpperCase(),c[c.length-1][2]=oa,c[c.length-1][3]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][4]=G.toFixed(4)+"%")))}else if("NANO112_103"===
Oa)for(a=0,d=S.length;a<d;a+=1){oa=S[a];I=oa===ib?NUTOOL_CLOCK.g_HIRCfrequency:"MIRC"===oa?NUTOOL_CLOCK.g_MIRCfrequency:1E6*parseFloat($("#"+Ua+"_input").val());if(0!==NUTOOL_CLOCK.g_MIRCfrequency){ta=6;var ic=36}else ta=4,ic=32;M=1;for(N=ic;M<=N;M+=1)for(n=0,B=Math.pow(2,ta);n<B;n+=1)y=I/(n+1),x=y*M,y>=rb&&y<=ja&&x>=Va&&x<=Ba&&(G=Math.abs(x-sa)/sa*100,G<=Ea&&((n<<8)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0x"+Sa((n<<8)+M,4).toUpperCase(),c[0][2]=oa,c[0][3]=(x/1E6).toFixed(4)+"MHz",c[0][4]=
G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0x"+Sa((n<<8)+M,4).toUpperCase(),c[c.length-1][2]=oa,c[c.length-1][3]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][4]=G.toFixed(4)+"%")))}else if("NUC400"===Oa)for(a=0,d=S.length;a<d;a+=1){oa=S[a];I=oa===ib?NUTOOL_CLOCK.g_HIRCfrequency:1E6*parseFloat($("#"+Ua+"_input").val());if(32E5<I&&15E7>I)for(na=0,wa=Math.pow(2,1);na<wa;na+=1)for(M=0,N=Math.pow(2,9);M<N;M+=1)for(n=0,B=Math.pow(2,5);n<B;n+=1)for(u=0,C=Math.pow(2,2);u<C;u+=1){switch(u){case 0:O=
1;break;case 1:case 2:O=2;break;case 3:O=4}r=!1;0===na?8E5<I/2/(n+2)&&8E6>I/2/(n+2)&&1E8<I*(M+2)/(n+2)&&2E8>I*(M+2)/(n+2)&&(r=!0):8E5<I/2/(n+2)&&8E6>I/2/(n+2)&&2E8<I*(M+2)/(n+2)&&5E8>I*(M+2)/(n+2)&&(r=!0);r&&(x=I*(M+2)/(n+2)/O,G=Math.abs(x-sa)/sa*100,G<=Ea&&(na===U&&(u<<14)+(n<<9)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0",c[0][2]=na,c[0][3]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[0][4]=oa,c[0][5]=(x/1E6).toFixed(4)+"MHz",c[0][6]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",
c[c.length-1][1]="0",c[c.length-1][2]=na,c[c.length-1][3]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[c.length-1][4]=oa,c[c.length-1][5]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][6]=G.toFixed(4)+"%")))}x=I;G=Math.abs(x-sa)/sa*100;G<=Ea&&(oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="1",c[0][2]="0xX",c[0][3]="0xXXXX",c[0][4]=oa,c[0][5]=(x/1E6).toFixed(4)+"MHz",c[0][6]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="1",c[c.length-1][2]="0xX",c[c.length-1][3]="0xXXXX",c[c.length-1][4]=
oa,c[c.length-1][5]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][6]=G.toFixed(4)+"%"))}else if("NUC505(PLL)"===Oa){oa=S[0];I=1E6*parseFloat($("#"+Ua+"_input").val());M=0;for(N=Math.pow(2,7);M<N;M+=1)for(n=0,B=Math.pow(2,6);n<B;n+=1)for(u=0,C=Math.pow(2,3);u<C;u+=1)O=u+1,I/(n+1)>=jb&&I/(n+1)<=nb&&I*(M+1)/(n+1)>=Va&&I*(M+1)/(n+1)<=Ba&&(x=I*(M+1)/(n+1)/O,G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<13)+(n<<7)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0",c[0][2]="0x"+Sa((u<<13)+(n<<7)+M,4).toUpperCase(),c[0][3]=
oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0",c[c.length-1][2]="0x"+Sa((u<<13)+(n<<7)+M,4).toUpperCase(),c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%")));x=I;G=Math.abs(x-sa)/sa*100;G<=Ea&&(oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="1",c[0][2]="0xXXXX",c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="1",
c[c.length-1][2]="0xXXXX",c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%"))}else if("NUC505(APLL)"===Oa)for(oa=S[0],I=1E6*parseFloat($("#"+Ua+"_input").val()),M=0,N=Math.pow(2,7);M<N;M+=1)for(n=0,B=Math.pow(2,6);n<B;n+=1)for(u=0,C=Math.pow(2,3);u<C;u+=1)O=u+1,I/(n+1)>=Ma&&I/(n+1)<=db&&I*(M+1)/(n+1)>=ac&&I*(M+1)/(n+1)<=Qb&&(x=I*(M+1)/(n+1)/O,G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<13)+(M<<6)+n===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0x"+Sa((u<<13)+
(M<<6)+n,4).toUpperCase(),c[0][2]=oa,c[0][3]=(x/1E6).toFixed(4)+"MHz",c[0][4]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0x"+Sa((u<<13)+(M<<6)+n,4).toUpperCase(),c[c.length-1][2]=oa,c[c.length-1][3]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][4]=G.toFixed(4)+"%")));else if("M480"===Oa)for(a=0,d=S.length;a<d;a+=1){oa=S[a];I=oa===ib?NUTOOL_CLOCK.g_HIRCfrequency:1E6*parseFloat($("#"+Ua+"_input").val());M=0;for(N=Math.pow(2,9);M<N;M+=1)for(n=0,B=Math.pow(2,5);n<B;n+=1)for(u=0,
C=Math.pow(2,2);u<C;u+=1){switch(u){case 0:O=1;break;case 1:case 2:O=2;break;case 3:O=4}I/(n+1)>=jb&&I/(n+1)<=nb&&2*I*(M+2)/(n+1)>=Va&&2*I*(M+2)/(n+1)<=Ba&&(x=2*I*(M+2)/(n+1)/O,x>=Qa&&x<=pb&&(G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<14)+(n<<9)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0",c[0][2]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0",c[c.length-1][2]="0x"+Sa((u<<14)+
(n<<9)+M,4).toUpperCase(),c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%"))))}x=I;G=Math.abs(x-sa)/sa*100;G<=Ea&&(oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="1",c[0][2]="0xXXXX",c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="1",c[c.length-1][2]="0xXXXX",c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%"))}else if("KM1M7"===Oa)for(a=
0,d=S.length;a<d;a+=1)for(oa=S[a],oa===$b&&(I=1E6*parseFloat($("#"+Ua+"_input").val())),M=10,N=Math.pow(2,6);M<N;M+=1)for(n=0,B=Math.pow(2,2);n<B;n+=1)for(u=0,C=Math.pow(2,1);u<C;u+=1)F=0===n?1:n,O=u+1,y=I*M/F,x=y/O,1!==n&&I/F>=rb&&I/F<=ja&&y>=Va&&y<=Ba&&x>=Qa&&x<=pb&&(G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<6)+(n<<8)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0x"+Sa((u<<6)+(n<<8)+M,4).toUpperCase(),c[0][2]=oa,c[0][3]=(x/1E6).toFixed(4)+"MHz",c[0][4]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-
1][0]="",c[c.length-1][1]="0x"+Sa((u<<6)+(n<<8)+M,4).toUpperCase(),c[c.length-1][2]=oa,c[c.length-1][3]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][4]=G.toFixed(4)+"%")));else if("M251"===Oa)for(a=0,d=S.length;a<d;a+=1){oa=S[a];I="MIRC"===oa?NUTOOL_CLOCK.g_MIRCfrequency:oa===ib+"/4"?NUTOOL_CLOCK.g_HIRCfrequency/4:1E6*parseFloat($("#"+Ua+"_input").val());M=0;for(N=Math.pow(2,6);M<N;M+=1)for(n=0,B=Math.pow(2,4);n<B;n+=1)for(u=0,C=Math.pow(2,2);u<C;u+=1){switch(u){case 0:O=1;break;case 1:O=2;break;case 2:case 3:O=
4}F=0!==n?n:16;ka=0!==M?M:64;I/F>=jb&&I/F<=nb&&I*ka/F>=Va&&I*ka/F<=Ba&&(x=I*ka/F/O,x>=Qa&&x<=pb&&(G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<14)+(n<<9)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0",c[0][2]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0",c[c.length-1][2]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-
1][5]=G.toFixed(4)+"%"))))}x=I;G=Math.abs(x-sa)/sa*100;G<=Ea&&(oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="1",c[0][2]="0xXXXX",c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="1",c[c.length-1][2]="0xXXXX",c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%"))}else for(a=0,d=S.length;a<d;a+=1){oa=S[a];I=oa===ib?NUTOOL_CLOCK.g_HIRCfrequency:0===oa.indexOf(ib)&&"/"===oa.charAt(4)?NUTOOL_CLOCK.g_HIRCfrequency/
parseInt(oa.sliceAfterX("/"),10):1E6*parseFloat($("#"+Ua+"_input").val());if(I>rb&&I<ja)for(M=0,N=Math.pow(2,9);M<N;M+=1)for(n=0,B=Math.pow(2,5);n<B;n+=1)for(u=0,C=Math.pow(2,2);u<C;u+=1){switch(u){case 0:O=1;break;case 1:case 2:O=2;break;case 3:O=4}I/2/(n+2)>jb&&I/2/(n+2)<nb&&I*(M+2)/(n+2)>Va&&I*(M+2)/(n+2)<Ba&&(x=I*(M+2)/(n+2)/O,G=Math.abs(x-sa)/sa*100,G<=Ea&&((u<<14)+(n<<9)+M===ra&&oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="0",c[0][2]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[0][3]=oa,c[0][4]=
(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="0",c[c.length-1][2]="0x"+Sa((u<<14)+(n<<9)+M,4).toUpperCase(),c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%")))}x=I;G=Math.abs(x-sa)/sa*100;G<=Ea&&(oa===Ia?(c.unshift([]),c[0][0]="",c[0][1]="1",c[0][2]="0xXXXX",c[0][3]=oa,c[0][4]=(x/1E6).toFixed(4)+"MHz",c[0][5]=G.toFixed(4)+"%"):(c[c.length]=[],c[c.length-1][0]="",c[c.length-1][1]="1",c[c.length-
1][2]="0xXXXX",c[c.length-1][3]=oa,c[c.length-1][4]=(x/1E6).toFixed(4)+"MHz",c[c.length-1][5]=G.toFixed(4)+"%"))}V===$a?$("#PLL_tableWrapper")[0]||$("<span id='PLL_tableWrapper'><table cellpadding='0' cellspacing='0' border='0' class='display' id='PLLCTLtable'></table></span>'").insertAfter($("#PD_div")):$("#APLL_tableWrapper")[0]||$("<span id='APLL_tableWrapper'><table cellpadding='0' cellspacing='0' border='0' class='display' id='APLLCTLtable'></table></span>'").insertAfter($("#APD_div"));-1!==
T.indexOf("Simplified")?(da="\u8f93\u5165",la="\u5b9e\u9645\u8f93\u51fa",Ga="\u8bef\u5dee\u7387",Aa="\u6ca1\u6709\u53ef\u7528\u7684\u5019\u9009\u8005\u3002",za="\u5217\u51fa\u4ece_START_\u5230_END_\u3002\u5171\u6709_TOTAL_\u5019\u9009\u8005\u3002",Ka="\u5217\u51fa\u4ece0\u52300\u3002\u51710\u5019\u9009\u8005\u3002",Y="\u524d\u4e00\u9875",ea="\u4e0b\u4e00\u9875",Q="\u641c\u5bfb:",bb="\u70b9\u51fb\u4f7f\u5f97\u5411\u4e0a\u6392\u5e8f"):-1!==T.indexOf("Traditional")?(da="\u8f38\u5165",la="\u5be6\u969b\u8f38\u51fa",
Ga="\u8aa4\u5dee\u7387",Aa="\u6c92\u6709\u53ef\u7528\u7684\u5019\u9078\u8005\u3002",za="\u5217\u51fa\u5f9e_START_\u5230_END_\u3002\u5171\u6709_TOTAL_\u5019\u9078\u8005\u3002",Ka="\u5217\u51fa\u5f9e0\u52300\u3002\u51710\u5019\u9078\u8005\u3002",Y="\u524d\u4e00\u9801",ea="\u4e0b\u4e00\u9801",Q="\u641c\u5c0b:",bb="\u9ede\u64ca\u4f7f\u5f97\u5411\u4e0a\u6392\u5e8f"):(da="Input",la="Real Output",Ga="Inaccuracy",Aa="No candidate is available.",za="Showing _START_ to _END_ of _TOTAL_ candidates",Ka="Showing 0 to 0 of 0 candidates",
Y="Previous",ea="Next",Q="Search:",bb="Click to sort ascending");eb="NANO100AN_BN"===Oa||"NANO112_103"===Oa||"KM1M7"===Oa?$("#PLLCTLtable").dataTable({bPaginate:!0,bLengthChange:!1,bFilter:!1,bSort:ca,bInfo:!0,bAutoWidth:!0,iDisplayLength:J,aaSorting:[[4,"asc"]],pagingType:"simple",aaData:c,aoColumns:[{sTitle:""},{sTitle:V+"[15:0]"},{sTitle:da},{sTitle:la},{sTitle:Ga}],oLanguage:{sZeroRecords:Aa,sInfo:za,sInfoEmpty:Ka,oPaginate:{sPrevious:Y,sNext:ea},sSearch:Q,sInfoFiltered:""},columnDefs:[{orderable:!1,
className:"select-checkbox",targets:0},{className:"dt-center",targets:"_all"}],select:{style:"os",selector:"td:first-child"}}):"NUC505(APLL)"===Oa?$("#APLLCTLtable").dataTable({bPaginate:!0,bLengthChange:!1,bFilter:!1,bSort:ca,bInfo:!0,bAutoWidth:!0,iDisplayLength:J,aaSorting:[[4,"asc"]],pagingType:"simple",aaData:c,aoColumns:[{sTitle:""},{sTitle:V+"[15:0]"},{sTitle:da},{sTitle:la},{sTitle:Ga}],oLanguage:{sZeroRecords:Aa,sInfo:za,sInfoEmpty:Ka,oPaginate:{sPrevious:Y,sNext:ea},sSearch:Q,sInfoFiltered:""},
columnDefs:[{orderable:!1,className:"select-checkbox",targets:0},{className:"dt-center",targets:"_all"}],select:{style:"os",selector:"td:first-child"}}):"NUC400"===Oa?$("#PLLCTLtable").dataTable({bPaginate:!0,bLengthChange:!1,bFilter:!1,bSort:ca,bInfo:!0,bAutoWidth:!0,iDisplayLength:4,aaSorting:[[6,"asc"]],pagingType:"simple",aaData:c,aoColumns:[{sTitle:""},{sTitle:"BP"},{sTitle:"PLLREMAP"},{sTitle:"PLLCTL[15:0]"},{sTitle:da},{sTitle:la},{sTitle:Ga}],oLanguage:{sZeroRecords:Aa,sInfo:za,sInfoEmpty:Ka,
oPaginate:{sPrevious:Y,sNext:ea},sSearch:Q,sInfoFiltered:""},columnDefs:[{orderable:!1,className:"select-checkbox",targets:0},{className:"dt-center",targets:"_all"}],select:{style:"os",selector:"td:first-child"}}):$("#PLLCTLtable").dataTable({bPaginate:!0,bLengthChange:!1,bFilter:!1,bSort:ca,bInfo:!0,bAutoWidth:!0,iDisplayLength:J,aaSorting:[[5,"asc"]],pagingType:"simple",aaData:c,aoColumns:[{sTitle:""},{sTitle:"BP"},{sTitle:V+"[15:0]"},{sTitle:da},{sTitle:la},{sTitle:Ga}],oLanguage:{sZeroRecords:Aa,
sInfo:za,sInfoEmpty:Ka,oPaginate:{sPrevious:Y,sNext:ea},sSearch:Q,sInfoFiltered:""},columnDefs:[{orderable:!1,className:"select-checkbox",targets:0},{className:"dt-center",targets:"_all"}],select:{style:"os",selector:"td:first-child"}});V===$a?($("#PLLCTLtable tbody").delegate("tr td:first-child","click",function(rc){$(eb.fnSettings().aoData).each(function(){$(this.nTr).removeClass("row_selected")});$(rc.target.parentNode).addClass("row_selected");pa=eb.fnGetNodes();a=0;for(d=pa.length;a<d;a++)$(pa[a]).hasClass("row_selected")&&
("NANO100AN_BN"===Oa||"NANO112_103"===Oa?(ha=pa[a].childNodes[1].innerText,K=pa[a].childNodes[2].innerText,ia=pa[a].childNodes[3].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xXXXX"!==ha&&(v=ba[V]&Math.pow(2,16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16)),Ja=393216,v=ba[V]&Ja,v=ba[V]-v,ba[V]=K===ib?v+131072>>>0:"MIRC"===K?v+262144>>>0:v):"KM1M7"===Oa?(ha=pa[a].childNodes[1].innerText,ia=pa[a].childNodes[3].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xXXXX"!==ha&&(v=ba[V]&Math.pow(2,
16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16))):"NUC400"===Oa?(qa=pa[a].childNodes[1].innerText,Pa=pa[a].childNodes[2].innerText,ha=pa[a].childNodes[3].innerText,K=pa[a].childNodes[4].innerText,ia=pa[a].childNodes[5].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xX"!==Pa&&(Ja=1048576,v=ba.PLLCTL&Ja,v=ba.PLLCTL-v,Pa=parseInt(Pa,10),Pa=Pa<<20>>>0,ba.PLLCTL=v+Pa),"0xXXXX"!==ha&&(v=ba.PLLCTL&Math.pow(2,16)-1,v=ba.PLLCTL-v,ba.PLLCTL=v+parseInt(ha.slice(2),16)),Ja=524288,v=ba.PLLCTL&Ja,v=ba.PLLCTL-
v,ba.PLLCTL=K===ib?v+524288>>>0:v,Ja=131072,v=ba.PLLCTL&Ja,v=ba.PLLCTL-v,ba.PLLCTL="1"===qa?v+131072>>>0:v):"NUC505(PLL)"===Oa?(qa=pa[a].childNodes[1].innerText,ha=pa[a].childNodes[2].innerText,K=pa[a].childNodes[3].innerText,ia=pa[a].childNodes[4].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xXXXX"!==ha&&(v=ba[V]&Math.pow(2,16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16)),Ja=65536,v=ba[V]&Ja,v=ba[V]-v,ba[V]="1"===qa?v+65536>>>0:v):("M251"===Oa?(qa=pa[a].childNodes[1].innerText,ha=pa[a].childNodes[2].innerText,
K=pa[a].childNodes[3].innerText,ia=pa[a].childNodes[4].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xXXXX"!==ha&&(v=ba[V]&Math.pow(2,16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16)),Ja=1572864,v=ba[V]&Ja,v=ba[V]-v,0===K.indexOf(ib)?ba[V]=v+524288>>>0:0===K.indexOf("MIRC")?ba[V]=v+1572864>>>0:ba[V]=v):(qa=pa[a].childNodes[1].innerText,ha=pa[a].childNodes[2].innerText,K=pa[a].childNodes[3].innerText,ia=pa[a].childNodes[4].innerText,ia=1E6*parseFloat(ia.slicePriorToX("MHz")),"0xXXXX"!==ha&&
(v=ba[V]&Math.pow(2,16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16)),Ja=524288,v=ba[V]&Ja,v=ba[V]-v,0===K.indexOf(ib)?ba[V]=v+524288>>>0:ba[V]=v),Ja=131072,v=ba[V]&Ja,v=ba[V]-v,ba[V]="1"===qa?v+131072>>>0:v),Ec(),$("#"+Ya+"_span_showRealFreq").text(ia.toHzString()),$("label[for='radio_PD_enable']").click())}),ia=0,0!==c.length&&$("#PLLCTLtable tbody tr:eq(0) td:eq(0)").click(),$("#PLLCTLtable thead").each(function(){this.setAttribute("title",bb)})):($("#APLLCTLtable tbody").delegate("tr","click",
function(rc){$(eb.fnSettings().aoData).each(function(){$(this.nTr).removeClass("row_selected")});$(rc.target.parentNode).addClass("row_selected");pa=eb.fnGetNodes();a=0;for(d=pa.length;a<d;a++)$(pa[a]).hasClass("row_selected")&&(ha=pa[a].childNodes[1].innerText,K=pa[a].childNodes[2].innerText,Wa=pa[a].childNodes[3].innerText,Wa=1E6*parseFloat(Wa.slicePriorToX("MHz")),"0xXXXX"!==ha&&(v=ba[V]&Math.pow(2,16)-1,v=ba[V]-v,ba[V]=v+parseInt(ha.slice(2),16)),Ec(),$("#APLL_span_showRealFreq").text(Wa.toHzString()),
$("label[for='radio_APD_enable']").click())}),Wa=0,0!==c.length&&$("#APLLCTLtable tbody tr:eq(0) td:eq(0)").click(),$("#APLLCTLtable thead").each(function(){this.setAttribute("title",bb)}));eb.$("td").tooltip({delay:0,track:!0,fade:0})}};var Wb=function(sa){!t(Ua)||12!==parseInt($("#"+Ua+"_input").val(),10)&&24!==parseInt($("#"+Ua+"_input").val(),10)?($("#PLL2_span_showRealFreq").text(""),Ib=cb=0):(240<sa?L=240:0>sa?L=0:(H=Math.floor(240/sa-1),W=Math.ceil(240/sa-1),E=240/(H+1),w=240/(W+1),Math.abs(sa-
E)>Math.abs(sa-w)?(q=W,L=w):(q=H,L=E)),L=1E6*parseFloat(L),$("#PLL2_span_showRealFreq").text(L.toHzString()),ya("PLL2DIV",q),cb=1E6*parseFloat($("#PLL2_span_showRealFreq").text()),Ib=48E7)};var lc=function(){var sa,ta=!1;if(tc)tc=!1;else if("undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&t("PLL2CKEN")&&t(Ua)&&12!==parseInt($("#"+Ua+"_input").val(),10)&&24!==parseInt($("#"+Ua+"_input").val(),10))Rb("\u5173\u65bcPLL2\uff0c\u53ef\u63a5\u53d7\u7684HXT\u9891\u7387\u4e3a12MHz\u548c24MHz\u3002\u5426\u5219\uff0c\u5b9e\u9645\u8f93\u51fa\u7684PLL2\u9891\u7387\u4f1a\u662f\u542b\u7cca\u4e0d\u6e05\u7684\u3002",
"\u95dc\u65bcPLL2\uff0c\u53ef\u63a5\u53d7\u7684HXT\u983b\u7387\u70ba12MHz\u548c24MHz\u3002\u5426\u5247\uff0c\u5be6\u969b\u8f38\u51fa\u7684PLL2\u983b\u7387\u6703\u662f\u542b\u7cca\u4e0d\u6e05\u7684\u3002","For PLL2, the acceptable frequencies of HXT are 12MHz and 24MHz, or the clock of PLL2 would be ambiguous.");else if("undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&t("PLL2CKEN")&&!t(Ua))Rb("\u8bf7\u542f\u7528HXT\uff0c\u5426\u5219PLL2\u53caPLL480M\u5c06\u4e0d\u80fd\u5de5\u4f5c\u6b63\u5e38\u3002",
"\u8acb\u555f\u7528HXT\uff0c\u5426\u5247PLL2\u53caPLL480M\u5c07\u4e0d\u80fd\u5de5\u4f5c\u6b63\u5e38\u3002","Please enable HXT, or PLL2 and PLL480M cannot work properly.");else if(t(xa)||t(hb)||t("HIRC1EN")||t("HIRC48EN")||t("MIRCEN")||t("MIRC1P2MEN")||t(Ua)||t(oc)||t("LIRC32KEN")||t("PLL2CKEN")){if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(vb)){var Ea=0;for(sa=NUTOOL_CLOCK.g_CLKSEL[vb].length;Ea<sa;Ea++){switch(NUTOOL_CLOCK.g_CLKSEL[vb][Ea].slicePriorToX(":").slicePriorToX("/").toString()){case $b:t(Ua)&&
(ta=!0);break;case "LXT":if(t(oc)||t("LIRC32KEN"))ta=!0;break;case Ya:(!t("PD")||t("PLLEN"))&&0<ia&&(ta=!0);break;case "PLL2":t("PLL2CKEN")&&0<cb&&(ta=!0);break;case ib:if(t(hb)||t("HIRC1EN"))ta=!0;break;case "LIRC":t(xa)&&(ta=!0);break;default:case "MIRC":t("MIRCEN")&&(ta=!0);break;case "MIRC1P2M":t("MIRC1P2MEN")&&(ta=!0);break;case "HIRC48":t("HIRC48EN")&&(ta=!0)}if(ta)break}}ta?"none"!==$("#add-tab-2").css("display")&&($("#tab-3")[0]||Sb(),$("#add-tab-2").hide(),gb<$("#tabs").tabs("option","active")+
1&&(gb=$("#tabs").tabs("option","active")+1)):-1!==T.indexOf("Simplified")?Da("\u8bf7\u81f3\u5c11\u4e3a"+sHCLK+"\u542f\u7528\u4e00\u4e2a\u65f6\u8109\u6e90\u3002"):-1!==T.indexOf("Traditional")?Da("\u8acb\u81f3\u5c11\u70ba"+sHCLK+"\u555f\u7528\u4e00\u500b\u6642\u8108\u6e90\u3002"):Da("Please enable at least one clock source for "+sHCLK+".")}else-1!==T.indexOf("Simplified")?Da("\u8bf7\u81f3\u5c11\u542f\u7528\u4e00\u4e2a\u65f6\u8109\u6e90\u3002"):-1!==T.indexOf("Traditional")?Da("\u8acb\u81f3\u5c11\u555f\u7528\u4e00\u500b\u6642\u8108\u6e90\u3002"):
Da("Please enable at least one clock source.")};cc();$("#tab-3")[0]?($("<li id='li-2'><a href='#tab-2'><span id=pll_clocks_span>"+Ya+"</span></a></li>").insertBefore("#li-3"),$("<div id='tab-2'></div>").insertBefore("#tab-3")):($("#tabs ul").append("<li id='li-2'><a href='#tab-2'><span id=pll_clocks_span>"+Ya+"</span></a></li>"),e.append("<div id='tab-2'></div>"));var Ra=$("#tab-2");ya("PD",1);ya("OE",1);ya("PLLEN",0);0!==Qa&&0!==pb?kc(Ra,"PD",Ya,"","MHz ("+Qa.toHzString().slicePriorToX("MHz")+"~"+
pb.toHzString()+")",!1,!0):kc(Ra,"PD",Ya,"","MHz",!1,!0);"undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&(ya("PLL2CKEN",0),kc(Ra,"PLL2CKEN","PLL2","","MHz",!1,!1),$("#PD_div")[0]&&$("#PLL2CKEN_div").css("border-top","8px solid black"));"undefined"!==typeof NUTOOL_CLOCK.g_register_map.APLLCTL&&(ya("APD",0),kc(Ra,"APD","APLL","","MHz",!1,!0),$("#PD_div")[0]&&$("#APD_div").css("border-top","8px solid black"));-1!==T.indexOf("Simplified")?Ra[0].appendChild(zb("button","add-tab-2","\u4e0b\u4e00\u6b65")):
-1!==T.indexOf("Traditional")?Ra[0].appendChild(zb("button","add-tab-2","\u4e0b\u4e00\u6b65")):Ra[0].appendChild(zb("button","add-tab-2","Next Step"));$("#add-tab-2").addClass("css_btn_class");Hb.addEvent($("#add-tab-2")[0],"click",lc);e.tabs("refresh");e.tabs({active:1});"none"!==$("#clockRegsTree").css("display")?e.css("width",mb-ab-8+"px"):e.css("width",mb-8+"px");e.css("height",Xb-8+"px");$("#tab-2").css("height",Xb-8+"px");$(".cb-enable").click(function(){k=this.htmlFor;if(-1!==k.indexOf("PD")||
-1!==k.indexOf("PLL2CKEN")){f=$(this).parents(".switch");$(".cb-disable",f).removeClass("selected");$(this).addClass("selected");$(".checkbox",f).attr("checked",!0);if(-1!==k.indexOf("PLL2CKEN"))if(ya("PLL2CKEN",1),0===cb&&t(Ua)&&(12===parseInt($("#"+Ua+"_input").val(),10)||24===parseInt($("#"+Ua+"_input").val(),10)))$("#PLL2CKEN_input").change();else{if(!t(Ua)||12!==parseInt($("#"+Ua+"_input").val(),10)&&24!==parseInt($("#"+Ua+"_input").val(),10))Rb("\u5173\u65bcPLL2\uff0c\u53ef\u63a5\u53d7\u7684HXT\u9891\u7387\u4e3a12MHz\u548c24MHz\u3002\u5426\u5219\uff0c\u5b9e\u9645\u8f93\u51fa\u7684PLL2\u9891\u7387\u4f1a\u662f\u542b\u7cca\u4e0d\u6e05\u7684\u3002",
"\u95dc\u65bcPLL2\uff0c\u53ef\u63a5\u53d7\u7684HXT\u983b\u7387\u70ba12MHz\u548c24MHz\u3002\u5426\u5247\uff0c\u5be6\u969b\u8f38\u51fa\u7684PLL2\u983b\u7387\u6703\u662f\u542b\u7cca\u4e0d\u6e05\u7684\u3002","For PLL2, the acceptable frequencies of HXT are 12MHz and 24MHz, or the clock of PLL2 would be ambiguous."),$("#PLL2CKEN_input").change()}else-1!==k.indexOf("APD")?(0===Wa&&$("#APD_input").change(),ya("APD",0)):(0===ia&&$("#PD_input").change(),ya("PD",0),ya("OE",0),ya("PLLEN",1));k=k.sliceBetweenXandX("radio_",
"_enable");-1!==k.indexOf("APD")?$(".APLL_"+k+"_p").css("color","black"):$(".PLL_"+k+"_p").css("color","black");sc()}});$(".cb-disable").click(function(){k=this.htmlFor;if(-1!==k.indexOf("PD")||-1!==k.indexOf("PLL2CKEN"))f=$(this).parents(".switch"),$(".cb-enable",f).removeClass("selected"),$(this).addClass("selected"),$(".checkbox",f).attr("checked",!1),-1!==k.indexOf("PLL2CKEN")?(ya("PLL2CKEN",0),Ib=cb=0,$("#PLL2_span_showRealFreq").text("")):-1!==k.indexOf("APD")?(ya("APD",1),$("#APLLCTLtable").dataTable().fnDestroy(),
$("#APLL_tableWrapper").remove(),$("#APLL_span_showRealFreq").text(""),Wa=0):(ya("PD",1),ya("OE",1),ya("PLLEN",0),$("#PLLCTLtable").dataTable().fnDestroy(),$("#PLL_tableWrapper").remove(),$("#"+Ya+"_span_showRealFreq").text(""),ia=0),k=k.sliceBetweenXandX("radio_","_disable"),-1!==k.indexOf("APD")?$(".APLL_"+k+"_p").css("color","#BC8484"):$(".PLL_"+k+"_p").css("color","#BC8484"),sc()});$("#PD_input").change(function(){"undefined"!==typeof this.value&&""!==this.value&&/^\d*\.?\d*$/.test(this.value)?
va(this.value,!1,$("#"+Ya+"_inaccuracy_select").val(),$a):-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):Da("The inputted content is incorrect. Please try again.")});$("#PLL2CKEN_input").change(function(){"undefined"!==typeof this.value&&""!==this.value&&0<parseInt(this.value,
10)&&/^\d*\.?\d*$/.test(this.value)?(Wb(this.value),""!==$("#PLL2_span_showRealFreq").text()?$("label[for='radio_PLL2CKEN_enable']").click():$("label[for='radio_PLL2CKEN_disable']").click()):($("#PLL2CKEN_input").val(""),$("label[for='radio_PLL2CKEN_disable']").click(),-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):
Da("The inputted content is incorrect. Please try again."))});$("#APD_input").change(function(){"undefined"!==typeof this.value&&""!==this.value&&/^\d*\.?\d*$/.test(this.value)?va(this.value,!1,$("#APLL_inaccuracy_select").val(),"APLLCTL"):-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):
Da("The inputted content is incorrect. Please try again.")});(t(Ua)||t(hb)||t("HIRC1EN")||t("HIRC48EN")||t("MIRCEN"))&&(0<ia||0<Wa||1===gb||"undefined"!==typeof NUTOOL_PER)?(1===gb&&0===ia&&(ia=g),1===gb&&0===Wa&&(Wa=D),0<ia&&($("#PD_input").val(ia/1E6),va(ia/1E6,!0,$("#"+Ya+"_inaccuracy_select").val(),$a)),0<Wa&&($("#APD_input").val(Wa/1E6),va(Wa/1E6,!0,$("#APLL_inaccuracy_select").val(),"APLLCTL"))):Wa=ia=0;t(Ua)&&("12"===$("#"+Ua+"_input").val()||"24"===$("#"+Ua+"_input").val())&&(0<cb||1===gb)?
(1===gb&&0===cb&&(cb=m),$("#PLL2CKEN_input").val(cb/1E6),$("#PLL2CKEN_input").change()):Ib=cb=0;"single"!==b&&2<gb&&(t(xa)||t(hb)||t("HIRC1EN")||t("HIRC48EN")||t("MIRCEN")||t("MIRC1P2MEN")||t(Ua)||t(oc)||t("LIRC32KEN")||t("PLL2CKEN"))&&lc();$("#tab-3")[0]&&$("#add-tab-2").hide()}function nd(b){var a,d,e,h=$("#tabs"),f,g,m;var D="";var k="HXT".toEquivalent().toString(),L="HXTWAIT".toEquivalent().toString();var H="HIRC".toEquivalent().toString();var W="PWRCON".toEquivalent().toString(),E="OSC10K_EN".toEquivalent().toString(),
w="OSC22M_EN".toEquivalent().toString(),q="XTL32K_EN".toEquivalent().toString(),A="XTL12M_EN".toEquivalent().toString(),R=!1,S=!1,c=!1,na=!1,u=!1;D=function(wa,C,B,N,U,ra,Ia){"input"===ra?f=Ia?"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+
C+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><input id='"+C+"_input' title='Input the expected value' type='text' value='"+N+"' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+"</p></div><br />":"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+
C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable selected'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><input id='"+C+"_input' title='Input the expected value' type='text' value='"+N+"' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+"</p></div><br />":"input_select"===
ra?f=Ia?"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><input id='"+
C+"_input' title='Input the expected value' type='text' value='"+N+"' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+" <span class=wait_span>Wait</span>:</p><select id='"+C+"_select' title='Select the expected value' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'><span class=cycles_span>cycles</span></p></div><br />":"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+
C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable selected'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><input id='"+C+"_input' title='Input the expected value' type='text' value='"+N+"' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+" <span class=wait_span>Wait</span>:</p><select id='"+
C+"_select' title='Select the expected value' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'><span class=cycles_span>cycles</span></p></div><br />":"select"===ra?f=Ia?"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+
C+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><select id='"+C+"_select' title='Select the expected value' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+"</p></div><br />":"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+
C+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable selected'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": </p><select id='"+C+"_select' title='Select the expected value' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>"+U+"</p></div><br />":"text"===ra?f=Ia?"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+
C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable selected'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable'><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": "+N+U+"</p></div><br />":"<br /><div id='ref_"+C+"_div'><p class='field switch div_clock_composite'><input type='radio' id='radio_"+
C+"_enable' name='field' checked/><input type='radio' id='radio_"+C+"_disable' name='field'/><label for='radio_"+C+"_enable' class='cb-enable'><span class=enable_span>Enable</span></label><label for='radio_"+C+"_disable' class='cb-disable' selected><span class=disable_span>Disable</span></label></p><p style='text-indent: 1em;' class = 'ref_"+C+"_p div_clock_composite'>"+B+": "+N+U+"</p></div><br />":"alwaysEnabled"===ra?f="<br /><div id='ref_"+C+"_div'><p class = 'ref_"+C+"_p div_clock_composite'>"+
B+": "+N+U+"</p></div><br />":"RTC32k"===ra&&(f="<br /><div id='ref_"+C+"_div'><p class = 'ref_"+C+"_p div_clock_composite'>"+B+"(from </p><select id='"+C+"_select' title='Select a clock source' class = 'div_clock_composite'/><p class = 'ref_"+C+"_p div_clock_composite'>): 32.768"+U+"</p></div><br />");wa.append(f)};var n=function(){if(tc)tc=!1;else if(t(E)||t(w)||t("HIRC1EN")||t("HIRC48EN")||t("MIRCEN")||t("MIRC1P2MEN")||t(A)||t(q)||t("LIRC32KEN")){if("none"!==$("#add-tab-1").css("display")){$("#tab-2")[0]||
"undefined"===typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?$("#tab-3")[0]||Sb():yc();gb<$("#tabs").tabs("option","active")+1&&(gb=$("#tabs").tabs("option","active")+1);$("#add-tab-1").hide();t(E)&&(Kb=NUTOOL_CLOCK.g_LIRCfrequency);if(t(w)||t("HIRC1EN"))Lb=NUTOOL_CLOCK.g_HIRCfrequency;t("HIRC48EN")&&(Mb=NUTOOL_CLOCK.g_HIRC48frequency);t("MIRCEN")&&(Nb=NUTOOL_CLOCK.g_MIRCfrequency);t("MIRC1P2MEN")&&(Ob=NUTOOL_CLOCK.g_MIRC1P2Mfrequency);t(q)&&(sb=32768);t("LIRC32KEN")&&(sb=32E3);t(A)&&
(fb=1E6*parseFloat($("#"+A+"_input").val()));0!==NUTOOL_CLOCK.g_RTC32kfrequency&&(Pb=NUTOOL_CLOCK.g_RTC32kfrequency)}}else-1!==T.indexOf("Simplified")?Da("\u8bf7\u81f3\u5c11\u542f\u7528\u4e00\u4e2a\u65f6\u8109\u6e90\u3002"):-1!==T.indexOf("Traditional")?Da("\u8acb\u81f3\u5c11\u555f\u7528\u4e00\u500b\u6642\u8108\u6e90\u3002"):Da("Please enable at least one clock source.")};var M=function(){var wa=Ab(NUTOOL_CLOCK.g_CLKSEL);if(t(q)){var C="LXT";var B=k}else C=k,B="LXT";O=0;for(a=wa.length;O<a;O+=1)for(d=
0,e=NUTOOL_CLOCK.g_CLKSEL[wa[O]].length;d<e;d+=1)-1!==NUTOOL_CLOCK.g_CLKSEL[wa[O]][d].indexOf(B)&&(-1!==NUTOOL_CLOCK.g_CLKSEL[wa[O]][d].indexOf("HXTorLXT")?NUTOOL_CLOCK.g_CLKSEL[wa[O]][d]=NUTOOL_CLOCK.g_CLKSEL[wa[O]][d].replace("HXTorLXT",C):NUTOOL_CLOCK.g_CLKSEL[wa[O]][d]=NUTOOL_CLOCK.g_CLKSEL[wa[O]][d].replace(B,C))};var F=function(){t(q)?NUTOOL_CLOCK.g_Module.RTC[0]="LXT":NUTOOL_CLOCK.g_Module.RTC[0]="LIRC"};cc();h[0].setAttribute("style","width:"+(mb-ab-8)+"px; height:"+(Xb-8)+"px; border: 1px solid white; position:absolute; left:"+
(ab+8)+"px; top:0px;");$("#tab-2")[0]||$("#tab-3")[0]?"undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?($("<li id='li-1'><a href='#tab-1'>Base Clocks</a></li>").insertBefore("#li-2"),$("<div id='tab-1'></div>").insertBefore("#tab-2")):($("<li id='li-1'><a href='#tab-1'>Base Clocks</a></li>").insertBefore("#li-3"),$("<div id='tab-1'></div>").insertBefore("#tab-3")):($("#tabs ul").append("<li id='li-1'><a href='#tab-1'><span id=base_clocks_span>Base Clocks</span></a></li>"),
$("#tabs").append("<div id='tab-1'></div>"));var ka=$("#tab-1");0!==NUTOOL_CLOCK.g_LIRCfrequency&&(0!==_.filter(NUTOOL_CLOCK.g_register_map[W],function(wa){return-1!==wa.indexOf(E+":")}).length?D(ka,E,"LIRC",NUTOOL_CLOCK.g_LIRCfrequency/1E3,"kHz","text",!0):D(ka,E,"LIRC",NUTOOL_CLOCK.g_LIRCfrequency/1E3,"kHz","alwaysEnabled",!0));if(0!==NUTOOL_CLOCK.g_HIRCfrequency)if(0===NUTOOL_CLOCK.g_HIRCfrequencyArray.length)0!==_.filter(NUTOOL_CLOCK.g_register_map[W],function(wa){return-1!==wa.indexOf(w+":")}).length?
D(ka,w,H,NUTOOL_CLOCK.g_HIRCfrequency/1E6,"MHz","text",!0):D(ka,w,H,NUTOOL_CLOCK.g_HIRCfrequency/1E6,"MHz","alwaysEnabled",!0);else{NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("HIRCSEL")?(D(ka,w,"HIRC0",0,"MHz","select",!0),D(ka,"HIRC1EN","HIRC1",36,"MHz","text",!0)):D(ka,w,H,0,"MHz","select",!0);var O=0;for(a=NUTOOL_CLOCK.g_HIRCfrequencyArray.length;O<a;O+=1){H=window.document.createElement("option");try{H.id=H.innerHTML=H.value=NUTOOL_CLOCK.g_HIRCfrequencyArray[O]/1E6}catch(wa){}$("#"+w+"_select")[0].appendChild(H)}t("HIRC_FSEL")?
$("#"+w+"_select").val(16):$("#"+w+"_select").val(12);$("#"+w+"_select").on("change",function(){"16"===$(this).val()?ya("HIRC_FSEL",1):ya("HIRC_FSEL",0);t(w)&&(NUTOOL_CLOCK.g_HIRCfrequency=parseInt(1E6*$(this).val(),10),sc())})}0!==NUTOOL_CLOCK.g_HIRC48frequency&&D(ka,"HIRC48EN","HIRC48",NUTOOL_CLOCK.g_HIRC48frequency/1E6,"MHz","text",!0);0!==NUTOOL_CLOCK.g_MIRCfrequency&&D(ka,"MIRCEN","MIRC",NUTOOL_CLOCK.g_MIRCfrequency/1E6,"MHz","text",!0);0!==NUTOOL_CLOCK.g_MIRC1P2Mfrequency&&(0!==_.filter(NUTOOL_CLOCK.g_register_map[W],
function(wa){return-1!==wa.indexOf("MIRC1P2MEN:")}).length?D(ka,"MIRC1P2MEN","MIRC1P2M",NUTOOL_CLOCK.g_MIRC1P2Mfrequency/1E6,"MHz","text",!0):D(ka,"MIRC1P2MEN","MIRC1P2M",NUTOOL_CLOCK.g_MIRC1P2Mfrequency/1E6,"MHz","alwaysEnabled",!0));0!==_.filter(NUTOOL_CLOCK.g_register_map[W],function(wa){return-1!==wa.indexOf(q+":")}).length&&D(ka,q,"LXT","32.768","kHz","text",!0);-1!==X("LIRC32KEN")&&D(ka,"LIRC32KEN","LIRC32K","32","kHz","text",!0);if(0!==NUTOOL_CLOCK.g_RTC32kfrequency){D(ka,"RTC32kEN","RTC32k",
NUTOOL_CLOCK.g_RTC32kfrequency/1E3,"kHz","RTC32k",!0);H=window.document.createElement("option");try{H.id=H.innerHTML=H.value="LXT"}catch(wa){}$("#RTC32kEN_select")[0].appendChild(H);H=window.document.createElement("option");try{H.id=H.innerHTML=H.value="LIRC"}catch(wa){}$("#RTC32kEN_select")[0].appendChild(H);t("RTCSEL")?$("#RTC32kEN_select").val("LIRC"):$("#RTC32kEN_select").val("LXT");$("#RTC32kEN_select").on("change",function(){"LIRC"===$(this).val()?ya("RTCSEL",1):ya("RTCSEL",0)})}if(0!==_.filter(NUTOOL_CLOCK.g_register_map[W],
function(wa){return-1!==wa.indexOf(A+":")}).length)if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(L)){0<fb?D(ka,A,k,fb/1E6,"MHz ("+NUTOOL_CLOCK.g_HXTRange+")","input_select",!0):D(ka,A,k,NUTOOL_CLOCK.g_HXTfrequency/1E6,"MHz ("+NUTOOL_CLOCK.g_HXTRange+")","input_select",!0);O=0;for(a=NUTOOL_CLOCK.g_CLKSEL[L].length;O<a;O+=1){H=window.document.createElement("option");try{H.id=H.innerHTML=H.value=NUTOOL_CLOCK.g_CLKSEL[L][O].slicePriorToX(":")}catch(wa){}$("#"+A+"_select")[0].appendChild(H)}D=X(L).toString();
O=0;for(a=NUTOOL_CLOCK.g_CLKSEL[L].length;O<a;O++)NUTOOL_CLOCK.g_CLKSEL[L][O].sliceAfterX(":")===D&&$("#"+A+"_select").val(NUTOOL_CLOCK.g_CLKSEL[L][O].slicePriorToX(":"));$("#"+A+"_select").on("change",function(){O=0;for(a=NUTOOL_CLOCK.g_CLKSEL[L].length;O<a;O++)NUTOOL_CLOCK.g_CLKSEL[L][O].slicePriorToX(":")===$(this).val()&&ya(L,NUTOOL_CLOCK.g_CLKSEL[L][O].sliceAfterX(":"))})}else 0<fb?D(ka,A,k,fb/1E6,"MHz ("+NUTOOL_CLOCK.g_HXTRange+")","input",!0):D(ka,A,k,NUTOOL_CLOCK.g_HXTfrequency/1E6,"MHz ("+
NUTOOL_CLOCK.g_HXTRange+")","input",!0);ka.append("<br />");-1!==T.indexOf("Simplified")?ka[0].appendChild(zb("button","add-tab-1","\u4e0b\u4e00\u6b65")):-1!==T.indexOf("Traditional")?ka[0].appendChild(zb("button","add-tab-1","\u4e0b\u4e00\u6b65")):ka[0].appendChild(zb("button","add-tab-1","Next Step"));$("#add-tab-1").addClass("css_btn_class");Hb.addEvent($("#add-tab-1")[0],"click",n);h.tabs({heightStyle:"auto"});h.tabs("refresh");h.tabs({activate:function(){Pc();null===Ha?$("#searchModule").hide():
"none"!==$("#clockRegsTree").css("display")&&$("#searchModule").show()}});$(".cb-enable").click(function(){m=this.htmlFor;g=$(this).parents(".switch");$(".cb-disable",g).removeClass("selected");$(this).addClass("selected");$(".checkbox",g).attr("checked",!0);""===$("#"+A+"_input").val()&&$("#"+A+"_input").val(NUTOOL_CLOCK.g_HXTfrequency/1E6);m=m.sliceBetweenXandX("radio_","_enable");$(".ref_"+m+"_p").css("color","black");ya(m,1);R?(0===m.indexOf(A)?(g=$("label[for='radio_"+q+"_disable']").parents(".switch"),
$(".cb-enable",g).removeClass("selected"),$("label[for='radio_"+q+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_"+q+"_p").css("color","#BC8484"),ya(q,0)):0===m.indexOf(q)&&(g=$("label[for='radio_"+A+"_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),$("label[for='radio_"+A+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_"+A+"_p").css("color","#BC8484"),ya(A,0)),M()):S?0===m.indexOf(w)?(g=$("label[for='radio_HIRC1EN_disable']").parents(".switch"),
$(".cb-enable",g).removeClass("selected"),$("label[for='radio_HIRC1EN_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_HIRC1EN_p").css("color","#BC8484"),ya("HIRC1EN",0),ya("HIRCSEL",0),t("HIRC_FSEL")?NUTOOL_CLOCK.g_HIRCfrequency=16E6:NUTOOL_CLOCK.g_HIRCfrequency=12E6):0===m.indexOf("HIRC1EN")&&(g=$("label[for='radio_"+w+"_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),$("label[for='radio_"+w+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",
!1),$(".ref_"+w+"_p").css("color","#BC8484"),ya(w,0),ya("HIRCSEL",1),NUTOOL_CLOCK.g_HIRCfrequency=36E6):c&&0===m.indexOf(q)?F():na?0===m.indexOf(A)?(g=$("label[for='radio_"+q+"_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),$("label[for='radio_"+q+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_"+q+"_p").css("color","#BC8484"),ya(q,0)):0===m.indexOf(q)&&(g=$("label[for='radio_"+A+"_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),
$("label[for='radio_"+A+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_"+A+"_p").css("color","#BC8484"),ya(A,0)):u&&(0===m.indexOf(q)?(g=$("label[for='radio_LIRC32KEN_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),$("label[for='radio_LIRC32KEN_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_LIRC32KEN_p").css("color","#BC8484"),ya("LIRC32KEN",0),ya("C32KS",0)):0===m.indexOf("LIRC32KEN")&&(g=$("label[for='radio_"+
q+"_disable']").parents(".switch"),$(".cb-enable",g).removeClass("selected"),$("label[for='radio_"+q+"_disable']").addClass("selected"),$(".checkbox",g).attr("checked",!1),$(".ref_"+q+"_p").css("color","#BC8484"),ya(q,0),ya("C32KS",1)));sc()});$(".cb-disable").click(function(){m=this.htmlFor;g=$(this).parents(".switch");$(".cb-enable",g).removeClass("selected");$(this).addClass("selected");$(".checkbox",g).attr("checked",!1);m=m.sliceBetweenXandX("radio_","_disable");$(".ref_"+m+"_p").css("color",
"#BC8484");ya(m,0);c&&0===m.indexOf(q)&&F();sc()});$("#"+A+"_input").change(function(){"undefined"===typeof this.value||""===this.value||!/^\d+$/.test(this.value)||parseInt(this.value,10)<parseInt(NUTOOL_CLOCK.g_HXTRange.slicePriorToX("~").slicePriorToX("MHz"),10)||parseInt(this.value,10)>parseInt(NUTOOL_CLOCK.g_HXTRange.sliceAfterX("~").slicePriorToX("MHz"),10)?($("#"+A+"_input").val(NUTOOL_CLOCK.g_HXTfrequency/1E6),-1!==T.indexOf("Simplified")?Da("\u6240\u8f93\u5165\u7684\u5185\u5bb9\u662f\u4e0d\u6b63\u786e\u7684\u3002\u5b83\u5e94\u4e3a"+
NUTOOL_CLOCK.g_HXTRange+"\u3002\u8bf7\u518d\u8bd5\u4e00\u6b21\u3002"):-1!==T.indexOf("Traditional")?Da("\u6240\u8f38\u5165\u7684\u5167\u5bb9\u662f\u4e0d\u6b63\u78ba\u7684\u3002\u5b83\u61c9\u70ba"+NUTOOL_CLOCK.g_HXTRange+"\u3002\u8acb\u518d\u8a66\u4e00\u6b21\u3002"):Da("The inputted content is incorrect. It should be "+NUTOOL_CLOCK.g_HXTRange+". Please try again.")):t(A)&&(fb=1E6*parseFloat($("#"+A+"_input").val()),sc())});-1!==T.indexOf("Simplified")?($("#base_clocks_span").text("\u57fa\u7840\u65f6\u8109\u6e90"),
$(".enable_span").text("\u542f\u7528"),$(".disable_span").text("\u505c\u7528"),$(".wait_span").text("\u7b49\u5f85"),$(".cycles_span").text("\u5468\u671f"),$("[title]").prop("title","\u8f93\u5165\u671f\u671b\u503c")):-1!==T.indexOf("Traditional")?($("#base_clocks_span").text("\u57fa\u790e\u6642\u8108\u6e90"),$(".enable_span").text("\u555f\u7528"),$(".disable_span").text("\u505c\u7528"),$(".wait_span").text("\u7b49\u5f85"),$(".cycles_span").text("\u9031\u671f"),$("[title]").prop("title","\u8f38\u5165\u671f\u671b\u503c")):
($("#base_clocks_span").text("Base Clocks"),$(".enable_span").text("Enable"),$(".disable_span").text("Disable"),$(".wait_span").text("Wait"),$(".cycles_span").text("cycles"),$("[title]").prop("title","Input the expected value"));$("#"+A+"_input").width(85);if("MINI51AN"===p||"MINI51DE"===p||"MINI55"===p||"MINI57"===p||"MINI58"===p||"NM1200"===p||"NUC029AE"===p)Fc=R=!0,M();else if("NANO103"===p)S=!0,Fc=!1;else if("NUC400"===p)c=!0,Fc=!1,F();else{if("NUC121AE"===p)na=!0;else if("M2351"===p||"M2354"===
p||"M261"===p)u=!0;Fc=!1}"single"!==b&&1<gb&&n();($("#tab-2")[0]||$("#tab-3")[0])&&$("#add-tab-1").hide();t(E)?$("label[for='radio_"+E+"_enable']").click():$("label[for='radio_"+E+"_disable']").click();t(w)?$("label[for='radio_"+w+"_enable']").click():$("label[for='radio_"+w+"_disable']").click();t("HIRC1EN")?$("label[for='radio_HIRC1EN_enable']").click():$("label[for='radio_HIRC1EN_disable']").click();t("HIRC48EN")?$("label[for='radio_HIRC48EN_enable']").click():$("label[for='radio_HIRC48EN_disable']").click();
t("MIRCEN")?$("label[for='radio_MIRCEN_enable']").click():$("label[for='radio_MIRCEN_disable']").click();t("MIRC1P2MEN")?$("label[for='radio_MIRC1P2MEN_enable']").click():$("label[for='radio_MIRC1P2MEN_disable']").click();t(q)?$("label[for='radio_"+q+"_enable']").click():$("label[for='radio_"+q+"_disable']").click();t("LIRC32KEN")?$("label[for='radio_LIRC32KEN_enable']").click():$("label[for='radio_LIRC32KEN_disable']").click();t(A)?$("label[for='radio_"+A+"_enable']").click():$("label[for='radio_"+
A+"_disable']").click()}function Sd(){var b=$("#ChipTypeSelect");var a=$("#ChipType_span");var d=$("#MCU_span");$("#ChipType")[0].setAttribute("style","background-color: #FFFFFF; width:"+(ab-16)+"px; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");$("#MCU")[0].setAttribute("style","background-color: #FFFFFF; width:"+(ab-16)+"px; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");$("#ChipType").hover(function(){$(this).css("background-color","#FAFAFA")},function(){$(this).css("background-color",
"#FFFFFF")});$("#MCU").hover(function(){$(this).css("background-color","#FAFAFA")},function(){$(this).css("background-color","#FFFFFF")});-1!==T.indexOf("Simplified")?(a.text("\u6676\u7247\u7cfb\u5217:"),d.text("\u578b\u53f7:")):-1!==T.indexOf("Traditional")?(a.text("\u6676\u7247\u7cfb\u5217:"),d.text("\u578b\u865f:")):(a.text("Chip Series:"),d.text("Part No.:"));a.css("font-size","16px");a.css("font-weight","bold");d.css("font-size","16px");d.css("font-weight","bold");a=0;for(d=od.length;a<d;a+=
1){var e=window.document.createElement("option");try{e.id=e.innerHTML=e.value=od[a]}catch(h){}b[0].appendChild(e)}b.val(pd(p));qd();b.on("change",function(){if(p!=$(this).val()){var h="NUC_"+p+"_Content.js";var f=$(this).val();var g=f;"NUC200"===f?g="NUC200AN":"NANO100"===f?g="NANO100AN":"NUC100"===f?g="NUC100DN":"M030G"===f?g="M030G_31G":"M031"===f?g="M031BT":"M051"===f?g="M051DE":"MINI51"===f?g="MINI55":"NUC029"===f?g="NUC029AE":"M480"===f?g="M480MD":"KM1M7"===f&&(g="KM1M7AF");p=g;f="NUC_"+p+"_Content.js";
bc(h,f,"js");qd()}})}function qd(){var b,a=$("#MCUselect"),d={},e=[],h=!1;0<a.children().length&&a.children().remove();var f=0;for(b=NUTOOL_CLOCK.g_cfg_chips.length;f<b;f+=1)try{e.push(NUTOOL_CLOCK.g_cfg_chips[f].name+"("+NUTOOL_CLOCK.g_cfg_chips[f].pkg+")")}catch(g){}e.sort(Gd);f=0;for(b=e.length;f<b;f+=1)d=window.document.createElement("option"),d.id=d.innerHTML=d.value=e[f],a[0].appendChild(d);f=0;for(b=NUTOOL_CLOCK.g_cfg_chips.length;f<b;f+=1)if(NUTOOL_CLOCK.g_cfg_chips[f].name+"("+NUTOOL_CLOCK.g_cfg_chips[f].pkg+
")"===kb){h=!0;break}h?a.val(kb):a.val($("#MCUselect option:first-child").val()).change();a.on("change",function(){gc!==$(this).val()&&(gc=$(this).val(),window.setTimeout(Td,0))})}function Hd(){var b,a="",d=[],e=[],h=Ab(NUTOOL_CLOCK.g_Module).slice(),f={},g=$("#rootTree_Clock"),m=$("#clockRegsTree");a="HXT".toEquivalent().toString();var D="PLL".toEquivalent().toString();var k="HIRC".toEquivalent().toString();var L="HCLK".toEquivalent().toString();var H="PCLK".toEquivalent().toString(),W="PWRCON".toEquivalent().toString(),
E="XTL32K_EN".toEquivalent().toString(),w="XTL12M_EN".toEquivalent().toString(),q="PCLK0SEL".toEquivalent().toString();h.push(L);"CPUCLK"!==L&&h.push("CPUCLK");0!==NUTOOL_CLOCK.g_LIRCfrequency&&h.push("LIRC");0!==NUTOOL_CLOCK.g_HIRCfrequency&&h.push(k);0!==NUTOOL_CLOCK.g_HIRC48frequency&&h.push("HIRC48");0!==NUTOOL_CLOCK.g_MIRCfrequency&&h.push("MIRC");0!==NUTOOL_CLOCK.g_MIRC1P2Mfrequency&&h.push("MIRC1P2M");0!==NUTOOL_CLOCK.g_RTC32kfrequency&&h.push("RTC32k");0!==_.filter(NUTOOL_CLOCK.g_register_map[W],
function(S){return-1!==S.indexOf(E+":")}).length&&h.push("LXT");0!==_.filter(NUTOOL_CLOCK.g_register_map[W],function(S){return-1!==S.indexOf(w+":")}).length&&h.push(a);"undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]&&h.push(D);"undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&h.push("PLL2");0!==NUTOOL_CLOCK.g_PLL480Mfrequency&&h.push("PLL480M");"undefined"!==typeof NUTOOL_CLOCK.g_register_map.APLLCTL&&h.push("APLL");0!==NUTOOL_CLOCK.g_HSUSBOTGPHYfrequency&&h.push("HSUSB_OTG_PHY");
NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(q)?(h.push("PCLK0"),h.push("PCLK1")):h.push(H);h.sort();var A=0;for(b=Z.length;A<b;A+=1)e[A]=Z[A];e.sort();A=0;for(b=e.length;A<b;A+=1)e[A].length>hc&&(hc=e[A].length);ab=250;10*(hc+1+2+8)+50>ab&&(ab=10*(hc+1+2+8)+40,$("#ChipType").width(ab-16),$("#MCU").width(ab-16));A=0;for(b=e.length;A<b;A+=1){a=e[A];if(a.length<hc)for(k=0,L=hc-a.length;k<L;k+=1)a+=rd;k={};L={};L.id=e[A];k.data=a+":0x"+Sa(ba[e[A]]).toUpperCase();k.attr=L;d[A]=k}L={id:"clock_tree"};Qc();f.data=
"Simplified Chinese"===T?"Clock\u5bc4\u5b58\u5668":"Traditional Chinese"===T?"Clock\u6682\u5b58\u5668":"Clock Registers";f.attr=L;f.state="open";f.children=d;0===m.length&&(g[0].appendChild(zb("div","clockRegsTree","Loading...")),m=$("#clockRegsTree"));m[0].setAttribute("style","background-color: #FFFFFF; float:left; width:"+(ab-16)+"px; height: "+20*e.length+"px; border-right: 16px solid #F2F2F2; border-bottom: 5px solid #F2F2F2;");m.hover(function(){$(this).css("background-color","#FAFAFA")},function(){$(this).css("background-color",
"#FFFFFF")});m.jstree({json_data:{data:f},themes:{theme:"default",icons:!1,dots:!0},core:{animation:0},plugins:["themes","json_data","ui","crrm"]}).bind("hover_node.jstree",function(S,c){S=c.rslt.obj.attr("id");NUTOOL_CLOCK.g_register_map_description.hasOwnProperty(S)&&(c="Simplified Chinese"===T?"\u4f4d\u5740: ":"Traditional Chinese"===T?"\u4f4d\u5740: ":"Address: ",c+=NUTOOL_CLOCK.g_register_map_description[S],$("#"+S).simpletip({fixed:!0,offset:[80,-10]}),$("#"+S).eq(0).simpletip().update(c))}).bind("dblclick.jstree",
function(S){S=$(S.target).closest("li")[0].id;"clock_tree"!==S&&-1===NUTOOL_CLOCK.g_register_map_description[S].indexOf("Read Only")&&(m.jstree("rename",$("#"+S)),$("#"+S).eq(0).simpletip().blockShow(),$("#"+S).eq(0).simpletip().hide())}).bind("rename.jstree",function(S,c){S=c.rslt.obj.attr("id");var na=c.rslt.old_name;c=c.rslt.new_name;if(-1!==c.indexOf(D))-1!==T.indexOf("Simplified")?Da("\u82e5\u8981\u8bbe\u7f6e"+D+"\uff0c\u8bf7\u81f3"+D+"\u9875\u9762\u3002"):-1!==T.indexOf("Traditional")?Da("\u82e5\u8981\u8a2d\u7f6e"+
D+"\uff0c\u8acb\u81f3"+D+"\u9801\u9762\u3002"):Da("To configure "+D+", please refer to the "+D+" page."),m.jstree("rename_node",$("#"+S),na);else if(-1!==c.indexOf(":0x")&&c.slicePriorToX(":")===na.slicePriorToX(":")&&c.sliceAfterX(":").length===na.sliceAfterX(":").length&&c!==na){ba[S]=parseInt(c.sliceAfterX(":"),16);Pc();try{window.external.saveNu_configFromJS()}catch(u){}NUTOOL_CLOCK.g_readConfigFilePath="";uc();sd();Jb=!0;Gc();Jb=!1}else m.jstree("rename_node",$("#"+S),na)}).bind("loaded.jstree",
function(){Rc();Ec();td=!0;"undefined"!==typeof NUTOOL_PER&&(Sc=!0)}).bind("destroy.jstree",function(){});m.css("font-size","16px");m.css("font-family",'Monaco, Consolas, "Lucida Console", monospace;');d="Simplified Chinese"===T?"\u641c\u5bfb\u6a21\u5757":"Traditional Chinese"===T?"\u641c\u5c0b\u6a21\u7d44":"Search Module";g[0].appendChild(zb("div","searchModule",""));var R=$("#searchModule");R.append("<span id=searchModule_span></span>");g=$("#searchModule_span");g.css("font-size","16px");g.css("font-weight",
"bold");R.append("<input id='searchInput' type='text' value=''>");e=$("#searchInput");R[0].setAttribute("style","background-color: #FFFFFF; border-right: 16px solid #F2F2F2; float:left; width:"+(ab-16)+"px; height: 22px;");g.text(d);e[0].setAttribute("style","font-family:Times Arial; position:absolute; left:"+(g.width()+10)+"px; width:"+(ab-16-g.width()-10)+"px; height: 16px;");e.change(function(){null!==Ha&&(Ha.selectAll("g.node").on("searchFromInput")(this.value),$("#tabs").tabs({active:3}),3!==
$("#tabs").tabs("option","active")&&$("#tabs").tabs({active:2}));var S=$(this).val();R.simpletip({fixed:!0,offset:[100,-7]});var c="";if(""!==S){var na=[];A=0;for(b=h.length;A<b;A+=1)0===h[A].toLowerCase().indexOf(S.toLowerCase())&&na.push(h[A]);if(0<na.length)for(c="Simplified Chinese"===T?"\u7b26\u5408\u7684\u641c\u5bfb\u7ed3\u679c\u4e3a:<br />":"Traditional Chinese"===T?"\u7b26\u5408\u7684\u641c\u5c0b\u7d50\u679c\u70ba:<br />":"The matched search result is:<br />",A=0,b=na.length;A<b;A+=1)c=c+
na[A]+"<br />"}""!==c?(R.eq(0).simpletip().unblockShow(),R.eq(0).simpletip().update(c),R.eq(0).simpletip().show()):(R.eq(0).simpletip().blockShow(),R.eq(0).simpletip().hide())});R.hide()}function bc(b,a,d){var e="js"===d?"src":"css"===d?"href":"none",h=window.document.getElementsByTagName("js"===d?"script":"css"===d?"link":"none");"undefined"!==typeof NUTOOL_PER&&"js"===d&&(b="ClockConfigure/"+b,a="ClockConfigure/"+a);var f=a;if("js"===d){var g=window.document.createElement("script");g.setAttribute("type",
"text/javascript");g.setAttribute("src",f)}else"css"===d&&(g=window.document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("href",f));f=g;for(d=h.length;0<=d;--d)h[d]&&null!==h[d].getAttribute(e)&&(h[d].getAttribute(e)===b?h[d].parentNode.removeChild(h[d]):h[d].getAttribute(e)===a&&h[d].parentNode.removeChild(h[d]));h[0].parentNode.appendChild(f)}function Td(){if(gc!==kb){try{window.external.updateCurrentDialogSize()}catch(a){}var b=p;p=
Jc(gc);bc("NUC_"+b+"_Content.js","NUC_"+p+"_Content.js","js");kb=gc;uc();NUTOOL_CLOCK.g_readConfigFilePath="dummyPath";Tc();Gc()}}function pd(b){var a=b;"NUC200AN"===b?a="NUC200":"NUC200AE"===b?a="NUC200":"NUC2201"===b?a="NUC200":"NANO100AN"===b?a="NANO100":"NANO100BN"===b?a="NANO100":"NANO103"===b?a="NANO100":"NANO112"===b?a="NANO100":"NUC100AN"===b?a="NUC100":"NUC100BN"===b?a="NUC100":"NUC100CN"===b?a="NUC100":"NUC100DN"===b?a="NUC100":"NUC131"===b?a="NUC100":"NUC121AE"===b?a="NUC100":"NUC123AN_AE"===
b?a="NUC100":"NUC122AN"===b?a="NUC100":0===b.indexOf("NUC126")?a="NUC100":"M051BN"===b?a="M051":0===b.indexOf("M030G")?a="M030G":0===b.indexOf("M03")?a="M031":"M051DN"===b?a="M051":"M051DE"===b?a="M051":"M051AN"===b?a="M051":"M058S"===b?a="M051":0===b.indexOf("MINI5")?a="MINI51":0===b.indexOf("NUC029")?a="NUC029":0===b.indexOf("M235")?a="M2351":0===b.indexOf("M25")?a="M251":0===b.indexOf("M480")?a="M480":0===b.indexOf("KM1M7")&&(a="KM1M7");return a}function fc(b){var a,d="HXT".toEquivalent().toString(),
e="PLL".toEquivalent().toString(),h="HIRC".toEquivalent().toString(),f="HCLK".toEquivalent().toString(),g="PCLK".toEquivalent().toString();if(-1!==b.indexOf("DIV")){var m=b.sliceAfterX("(");m=m.slicePriorToX(":").slicePriorToX("+");m=X(m)+1}else m=-1!==b.indexOf("/")?parseInt(b.sliceAfterX("/"),10):1;0===b.indexOf("LIRC")?a=Kb/m:0===b.indexOf("HIRC48")?a=Mb/m:0===b.indexOf(h)?a=Lb/m:0===b.indexOf("MIRC1P2M")?a=Ob/m:0===b.indexOf("MIRC")?a=Nb/m:0===b.indexOf("LXT")?a=sb/m:0===b.indexOf(d)?a=fb/m:0===
b.indexOf("RTC32k")?a=Pb/m:0===b.indexOf("PLL480M")?a=Ib/m:0===b.indexOf("PLL2")?a=cb/m:0===b.indexOf(e)?a=ia/m:0===b.indexOf("APLL")?a=Wa/m:0===b.indexOf("HSUSB_OTG_PHY")?a=Yb/m:0===b.indexOf(f)?a=tb/m:0===b.indexOf("PCLK0")?a=Cb/m:0===b.indexOf("PCLK1")?a=Fb/m:0===b.indexOf(g)?a=Eb/m:0===b.indexOf("CPUCLK")&&(a=tb/m);return a}function Tc(b){var a,d,e,h={},f=Ab(NUTOOL_CLOCK.g_CLKSEL),g="XTL32K_EN".toEquivalent().toString(),m="XTL12M_EN".toEquivalent().toString(),D="PWRCON".toEquivalent().toString(),
k="PLLCON".toEquivalent().toString(),L="HXT".toEquivalent().toString(),H="PLL".toEquivalent().toString();if("undefined"!==typeof NUTOOL_CLOCK.g_unusedModule){"undefined"!==typeof NUTOOL_CLOCK.g_unusedModule[kb]?h="function"==typeof NUTOOL_CLOCK.g_unusedModule[kb]?NUTOOL_CLOCK.g_unusedModule[kb]():NUTOOL_CLOCK.g_unusedModule[kb]:"undefined"!==typeof NUTOOL_CLOCK.g_unusedModule[kb.slicePriorToX("(")]&&(h="function"==typeof NUTOOL_CLOCK.g_unusedModule[kb.slicePriorToX("(")]?NUTOOL_CLOCK.g_unusedModule[kb.slicePriorToX("(")]():
NUTOOL_CLOCK.g_unusedModule[kb.slicePriorToX("(")]);var W=Ab(NUTOOL_CLOCK.g_Module);var E=0;for(e=h.length;E<e;E+=1){var w=h[E];var q=0;for(a=W.length;q<a;q+=1)if(w.toUpperCase()===W[q].toUpperCase()){delete NUTOOL_CLOCK.g_Module[w];break}if("LXT"===w.toUpperCase()){q=0;for(a=NUTOOL_CLOCK.g_register_map[D].length;q<a;q+=1)if(0===NUTOOL_CLOCK.g_register_map[D][q].indexOf(g+":")){NUTOOL_CLOCK.g_register_map[D].splice(q,1);break}a=0;for(d=f.length;a<d;a+=1)for(q=NUTOOL_CLOCK.g_CLKSEL[f[a]].length-1;0<=
q;--q)0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf("LXT:")&&0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf("LXT/")||NUTOOL_CLOCK.g_CLKSEL[f[a]].splice(q,1)}if(w.toUpperCase()===L.toUpperCase()){q=0;for(a=NUTOOL_CLOCK.g_register_map[D].length;q<a;q+=1)if(0===NUTOOL_CLOCK.g_register_map[D][q].indexOf(m+":")){NUTOOL_CLOCK.g_register_map[D].splice(q,1);break}a=0;for(d=f.length;a<d;a+=1)for(q=NUTOOL_CLOCK.g_CLKSEL[f[a]].length-1;0<=q;--q)0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf(L+":")&&0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf(L+
"/")||NUTOOL_CLOCK.g_CLKSEL[f[a]].splice(q,1)}if(w.toUpperCase()===H.toUpperCase())for(delete NUTOOL_CLOCK.g_register_map[k],delete NUTOOL_CLOCK.g_register_map_default[k],delete NUTOOL_CLOCK.g_register_map_description[k],a=0,d=f.length;a<d;a+=1)for(q=NUTOOL_CLOCK.g_CLKSEL[f[a]].length-1;0<=q;--q)0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf(H+":")&&0!==NUTOOL_CLOCK.g_CLKSEL[f[a]][q].indexOf(H+"/")||NUTOOL_CLOCK.g_CLKSEL[f[a]].splice(q,1)}}Z=Ab(NUTOOL_CLOCK.g_register_map_default);a=0;for(d=Z.length;a<
d;a+=1)"undefined"===typeof NUTOOL_PER&&!0===ud&&"undefined"!==typeof NUTOOL_CLOCK.g_register_map_default[Z[a]].NuClockConfig?NUTOOL_CLOCK.g_register_map_default[Z[a]]=NUTOOL_CLOCK.g_register_map_default[Z[a]].NuClockConfig:"undefined"===typeof NUTOOL_PER&&!1===ud&&"undefined"!==typeof NUTOOL_CLOCK.g_register_map_default[Z[a]].NuClockConfigTest?NUTOOL_CLOCK.g_register_map_default[Z[a]]=NUTOOL_CLOCK.g_register_map_default[Z[a]].NuClockConfigTest:"undefined"!==typeof NUTOOL_PER&&!1===NUTOOL_PER.getg_bDevelopingTool()&&
"undefined"!==typeof NUTOOL_CLOCK.g_register_map_default[Z[a]].NuCodeGenTool?NUTOOL_CLOCK.g_register_map_default[Z[a]]=NUTOOL_CLOCK.g_register_map_default[Z[a]].NuCodeGenTool:"undefined"!==typeof NUTOOL_PER&&!0===NUTOOL_PER.getg_bDevelopingTool()&&"undefined"!==typeof NUTOOL_CLOCK.g_register_map_default[Z[a]].NuCodeGenTest&&(NUTOOL_CLOCK.g_register_map_default[Z[a]]=NUTOOL_CLOCK.g_register_map_default[Z[a]].NuCodeGenTest);if("undefined"!==typeof b&&0<Ab(b).length)for(a=0,d=Z.length;a<d;a+=1)ba[Z[a]]=
b[Z[a]];else for(a=0,d=Z.length;a<d;a+=1)ba[Z[a]]=parseInt(NUTOOL_CLOCK.g_register_map_default[Z[a]],16)}function Jc(b){-1===b.indexOf("(")&&(b+="(");return 0===b.indexOf("M0564")?"M0564":0===b.indexOf("M45")||0===b.indexOf("M4TK")?"M451":0===b.indexOf("M48")?-1!==b.indexOf("8AE")||-1!==b.indexOf("CAE")?"M480LD":"M480MD":0===b.indexOf("KM1M7AF")?"KM1M7AF":0===b.indexOf("KM1M7BF")?"KM1M7BF":0===b.indexOf("M251")||0===b.indexOf("M252")?"M251":0===b.indexOf("M253")?"M253":0===b.indexOf("M254")||0===
b.indexOf("M256")||0===b.indexOf("M258")?"M258":0===b.indexOf("M030G")||0===b.indexOf("M031G")?"M030G_31G":0===b.indexOf("M031BT")?"M031BT":0===b.indexOf("M031")||0===b.indexOf("M032")?"M031":0===b.indexOf("M2351")?"M2351":0===b.indexOf("M2354")?"M2354":0===b.indexOf("M26")?"M261":0===b.indexOf("M0518")?"M0518":0===b.indexOf("M0519")?"M0519":0===b.indexOf("M05")&&-1!==b.indexOf("DN(")?"M051DN":0===b.indexOf("M05")&&-1!==b.indexOf("DE(")?"M051DE":0===b.indexOf("MHC54ZDN")||0===b.indexOf("PL054TDN")?
"M051DN":0===b.indexOf("M05")&&-1!==b.indexOf("BN(")?"M051BN":0===b.indexOf("E32")?"M051BN":0===b.indexOf("M058S")?"M058S":0===b.indexOf("M05")&&-1!==b.indexOf("AN(")?"M051AN":0===b.indexOf("MINI57")?"MINI57":0===b.indexOf("MINI58")?"MINI58":0===b.indexOf("MINI5")&&-1!==b.indexOf("AN(")?"MINI51AN":0===b.indexOf("MINI5")&&-1!==b.indexOf("AE(")||0===b.indexOf("MINI54XFHC")||0===b.indexOf("MINI55")||0===b.indexOf("NVS06AL")?"MINI55":0===b.indexOf("MINI5")&&-1!==b.indexOf("DE(")||0===b.indexOf("MINI54FHC")?
"MINI51DE":0===b.indexOf("NUC2201")?"NUC2201":0===b.indexOf("NUC2")&&-1!==b.indexOf("AN(")?"NUC200AN":0===b.indexOf("NUC2")&&-1!==b.indexOf("AE(")?"NUC200AE":0===b.indexOf("NUC029ZAN")?"NUC029ZAN":0===b.indexOf("NUC029LDE")||0===b.indexOf("NUC029SDE")?"NUC029xDE":0===b.indexOf("NUC029LGE")||0===b.indexOf("NUC029SGE")||0===b.indexOf("NUC029KGE")?"NUC029xGE":0===b.indexOf("NUC029LEE")||0===b.indexOf("NUC029SEE")?"NUC029xEE":0===b.indexOf("NUC029TAE")?"NUC029TAE":0===b.indexOf("NUC029")&&-1!==b.indexOf("AE(")?
"NUC029AE":0===b.indexOf("NUC029")&&-1!==b.indexOf("AN(")?"NUC029AN":0!==b.indexOf("NANO120")&&0!==b.indexOf("NANO100")||-1===b.indexOf("AN(")?0!==b.indexOf("NANO100")&&0!==b.indexOf("NANO110")&&0!==b.indexOf("NANO120")&&0!==b.indexOf("NANO130")||-1===b.indexOf("BN(")?0===b.indexOf("NANO103")&&-1!==b.indexOf("AE(")?"NANO103":0===b.indexOf("NANO1")&&-1!==b.indexOf("AN(")?"NANO112":0===b.indexOf("NM11")||0===b.indexOf("NM12")?"NM1200":0===b.indexOf("NM15")?"NM1500":0===b.indexOf("NUC121")||0===b.indexOf("NUC125")?
"NUC121AE":0===b.indexOf("NUC122")&&-1!==b.indexOf("AN(")?"NUC122AN":0!==b.indexOf("NUC123")||-1===b.indexOf("AE0(")&&-1===b.indexOf("AE1(")&&-1===b.indexOf("AN0(")&&-1===b.indexOf("AN1(")?0===b.indexOf("NUC1")&&-1!==b.indexOf("AN(")?"NUC100AN":0===b.indexOf("NUC1")&&-1!==b.indexOf("BN(")?"NUC100BN":0===b.indexOf("NUC1")&&-1!==b.indexOf("CN(")?"NUC100CN":0===b.indexOf("NUC1")&&-1!==b.indexOf("DN(")?"NUC100DN":0===b.indexOf("NUC1261")?"NUC1261":0===b.indexOf("NUC1262")?"NUC1262":0===b.indexOf("NUC126")?
"NUC126":0===b.indexOf("NUC13")?"NUC131":0===b.indexOf("NUC505")?"NUC505":0===b.indexOf("I91")?"ISD9100":0===b.indexOf("I93")?"ISD9300":"NUC400":"NUC123AN_AE":"NANO100BN":"NANO100AN"}function sd(){var b="",a=b="",d="",e=[],h=[];b=[];h=0;var f="",g="",m="",D="",k="",L="",H="";H=H="";var W=function(){E="NUC_"+p+"_Content.js";"undefined"===typeof NUTOOL_PER?(p="NUC400",kb="NUC472VI8AE(LQFP100)"):(p="M251",kb="M251EB2AE(TSSOP28)");d=Jc(kb);w="NUC_"+d+"_Content.js";bc(E,w,"js");Tc()};b=""===NUTOOL_CLOCK.g_readConfigFilePath?
"Nu_config.cfg ":"file:///"+NUTOOL_CLOCK.g_readConfigFilePath;b=$.ajax({url:b,async:!1}).responseText;if(!b||/^\s*$/.test(b))return W(),!1;for(;-1!==b.indexOf("\r")&&b.indexOf("\r")<b.indexOf("MCU:");)b=b.sliceAfterX("\r");a=b.sliceBetweenXandX("MCU:","\r");d=Jc(a);if(-1===$.inArray(pd(d),od))return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u6676\u7247\u578b\u53f7 "+d+" \u4e0d\u6b63\u786e\u3002","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u6676\u7247\u578b\u865f "+d+" \u4e0d\u6b63\u78ba\u3002",
"The chip type of "+d+" read from the config file is incorrect."),W(),!1;var E="undefined"!==typeof p&&""!==p?"NUC_"+p+"_Content.js":"undefined"===typeof NUTOOL_PER?"NUC_NUC400_Content.js":"NUC_M251_Content.js";var w="NUC_"+d+"_Content.js";for(bc(E,w,"js");-1!==b.indexOf("Reg:");){b=b.sliceAfterX("Reg:");H=b.sliceBetweenXandX("0x","\r");if(!/^[0-9A-Fa-f]+$/.test(H)||8!==H.length)return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u6682\u5b58\u5668"+b.slicePriorToX(" = ")+"\u7684\u503c"+H+"\u662f\u4e0d\u6b63\u786e\u7684\u3002",
"\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u66ab\u5b58\u5668"+b.slicePriorToX(" = ")+"\u7684\u503c"+H+"\u662f\u4e0d\u6b63\u78ba\u7684\u3002","The value "+H+" of "+b.slicePriorToX(" = ")+" read from the config file is incorrect."),W(),!1;e[b.slicePriorToX(" = ")]=parseInt(H,16);b=b.slice(1);if(20<h)break;else h+=1}if(-1!==b.indexOf("LXT:")&&(b=b.sliceAfterX("LXT:"),f=b.slicePriorToX("\r"),"32768"!==f&&"32000"!==f))return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684LXT\u9891\u7387\u662f\u4e0d\u6b63\u786e\u7684\u3002",
"\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684LXT\u983b\u7387\u662f\u4e0d\u6b63\u78ba\u7684\u3002","The frequency of LXT read from the config file is incorrect."),W(),!1;H="HXT".toEquivalent().toString();if(-1!==b.indexOf(H+":")&&(b=b.sliceAfterX(H+":"),g=b.slicePriorToX("\r"),parseInt(g,10)<1E6*parseInt(NUTOOL_CLOCK.g_HXTRange.slicePriorToX("~").slicePriorToX("MHz"),10)||parseInt(g,10)>1E6*parseInt(NUTOOL_CLOCK.g_HXTRange.sliceAfterX("~").slicePriorToX("MHz"),10)))return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684"+
H+"\u9891\u7387\u662f\u4e0d\u6b63\u786e\u7684\u3002","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684"+H+"\u983b\u7387\u662f\u4e0d\u6b63\u78ba\u7684\u3002","The frequency of "+H+" read from the config file is incorrect."),W(),!1;H="PLL".toEquivalent().toString();-1!==b.indexOf(H+":")&&(b=b.sliceAfterX(H+":"),m=b.slicePriorToX("\r"));-1!==b.indexOf("PLL2:")&&(b=b.sliceAfterX("PLL2:"),D=b.slicePriorToX("\r"));-1!==b.indexOf("APLL:")&&(b=b.sliceAfterX("APLL:"),k=b.slicePriorToX("\r"));if(-1!==b.indexOf("Step:")&&
(b=b.sliceAfterX("Step:"),L=b.slicePriorToX("\r"),1>parseInt(L,10)||4<parseInt(L,10)))return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u6700\u5f8c\u6b65\u9aa4\u662f\u4e0d\u6b63\u786e\u7684\u3002","\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u6700\u5f8c\u6b65\u9a5f\u662f\u4e0d\u6b63\u78ba\u7684\u3002","The last step read from the config file is incorrect."),W(),!1;p=d;kb=a;Tc(e);h=Ab(e);h.sort();b=Ab(NUTOOL_CLOCK.g_register_map_default);b.sort();if(!b.compare(h))return Rb("\u4ece\u914d\u7f6e\u6863\u8bfb\u51fa\u7684\u65f6\u8109\u6682\u5b58\u5668\u91cc\u81f3\u5c11\u4e00\u4e2a\u662f\u4e0d\u6b63\u786e\u7684\u3002",
"\u5f9e\u914d\u7f6e\u6a94\u8b80\u51fa\u7684\u66ab\u5b58\u5668\u88e1\u81f3\u5c11\u4e00\u500b\u6642\u8108\u662f\u4e0d\u6b63\u78ba\u7684\u3002","At least one of the clock registers read from the config file is incorrect."),W(),!1;$("#ChipTypeSelect").val(pd(p));""!==f&&(sb=parseInt(f,10));""!==g&&(fb=parseInt(g,10));""!==m&&(ia=parseInt(m,10));""!==D&&(cb=parseInt(D,10));""!==k&&(Wa=parseInt(k,10));""!==L&&(gb=parseInt(L,10));Pc();return!1}function vd(){var b=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;
"undefined"!==typeof b&&-1!==b.indexOf("DialogSize:")?(b=b.sliceAfterX("DialogSize:X_"),mb=parseInt(b.slicePriorToX("Y_"),10),Xb=parseInt(b.sliceBetweenXandX("Y_","\r"),10)):(mb=1022,Xb=635);Nc=Xb-8}function lb(b){var a,d,e="";if(-1===b.indexOf("[")){var h=0;for(a=Z.length;h<a;h+=1){var f=Z[h];var g=0;for(d=NUTOOL_CLOCK.g_register_map[f].length;g<d;g+=1){var m=NUTOOL_CLOCK.g_register_map[f][g];if(-1!==m.indexOf(b)&&m.indexOf(":")===b.length){-1===m.indexOf("-")?e=f+"["+m.sliceAfterX(":")+"]":(g=m.sliceAfterX(":"),
e=f+"["+g.slicePriorToX("-")+":"+g.sliceAfterX("-")+"]");break}else if(-1!==m.indexOf(b.slice(1))&&m.indexOf(":")===b.length-1&&"!"===b[0]){-1===m.indexOf("-")?e="!"+f+"["+m.sliceAfterX(":")+"]":(g=m.sliceAfterX(":"),e="!"+f+"["+g.slicePriorToX("-")+":"+g.sliceAfterX("-")+"]");break}}}}else e=b;return e}function Dd(b){var a,d,e="HCLK".toEquivalent().toString(),h="PCLK".toEquivalent().toString(),f="";if("SYSTICK"!==b&&0!==b.indexOf("CLKO")&&0!==b.indexOf("CKO")){var g=NUTOOL_CLOCK.g_Module[b][1].slicePriorToX("/").toString();
var m=0;for(a=Z.length;m<a;m+=1){var D=Z[m];var k=0;for(d=NUTOOL_CLOCK.g_register_map[D].length;k<d;k+=1){var L=NUTOOL_CLOCK.g_register_map[D][k];if(-1!==L.indexOf(g)&&L.indexOf(":")===g.length){f=0===D.indexOf("AHB")?"("+e+"):"+tb.toHzString():-1!==$.inArray(b,NUTOOL_CLOCK.g_BusFromPCLK1)?"(PCLK1):"+Fb.toHzString():0!==Cb?"(PCLK0):"+Cb.toHzString():"("+h+"):"+Eb.toHzString();break}}if(""!==f)break}}else f="("+e+"):"+tb.toHzString();return f}function Ed(b){var a=!0,d="HCLK".toEquivalent().toString(),
e="PCLK".toEquivalent().toString();var h=NUTOOL_CLOCK.g_Module[b][0];b=NUTOOL_CLOCK.g_Module[b][2];h!==d&&h!==e&&"PCLK0"!==h&&"PCLK1"!==h||"none"!==b||(a=!1);return a}function Ec(){var b,a,d;var e=0;for(b=Z.length;e<b;e+=1){var h=d=Z[e];if(h.length<hc){var f=0;for(a=hc-h.length;f<a;f+=1)h+=rd}$("#clockRegsTree").jstree("rename_node",$("#"+d),h+":0x"+Sa(ba[d]).toUpperCase())}}function ya(b,a,d,e){var h,f;if(d){var g=0;for(f=NUTOOL_CLOCK.g_register_map[d].length;g<f;g+=1){var m=NUTOOL_CLOCK.g_register_map[d][g];
if(-1!==m.indexOf(b)&&m.indexOf(":")===b.length){-1===m.indexOf("-")?(g=parseInt(m.sliceAfterX(":"),10),m=1<<g>>>0):(g=parseInt(m.sliceAfterX("-"),10),m=parseInt(m.sliceBetweenXandX(":","-"),10)-g+1,m=Math.pow(2,m)-1<<g>>>0);m=(ba[d]&m)>>>0;m=ba[d]-m;a=a<<g>>>0;ba[d]=m+a;break}}}else for(d=0,h=Z.length;d<h;d+=1){var D=Z[d];g=0;for(f=NUTOOL_CLOCK.g_register_map[D].length;g<f;g+=1)if(m=NUTOOL_CLOCK.g_register_map[D][g],-1!==m.indexOf(b)&&m.indexOf(":")===b.length){-1===m.indexOf("-")?(g=parseInt(m.sliceAfterX(":"),
10),m=1<<g>>>0):(g=parseInt(m.sliceAfterX("-"),10),m=parseInt(m.sliceBetweenXandX(":","-"),10)-g+1,m=Math.pow(2,m)-1<<g>>>0);m=(ba[D]&m)>>>0;m=ba[D]-m;a=a<<g>>>0;ba[D]=m+a;break}}e||Ec()}function Id(){var b=!1;!1!==jQuery.support.leadingWhitespace&&(rd="\f",Hb.getContext=function(a){return a.getContext("2d")},Hb.removeContext=function(a){a.remove()},Hb.addEvent=function(a,d,e){"undefined"!==typeof a&&a.addEventListener(d,e,!1)},Hb.triggerEvent=function(a,d){"undefined"!==typeof $(a)[0]&&$(a).trigger(d)},
window.MSStream&&($("html").addClass("ie10+"),"undefined"===typeof NUTOOL_PER&&(bc("","tabulator/promise-polyfill.js","js"),bc("","tabulator/js/tabulator.js","js"),bc("","tabulator/css/tabulator.css","css"))),"undefined"===typeof NUTOOL_PER&&(bc("d3.js","d3.js","js"),bc("d3-tip.js","d3-tip.js","js")));if($("html").hasClass("ie8")||$("html").hasClass("ie7")||$("html").hasClass("ie6"))b=!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 b}function Ab(b){var a=[],d=0,e;for(e in b)b.hasOwnProperty(e)&&(a[d]=e,d+=1);return a}function cc(){$("#warningDialog").is(":visible")&&$("#warningDialog").dialog("destroy");$("#dividerConfigureDialog").is(":visible")&&$("#dividerConfigureDialog").dialog("destroy");$("#warningForSavingDialog").is(":visible")&&$("#warningForSavingDialog").dialog("destroy");
$("#languageDialog").is(":visible")&&$("#languageDialog").dialog("destroy");$("#clockConfigureErrorDialog").is(":visible")&&$("#clockConfigureErrorDialog").dialog("destroy");$("#generateCodeDialog").is(":visible")&&$("#generateCodeDialog").dialog("destroy")}function Jd(){$(window.document).mousedown(function(b){b=b||window.event;Kd=(b.target||b.srcElement).id;return this})}function zb(b,a,d,e){e?(e=window.document.createElement("input"),e.value=d,e.type=b):(e=window.document.createElement(b),e.innerHTML=
d);e.id=a;return e}function Gd(b,a){var d=0,e;var h=/(\d+)|(\D+)/g;var f=/\d/;if(isFinite(b)&&isFinite(a))return b-a;b=String(b).toLowerCase();a=String(a).toLowerCase();if(b===a)return 0;if(!f.test(b)||!f.test(a))return b>a?1:-1;b=b.match(h);a=a.match(h);for(e=b.length>a.length?a.length:b.length;d<e;)if(h=b[d],f=a[d],d+=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 b.length-a.length}function Sa(b,a){b=Number(b).toString(16);
for(a="undefined"===typeof a||null===a?a=8:a;b.length<a;)b="0"+b;return b}function md(b){return!isNaN(parseFloat(b))&&isFinite(b)}function Db(b,a,d,e){this.x1=b;this.y1=a;this.x2=d;this.y2=e}function Pc(){var b;Uc=[];var a=0;for(b=Z.length;a<b;a+=1)Uc[Z[a]]=ba[Z[a]];Vc=Kb;Wc=Lb;Xc=Mb;Yc=Nb;Zc=Ob;$c=sb;ad=fb;bd=ia;cd=cb;dd=Wa;ed=tb;fd=Eb;gd=Cb;hd=Fb}function uc(){ba=[];Z=[];Fb=Cb=Eb=tb=Yb=Wa=Ib=cb=ia=Pb=fb=sb=Ob=Nb=Mb=Lb=Kb=hc=0;Za=[];wb="";tc=!1;P="";gb=1;Ha=null;$("#tab-1").remove();$("#tab-2").remove();
$("#tab-3").remove();$("#tab-4").remove();$("#tabs > ul > li").remove();$("#clockRegsTree").jstree("destroy");$("#searchModule").jstree("destroy");$("#clockRegsTree").remove();$("#searchModule").remove();cc()}function Gc(){$("#ChipType").show();$("#MCU").show();"none"!==$("#clockRegsTree").css("display")?($("#tabs").css("width",mb-ab-8+"px"),$("#tabs").css({left:ab+8+"px"})):($("#tabs").css("width",mb-8+"px"),$("#tabs").css({left:"0px"}));"undefined"===typeof NUTOOL_PER&&qd();Hd();nd()}function sc(){var b,
a=!1,d=!1,e=$("#tabs").tabs("option","active");if(!Jb){Jb=!0;if(e+1<gb){var h=0;for(b=Z.length;h<b;h+=1)if(Uc[Z[h]]!==ba[Z[h]]){a=!0;break}0<Vc&&Vc!==Kb?d=!0:0<Wc&&Wc!==Lb?d=!0:0<Xc&&Xc!==Mb?d=!0:0<Yc&&Yc!==Nb?d=!0:0<Zc&&Zc!==Ob?d=!0:0<$c&&$c!==sb?d=!0:0<ad&&ad!==fb?d=!0:0<bd&&bd!==ia?d=!0:0<cd&&cd!==cb?d=!0:0<dd&&dd!==Wa?d=!0:0<ed&&ed!==tb?d=!0:0<fd&&fd!==Eb?d=!0:0<gd&&gd!==Cb?d=!0:0<hd&&hd!==Fb&&(d=!0);if(a||d)Sc?wd(e):Ud(function(){wd(e)},function(){Jb=!0;var f;var g=0;for(f=Z.length;g<f;g+=1)ba[Z[g]]=
Uc[Z[g]];Kb=Vc;Lb=Wc;Mb=Xc;Nb=Yc;Ob=Zc;sb=$c;fb=ad;ia=bd;cb=cd;Wa=dd;tb=ed;Eb=fd;Cb=gd;Fb=hd;$("#li-"+(e+1)).remove();$("#tab-"+(e+1)).remove();switch(e+1){case 1:$("#tab-1")[0]||nd("single");break;case 2:$("#tab-2")[0]||"undefined"===typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?$("#tab-3")[0]||Sb():yc();break;case 3:$("#tab-3")[0]||Sb("single")}$("#tabs").tabs({active:e});Jb=!1})}Jb=!1}}function wd(b){var a,d="HCLK".toEquivalent().toString(),e="OSC10K_EN".toEquivalent().toString(),
h="OSC22M_EN".toEquivalent().toString(),f="XTL32K_EN".toEquivalent().toString(),g="XTL12M_EN".toEquivalent().toString();Jb=!0;Pc();$("#tabs")[0].style.visibility="hidden";for(a=b+1+1;4>=a;a+=1)$("#li-"+a).remove(),$("#tab-"+a).remove();Bc=!0;switch(b+1){case 1:t(e)||t(h)||t("HIRC1EN")||t("HIRC48EN")||t("MIRCEN")||t("MIRC1P2MEN")||t(g)||t(f)||t("LIRC32KEN")?$("#tab-2")[0]||"undefined"===typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?$("#tab-3")[0]||Sb():yc():-1!==T.indexOf("Simplified")?
Da("\u8bf7\u81f3\u5c11\u542f\u7528\u4e00\u4e2a\u65f6\u8109\u6e90\u3002"):-1!==T.indexOf("Traditional")?Da("\u8acb\u81f3\u5c11\u555f\u7528\u4e00\u500b\u6642\u8108\u6e90\u3002"):Da("Please enable at least one clock source.");break;case 2:$("#tab-3")[0]||Sb();break;case 3:$("#tab-4")[0]||(a=md(NUTOOL_CLOCK.g_CPUCLKLimit)?NUTOOL_CLOCK.g_CPUCLKLimit:parseInt(NUTOOL_CLOCK.g_CPUCLKLimit[kb.slicePriorToX("(")],10),tb>a?-1!==T.indexOf("Simplified")?Da("CPU\u9891\u7387\u4e0a\u9650\u4e3a"+a.toHzString()+"\u3002 "+
d+"\u9891\u7387\u4e0d\u5e94\u8d85\u8fc7\u5176\u9650\u5236\u3002"):-1!==T.indexOf("Traditional")?Da("CPU\u983b\u7387\u4e0a\u9650\u70ba"+a.toHzString()+"\u3002 "+d+"\u983b\u7387\u4e0d\u61c9\u8d85\u904e\u5176\u9650\u5236\u3002"):Da("The upper limit of CPU frequency is "+a.toHzString()+". The "+d+" frequency should not run beyond the limit."):Xa())}Ec();Bc=!1;$("#tabs").tabs({active:b});Jb=!1;$("#tabs")[0].style.visibility="visible"}function id(b){var a="",d="HCLK".toEquivalent().toString(),e=!0;!t("CLKSRC")&&
$("#SYSTICK_span_showRealFreq").text().toFloat()>tb/2&&(e=!1,a="Simplified Chinese"===T?"SysTick\u7684\u65f6\u8109\u6e90\u9891\u7387\u5fc5\u9700\u5c0f\u65bc\u6216\u7b49\u65bc"+d+"/2\u3002":"Traditional Chinese"===T?"SysTick\u7684\u6642\u8108\u6e90\u983b\u7387\u5fc5\u9700\u5c0f\u65bc\u6216\u7b49\u65bc"+d+"/2\u3002":"The clock source of SysTick must be less than or equal to "+d+"/2.");e||b(a);return e}function Ud(b,a){if(-1!==T.indexOf("Simplified")){var d="\u8b66\u544a!";var e='\u8fd9\u6837\u7684\u6539\u53d8\u5c06\u4f1a\u5f71\u54cd\u4e4b\u524d\u7684\u8bbe\u5b9a\u3002\u8bf7\u95ee\u4f60\u8981\u7ee7\u7eed\u5b83\u5417?<br /><br /><label><input type="checkbox" id = "checkbox_skip"/>\u6682\u65f6\u7565\u8fc7\u8fd9\u4e2a\u8baf\u606f</label>';
var h="\u8981";var f="\u4e0d\u8981"}else-1!==T.indexOf("Traditional")?(d="\u8b66\u544a!",e='\u9019\u6a23\u7684\u6539\u8b8a\u5c07\u6703\u5f71\u97ff\u4e4b\u524d\u7684\u8a2d\u5b9a\u3002\u8acb\u554f\u4f60\u8981\u7e7c\u7e8c\u5b83\u55ce?<br /><br /><label><input type="checkbox" id = "checkbox_skip"/>\u66ab\u6642\u7565\u904e\u9019\u500b\u8a0a\u606f</label>',h="\u8981",f="\u4e0d\u8981"):(d="Warning!",e='The modification will influence the prior settings.<br />Would you like to continue it?<br /><br /><label><input type="checkbox" id = "checkbox_skip"/>Skip this message temporarily</label>',
h="Yes",f="No");$("#warningForSavingDialog").is(":visible")&&$("#warningForSavingDialog").dialog("destroy");$('<div id="warningForSavingDialog"><p>'+e+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!0,draggable:!1,resizable:!1,dialogClass:"no-close",title:d,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:h,click:function(){$("#checkbox_skip").is(":checked")&&(Sc=!0);b();$(this).is(":visible")&&$(this).dialog("destroy")}},{text:f,click:function(){$("#checkbox_skip").is(":checked")&&
(Sc=!0);a();$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})}function xd(b){if("Simplified Chinese"===T){var a="\u65f6\u8109\u8bbe\u7f6e\u9519\u8bef";var d="\u786e\u5b9a"}else"Traditional Chinese"===T?(a="\u6642\u8108\u8a2d\u7f6e\u932f\u8aa4",d="\u78ba\u5b9a"):(a="Clock Configure Error",d="Confirm");$("#clockConfigureErrorDialog").is(":visible")&&$("#clockConfigureErrorDialog").dialog("destroy");$('<div id="clockConfigureErrorDialog"><p>'+b+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:a,width:500,height:350,show:"fade",hide:"fade",buttons:[{text:d,click:function(){$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})}function Vd(b){var a,d;if("Simplified Chinese"===T){var e="\u65f6\u8109\u8bbe\u7f6e\u9519\u8bef";b+="<br /><br />\u82e5\u4f60\u4ecd\u60f3\u8981\u5173\u6389\u5e94\u7528\u7a0b\u5f0f\uff0c\u8bf7\u6309'\u5173\u95ed'\u3002\u4f46\u6240\u6709\u8bbe\u7f6e\u5c06\u4f1a\u56de\u590d\u5230\u521d\u59cb\u503c\u3002\u82e5\u4f60\u60f3\u8981\u4fee\u6b63\u4ed6\u4eec\uff0c\u8bf7\u6309'\u4fee\u6b63'\u3002";
var h="\u5173\u95ed";var f="\u4fee\u6b63"}else"Traditional Chinese"===T?(e="\u6642\u8108\u8a2d\u7f6e\u932f\u8aa4",b+="<br /><br />\u82e5\u4f60\u4ecd\u60f3\u8981\u95dc\u6389\u61c9\u7528\u7a0b\u5f0f\uff0c\u8acb\u6309'\u95dc\u9589'\u3002\u4f46\u6240\u6709\u8a2d\u7f6e\u5c07\u6703\u56de\u5fa9\u5230\u521d\u59cb\u503c\u3002\u82e5\u4f60\u60f3\u8981\u4fee\u6b63\u4ed6\u5011\uff0c\u8acb\u6309'\u4fee\u6b63'\u3002",h="\u95dc\u9589",f="\u4fee\u6b63"):(e="Clock Configure Error",b+="<br /><br />If you still want to close the application, please press Close. But all the configuration will be restored to the default.If you want to fix them, please press Fix.",
h="Close",f="Fix");$("#clockConfigureErrorDialog").is(":visible")&&$("#clockConfigureErrorDialog").dialog("destroy");$('<div id="clockConfigureErrorDialog"><p>'+b+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,resizable:!1,title:e,width:500,height:350,show:"fade",hide:"fade",buttons:[{text:h,click:function(){$(this).is(":visible")&&$(this).dialog("destroy");uc();NUTOOL_CLOCK.g_readConfigFilePath="dummyPath";Z=Ab(NUTOOL_CLOCK.g_register_map_default);
ba=[];a=0;for(d=Z.length;a<d;a+=1)ba[Z[a]]=parseInt(NUTOOL_CLOCK.g_register_map_default[Z[a]],16);try{window.external.closeFromJS()}catch(g){}}},{text:f,click:function(){$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})}function Rb(b,a,d){"Simplified Chinese"===T?window.alert(b):"Traditional Chinese"===T?window.alert(a):window.alert(d)}function jd(b){var a,d=!0;if("undefined"!==typeof NUTOOL_PER)b();else{var e=0;for(a=Z.length;e<a;e+=1)if(yd[Z[e]]!==
ba[Z[e]]){d=!1;break}if(d)b();else{if(-1!==T.indexOf("Simplified")){e="\u8b66\u544a!";a="\u914d\u7f6e\u6863\u5df2\u88ab\u4fee\u6539\u8fc7\u3002\u8bf7\u95ee\u4f60\u8981\u50a8\u5b58\u5b83\u5417?";d="\u8981";var h="\u4e0d\u8981"}else-1!==T.indexOf("Traditional")?(e="\u8b66\u544a!",a="\u914d\u7f6e\u6a94\u5df2\u88ab\u4fee\u6539\u904e\u3002\u8acb\u554f\u4f60\u8981\u5132\u5b58\u5b83\u55ce?",d="\u8981",h="\u4e0d\u8981"):(e="Warning!",a="The configuration has been modified.<br />Would you like to save it?",
d="Yes",h="No");$("#warningForSavingDialog").is(":visible")&&$("#warningForSavingDialog").dialog("destroy");$('<div id="warningForSavingDialog"><p>'+a+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!0,draggable:!1,resizable:!1,title:e,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:d,click:function(){if(id(xd))try{window.external.saveConfigFromJS("NUC_BROWSE_PROJECT_PATH")}catch(f){}b();$(this).is(":visible")&&$(this).dialog("destroy")}},
{text:h,click:function(){b();$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})}}}function Da(b){$("#warningDialog").is(":visible")&&$("#warningDialog").dialog("destroy");if(-1!==T.indexOf("Simplified")){var a="\u8b66\u544a!";var d="\u786e\u8ba4"}else-1!==T.indexOf("Traditional")?(a="\u8b66\u544a!",d="\u78ba\u8a8d"):(a="Warning!",d="Confirm");$('<div id="warningDialog"><p>'+b+'</p><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,
resizable:!1,title:a,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:d,click:function(){$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})}function t(b,a){var d;var e="OSC10K_EN".toEquivalent().toString();var h="OSC22M_EN".toEquivalent().toString();var f={};var g=0;var m=!1;f[e]=["M030G_31G"];f[h]=["KM1M7AF","KM1M7BF"];f.MIRC1P2MEN=["M258"];if("undefined"!==typeof f[b]&&-1!==f[b].indexOf(p))g=1;else if(a)for(f=0,d=NUTOOL_CLOCK.g_register_map[a].length;f<
d;f+=1){var D=NUTOOL_CLOCK.g_register_map[a][f];if(-1!==D.indexOf(b)&&D.indexOf(":")===b.length){g=parseInt(D.sliceAfterX(":"),10);g=1<<g>>>0;g=(ba[a]&g)>>>0;break}}else for(a=0,e=Z.length;a<e;a+=1)for(h=Z[a],f=0,d=NUTOOL_CLOCK.g_register_map[h].length;f<d;f+=1)if(D=NUTOOL_CLOCK.g_register_map[h][f],-1!==D.indexOf(b)&&D.indexOf(":")===b.length){g=parseInt(D.sliceAfterX(":"),10);g=1<<g>>>0;g=(ba[h]&g)>>>0;break}0!==g&&(m=!0);return m}function Dc(b){return 0!==b.indexOf("!")?t(b):!t(b.sliceAfterX("!"))}
function Ld(b){var a=window.document.createEvent("Event");a.initEvent("dblclick",!0,!0);"undefined"!==typeof b.id?d3.select("#"+b.id)[0][0].dispatchEvent(a):d3.select("#"+b)[0][0].dispatchEvent(a)}function X(b){var a,d,e=-1;var h=0;for(a=Z.length;h<a;h+=1){var f=Z[h];var g=0;for(d=NUTOOL_CLOCK.g_register_map[f].length;g<d;g+=1){var m=NUTOOL_CLOCK.g_register_map[f][g];if(-1!==m.indexOf(b)&&m.indexOf(":")===b.length){-1===m.indexOf("-")?(g=parseInt(m.sliceAfterX(":"),10),m=1<<g>>>0):(g=parseInt(m.sliceAfterX("-"),
10),m=parseInt(m.sliceBetweenXandX(":","-"),10)-g+1,m=Math.pow(2,m)-1<<g>>>0);e=(ba[f]&m)>>>0;e=e>>>g>>>0;break}}}return e}function Md(){var b,a=Ab(NUTOOL_CLOCK.g_Module);Bc=!0;var d=0;for(b=a.length;d<b;d+=1){var e=a[d];var h=NUTOOL_CLOCK.g_Module[e][1];var f=[];var g=0;if(-1!==h.indexOf("/"))for(;-1!==h.indexOf("/")&&!(f.push(h.slicePriorToX("/")),h=h.sliceAfterX("/"),g+=1,10<g););f.push(h);var m=!0;h=0;for(g=f.length;h<g;h+=1)if(!Dc(f[h])){m=!1;break}m&&Ld(e)}Ec();Bc=!1}function Qc(){var b=$.ajax({url:"NuToolSetup.txt",
async:!1}).responseText;"undefined"!==typeof b&&-1!==b.indexOf("UIlanguage:")?(T=b.sliceAfterX("UIlanguage:"),T=T.slicePriorToX("\r")):T="English"}function Kc(b){var a,d=Ab(NUTOOL_CLOCK.g_Module),e="HXT".toEquivalent().toString(),h="HXTWAIT".toEquivalent().toString(),f="PLL".toEquivalent().toString();var g="HIRC".toEquivalent().toString();var m="HCLK".toEquivalent().toString();var D="PCLK".toEquivalent().toString();var k="PWRCON".toEquivalent().toString(),L="PLLCON".toEquivalent().toString(),H="HCLK_S".toEquivalent().toString(),
W="PCLK_S".toEquivalent().toString(),E="PCLK0SEL".toEquivalent().toString(),w="PCLK1SEL".toEquivalent().toString(),q="HCLK_N".toEquivalent().toString(),A="PCLK_N".toEquivalent().toString(),R="OSC10K_EN".toEquivalent().toString(),S="OSC22M_EN".toEquivalent().toString(),c="XTL32K_EN".toEquivalent().toString(),na="XTL12M_EN".toEquivalent().toString(),u,n,M,F="",ka="",O="",wa="",C=[];var B=[];var N=[],U=[];"undefined"===typeof b&&(b="default");var ra=function(Pa,qa){return""===Pa?qa:Pa+("|"+qa)};var Ia=
function(){F="";"undefined"===typeof NUTOOL_PER&&(F+="    /* If the macros do not exist in your project, please refer to the related clk.h in Header folder of the tool package */\n");0===p.indexOf("M480")&&(F+="    /* Set XT1_OUT(PF.2) and XT1_IN(PF.3) to input mode */\n    PF->MODE &= ~(GPIO_MODE_MODE2_Msk | GPIO_MODE_MODE3_Msk);\n\n");if(-1!==X("HIRC1EN")||-1!==X("HIRC_FSEL"))F+="    /* Select clock source */\n",G=!1,-1!==X("HIRC_FSEL")&&t(S)&&(F="NANO112"===p?t("HIRC_FSEL")?F+"    CLK->PWRCTL = CLK->PWRCTL | CLK_PWRCTL_HIRC_FSEL_Msk;\n":
F+"    CLK->PWRCTL = CLK->PWRCTL & ~CLK_PWRCTL_HIRC_FSEL_Msk;\n":t("HIRC_FSEL")?F+"    CLK->PWRCTL = CLK->PWRCTL | CLK_PWRCTL_HIRC0FSEL_Msk;\n":F+"    CLK->PWRCTL = CLK->PWRCTL & ~CLK_PWRCTL_HIRC0FSEL_Msk;\n",G=!0),-1!==X("HIRC1EN")&&(t(S)||t("HIRC1EN"))&&(F=t(S)?F+"    CLK->CLKSEL0 = CLK->CLKSEL0 & ~CLK_CLKSEL0_HIRCSEL_Msk;\n":F+"    CLK->CLKSEL0 = CLK->CLKSEL0 | CLK_CLKSEL0_HIRCSEL_Msk;\n",G=!0),G&&(F+="\n");y=0;for(a=r.length;y<a;y+=1)x=vc(r[y]),pa=x.sliceAfterX("/"),x=x.slicePriorToX("/"),"RTC_LXTCTL"===
r[y]&&("M2354"===p?(t(c)&&(F+="    /* LXT source from external LXT */\n    CLK_EnableModuleClock(RTC_MODULE);\n    RTC->LXTCTL &= ~(RTC_LXTCTL_LIRC32KEN_Msk|RTC_LXTCTL_C32KSEL_Msk);\n    CLK_DisableModuleClock(RTC_MODULE);\n\n"),t("LIRC32KEN")&&(F+="    /* LXT source from LIRC32K */\n    CLK_EnableModuleClock(RTC_MODULE);\n    RTC->LXTCTL |= (RTC_LXTCTL_LIRC32KEN_Msk|RTC_LXTCTL_C32KSEL_Msk);\n    CLK_DisableModuleClock(RTC_MODULE);\n\n")):(t(c)&&(F+="    /* LXT source from external LXT */\n    CLK_EnableModuleClock(RTC_MODULE);\n    RTC->LXTCTL &= ~(RTC_LXTCTL_LIRC32KEN_Msk|RTC_LXTCTL_C32KS_Msk);\n    CLK_DisableModuleClock(RTC_MODULE);\n\n"),
t("LIRC32KEN")&&(F+="    /* LXT source from LIRC32K */\n    CLK_EnableModuleClock(RTC_MODULE);\n    RTC->LXTCTL |= (RTC_LXTCTL_LIRC32KEN_Msk|RTC_LXTCTL_C32KS_Msk);\n    CLK_DisableModuleClock(RTC_MODULE);\n\n"))),"RTC_CLKSRC"===r[y]&&(F=t("RTCSEL")?F+"    /* RTC32k source from internal */\n    RTC_SetClockSource(RTC_CLKSRC_INTERNAL);\n\n":F+"    /* RTC32k source from external */\n    RTC_SetClockSource(RTC_CLKSRC_EXTERNAL);\n\n"),r[y]===k&&(O=ka="",t(R)&&("undefined"!==typeof N[0]&&"none"!==N[0]&&
(ka=ra(ka,N[0])),"undefined"!==typeof U[0]&&"none"!==U[0]&&(O=ra(O,U[0]))),t(S)&&("undefined"!==typeof N[1]&&"none"!==N[1]&&(ka=ra(ka,N[1])),"undefined"!==typeof U[1]&&"none"!==U[1]&&(O=ra(O,U[1]))),t(c)&&("undefined"!==typeof N[2]&&"none"!==N[2]&&(ka=ra(ka,N[2])),"undefined"!==typeof U[2]&&"none"!==U[2]&&(O=ra(O,U[2].slicePriorToLastX("/")))),t("LIRC32KEN")&&"undefined"!==typeof U[2]&&"none"!==U[2]&&(O=ra(O,U[2].sliceAfterX("/"))),t(na)?("undefined"!==typeof N[3]&&"none"!==N[3]&&(ka=ra(ka,N[3])),
"undefined"!==typeof U[3]&&"none"!==U[3]&&(O=ra(O,U[3]))):0===p.indexOf("KM1M7")&&(ka="CLK_DisableHXO();"),t("HIRC1EN")&&("undefined"!==typeof N[4]&&"none"!==N[4]&&(ka=ra(ka,N[4])),"undefined"!==typeof U[5]&&"none"!==U[5]&&(O=ra(O,U[5]))),t("HIRC48EN")&&("undefined"!==typeof N[4]&&"none"!==N[4]&&(ka=ra(ka,N[4])),"undefined"!==typeof U[5]&&"none"!==U[5]&&(O=ra(O,U[5]))),t("MIRCEN")&&("undefined"!==typeof N[5]&&"none"!==N[5]&&(ka=ra(ka,N[5])),"undefined"!==typeof U[6]&&"none"!==U[6]&&(O=ra(O,U[6]))),
t("MIRC1P2MEN")&&("undefined"!==typeof N[6]&&"none"!==N[6]&&(ka=ra(ka,N[6])),"undefined"!==typeof U[7]&&"none"!==U[7]&&(O=ra(O,U[7]))),""!==ka&&(F="NUC505"===p?F+("    /* Enable clock source */\n    CLK->PWRCTL |= "+ka+";\n\n"):-1!==ka.indexOf("(")&&-1!==ka.indexOf(");")?-1!==ka.indexOf("Disable")?F+("    /* Disable clock source */\n    "+ka+"\n\n"):F+("    /* Enable clock source */\n    "+ka+"\n\n"):F+("    /* Enable clock source */\n    CLK_EnableXtalRC("+ka+");\n\n")),""!==O&&(F=-1!==O.indexOf("(")&&
-1!==O.indexOf(");")?F+("    /* Waiting for clock source ready */\n    "+O+"\n\n"):F+("    /* Waiting for clock source ready */\n    CLK_WaitClockReady("+O+");\n\n"))),r[y]===L&&"undefined"!==typeof NUTOOL_CLOCK.g_register_map[L]&&(t("PD")||0===_.filter(NUTOOL_CLOCK.g_register_map[L],function(Pa){return-1!==Pa.indexOf("PD:")}).length||(F+="    /* Disable "+f+" first to avoid unstable when setting "+f+" */\n",F+="    CLK_DisablePLL();\n\n",F+="    /* Set "+f+" frequency */\n",F+="    "+x+" = ("+x+
" & ~("+pa+")) | 0x"+Sa(ba[r[y]]).toUpperCase()+"UL;\n\n","none"!==U[4]&&(F+="    /* Waiting for "+f+" ready */\n    CLK_WaitClockReady("+U[4]+");\n\n")),t("PLLEN")&&0!==_.filter(NUTOOL_CLOCK.g_register_map.CHIPPLLCTR1,function(Pa){return-1!==Pa.indexOf("PLLEN:")}).length&&(F+="    /* Set "+f+" frequency */\n",F+="    "+x+" = 0x"+Sa(ba[r[y]]).toUpperCase()+"UL;\n",F+="    CLK->CHIPPLLCTR1 = 0xA53C0001UL;\n\n",F+="    /* Waiting for "+f+" ready */\n    CLK_WaitPLLReady();\n\n")),"APLLCTL"!==r[y]||
"undefined"===typeof NUTOOL_CLOCK.g_register_map.APLLCTL||t("APD")||(F+="    /* Disable APLL first to avoid unstable when setting APLL */\n",F+="    CLK->PLLCTL |= CLK_APLLCTL_PD_Msk;\n\n",F+="    /* Set APLL frequency */\n",F+="    "+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[r[y]]).toUpperCase()+"UL;\n\n"),"PLL2CTL"===r[y]&&"undefined"!==typeof NUTOOL_CLOCK.g_register_map.PLL2CTL&&t("PLL2CKEN")&&(F+="    /* Set PLL2 frequency */\n",F+="    "+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[r[y]]).toUpperCase()+
"UL;\n\n",F+="    /* Waiting for PLL2 ready */\n    CLK_WaitClockReady(CLK_STATUS_PLL2STB_Msk);\n\n");if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")){u="BASESEL";M=X(u).toString();if(-1!==M&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(u))for(y=0,a=NUTOOL_CLOCK.g_CLKSEL[u].length;y<a;y+=1)if(NUTOOL_CLOCK.g_CLKSEL[u][y].sliceAfterX(":")===M){n=NUTOOL_CLOCK.g_CLKSEL[u][y].slicePriorToX(":");break}F+="    /* Set BASECLK clock */\n    CLK_SelectBASECLK(SELECT_"+n+");\n\n";F+="    /* Set CPUCLK clock */\n    CLK_SetCPUCLK(CPUCLK_DIV_";
u="CPUCKDIV";M=X(u).toString();if(-1!==M&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(u))for(y=0,a=NUTOOL_CLOCK.g_CLKSEL[u].length;y<a;y+=1)if(NUTOOL_CLOCK.g_CLKSEL[u][y].sliceAfterX(":")===M){n=NUTOOL_CLOCK.g_CLKSEL[u][y].slicePriorToX(":");break}F+=n.slicePriorToX(":").sliceAfterX("/")+");\n\n"}else F+="    /* Set HCLK clock */\n    CLK_SetHCLK("+mc(m,H,q)+");\n\n";if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(E))"M2354"!==p&&(F+="    /* Set PCLK-related clock */\n"),0===p.indexOf("M480")?(J=X(E),F+="    CLK->PCLKDIV = (CLK_PCLKDIV_PCLK0DIV"+
Math.pow(2,J)+" | ",J=X(w),F+="CLK_PCLKDIV_PCLK1DIV"+Math.pow(2,J)+");\n\n"):0===p.indexOf("M25")||0===p.indexOf("M030")||0===p.indexOf("M031")?(J=X(E),F+="    CLK->PCLKDIV = (CLK_PCLKDIV_APB0DIV_DIV"+Math.pow(2,J)+" | ",J=X(w),F+="CLK_PCLKDIV_APB1DIV_DIV"+Math.pow(2,J)+");\n\n"):"M2351"===p||"M261"===p?(J=X(E),F=0===J?F+"    CLK->PCLKDIV = (CLK_PCLKDIV_APB0DIV_HCLK | ":F+("    CLK->PCLKDIV = (CLK_PCLKDIV_APB0DIV_HCLK_DIV"+Math.pow(2,J)+" | "),J=X(w),F=0===J?F+"CLK_PCLKDIV_APB1DIV_HCLK);\n\n":F+("CLK_PCLKDIV_APB1DIV_HCLK_DIV"+
Math.pow(2,J)+");\n\n")):"M2354"!==p&&(2>=NUTOOL_CLOCK.g_CLKSEL[E].length?F=t(E)?F+"    CLK->CLKSEL0 = CLK->CLKSEL0 | CLK_CLKSEL0_PCLK0SEL_Msk;\n":F+"    CLK->CLKSEL0 = CLK->CLKSEL0 & ~CLK_CLKSEL0_PCLK0SEL_Msk;\n":(J=X(E),F=0===J?F+"    CLK_SetPCLK0(CLK_APB0DIV_HCLK);\n":F+("    CLK_SetPCLK0(CLK_APB0DIV_1_"+Math.pow(2,J)+"HCLK);\n")),2>=NUTOOL_CLOCK.g_CLKSEL[w].length?F=t(w)?F+"    CLK->CLKSEL0 = CLK->CLKSEL0 | CLK_CLKSEL0_PCLK1SEL_Msk;\n\n":F+"    CLK->CLKSEL0 = CLK->CLKSEL0 & ~CLK_CLKSEL0_PCLK1SEL_Msk;\n\n":
(J=X(w),F=0===J?F+"    CLK_SetPCLK1(CLK_APB1DIV_HCLK);\n\n":F+("    CLK_SetPCLK1(CLK_APB1DIV_1_"+Math.pow(2,J)+"HCLK);\n\n")));else if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(W))if(0===W.indexOf("IOCKDIV")){F+="    /* Set IOCLK clock */\n";F+="    CLK_SetIOCLK(IOCLK_DIV_";u=W;M=X(u).toString();if(-1!==M&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(u))for(y=0,a=NUTOOL_CLOCK.g_CLKSEL[u].length;y<a;y+=1)if(NUTOOL_CLOCK.g_CLKSEL[u][y].sliceAfterX(":")===M){n=NUTOOL_CLOCK.g_CLKSEL[u][y].slicePriorToX(":");break}F+=
n.slicePriorToX(":").sliceAfterX("/")+");\n\n"}else F+="    /* Set PCLK-related clock */\n",F="NUC123AN_AE"===p?t(W)?F+"    CLK->APBDIV = CLK->APBDIV | CLK_APBDIV_APBDIV_Msk;\n\n":F+"    CLK->APBDIV = CLK->APBDIV & ~CLK_APBDIV_APBDIV_Msk;\n\n":"NANO112"===p?F+("    CLK->APB_DIV = 0x"+Sa(X(W)).toUpperCase()+"UL;\n\n"):t(W)?F+"    CLK->CLKSEL0 = CLK->CLKSEL0 | CLK_CLKSEL0_PCLKSEL_Msk;\n\n":F+"    CLK->CLKSEL0 = CLK->CLKSEL0 & ~CLK_CLKSEL0_PCLKSEL_Msk;\n\n";else-1!==X(A)&&(F+="    /* Set PCLK divider */\n",
F+="    CLK_SetModuleClock(PCLK_MODULE, CLK_CLKDIV0_PCLK("+(X(A)+1)+"), 1);\n\n");return F};Zb=!0;if("M451"===p){var r=[k,L];var I='#include "M451Series.h"';N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none none".split(" ");U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" ")}else"M480MD"===p?(r=[k,L],I='#include "M480.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none none".split(" "),
U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" ")):"M480LD"===p?(r=[k,L],I='#include "M480.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48MEN_Msk none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48MSTB_Msk none".split(" ")):0===p.indexOf("KM1M7")?(r=[k,
L],I='#include "NuMicro.h"',N=["none","none","none","CLK_EnableHXO(HXO_WCYCLE_"+_.filter(NUTOOL_CLOCK.g_CLKSEL[h],function(Pa){return-1!==Pa.indexOf(":"+X(h).toString())})[0].toString().slicePriorToX(":")+");","none","none"],U=["none","none","none","CLK_WaitHXOReady();\n\n    /* Disable "+f+" circuit */\n    CLK_DisablePLL();","none","none","none"]):"M2351"===p?(r=["RTC_LXTCTL",k,L],I='#include "M2351.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk none".split(" "),
U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk/CLK_STATUS_LIRC32STB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk none".split(" ")):"M2354"===p?(r=["RTC_LXTCTL",k,L],I='#include "M2354.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk CLK_PWRCTL_MIRCEN_Msk CLK_PWRCTL_MIRC1P2MEN_Msk".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk/CLK_STATUS_LIRC32STB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk CLK_STATUS_MIRCSTB_Msk none".split(" ")):
"M253"===p?(r=[k],I='#include "M253.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none CLK_PWRCTL_MIRCEN_Msk".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk  none CLK_STATUS_MIRCSTB_Msk".split(" ")):0===p.indexOf("M25")?(r=[k,L],I='#include "M251.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none CLK_PWRCTL_MIRCEN_Msk".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none CLK_STATUS_MIRCSTB_Msk".split(" ")):
"M261"===p?(r=["RTC_LXTCTL",k,L],I='#include "M261.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk/CLK_STATUS_LIRC32STB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk none".split(" ")):0===p.indexOf("M030G")?(r=[k,L],I='#include "M030G.h"',N="none CLK_PWRCTL_HIRCEN_Msk none none none none".split(" "),U="none CLK_STATUS_HIRCSTB_Msk none none CLK_STATUS_PLLSTB_Msk none none".split(" ")):
0===p.indexOf("M031")?(r=[k,L],I='#include "M031Series.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" ")):"M051AN"===p||"M051BN"===p||"M051DN"===p||"M051DE"===p?(r=[k,L],I='#include "M051Series.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk none CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk none CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"M058S"===p?(r=[k,L],I='#include "M058S.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk none CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk none CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"M0518"===p?(r=[k,L],I='#include "M0518.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"M0519"===p?(r=[k,L],I='#include "M0519.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk none CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk none CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC100AN"===p||"NUC100BN"===p||"NUC100DN"===
p?(r=[k,L],I='#include "NUC100Series.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC131"===p?(r=[k,L],I='#include "NUC131.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC121AE"===p?(r=[k,L],I='#include "NUC121.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN CLK_PWRCTL_HXTEN none none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" ")):"NUC122AN"===p?(r=[k,L],I='#include "NUC122.h"',
N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC123AN_AE"===p?(r=[k,L],I='#include "NUC123.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk none CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk none CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):
0===p.indexOf("NUC126")?(r=[k,L],I='#include "'+p+'.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk none".split(" ")):"M0564"===p?(r=[k,L],I='#include "M0564.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk none".split(" "),
U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk none".split(" ")):"NUC2201"===p?(r=[k,L],I='#include "NUC2201.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk CLK_PWRCON_OSC48M_EN_Msk none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk CLK_CLKSTATUS_OSC48M_STB_Msk none".split(" ")):
"NUC029AN"===p||"NUC029TAE"===p||"NUC029ZAN"===p?(r=[k,L],I='#include "NUC029xAN.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk none CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk none CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC029xDE"===p?(r=[k,L],I='#include "NUC029xDE.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC029xEE"===p?(r=[k,L],I='#include "NUC029xEE.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk CLK_PWRCON_OSC48M_EN_Msk none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk CLK_CLKSTATUS_OSC48M_STB_Msk none".split(" ")):
"NUC029xGE"===p?(r=[k,L],I='#include "NUC029xGE.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC48EN_Msk none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC48STB_Msk none".split(" ")):"NUC200AN"===p?(r=[k,L],I='#include "NUC200Series.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NUC200AE"===p?(r=[k,L],I='#include "NUC230_240.h"',N="CLK_PWRCON_OSC10K_EN_Msk CLK_PWRCON_OSC22M_EN_Msk CLK_PWRCON_XTL32K_EN_Msk CLK_PWRCON_XTL12M_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_OSC10K_STB_Msk CLK_CLKSTATUS_OSC22M_STB_Msk CLK_CLKSTATUS_XTL32K_STB_Msk CLK_CLKSTATUS_XTL12M_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):
"MINI57"===p?(r=[k],I='#include "Mini57Series.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXT_EN CLK_PWRCTL_HXT_EN none none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_XTLSTB_Msk CLK_STATUS_XTLSTB_Msk none none none".split(" ")):"MINI58"===p?(r=[k,L],I='#include "Mini58Series.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_XTLEN_LXT CLK_PWRCTL_XTLEN_HXT none none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_XTLSTB_Msk CLK_STATUS_XTLSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" ")):
"NANO100AN"===p||"NANO100BN"===p?(r=[k,L],I='#include "Nano100Series.h"',N="CLK_PWRCTL_LIRC_EN_Msk CLK_PWRCTL_HIRC_EN_Msk CLK_PWRCTL_LXT_EN_Msk CLK_PWRCTL_HXT_EN_Msk none none".split(" "),U="CLK_CLKSTATUS_LIRC_STB_Msk CLK_CLKSTATUS_HIRC_STB_Msk CLK_CLKSTATUS_LXT_STB_Msk CLK_CLKSTATUS_HXT_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NANO112"===p?(r=[k,L],I='#include "Nano1X2Series.h"',N="CLK_PWRCTL_LIRC_EN_Msk CLK_PWRCTL_HIRC_EN_Msk CLK_PWRCTL_LXT_EN_Msk CLK_PWRCTL_HXT_EN_Msk none none".split(" "),
U="CLK_CLKSTATUS_LIRC_STB_Msk CLK_CLKSTATUS_HIRC_STB_Msk CLK_CLKSTATUS_LXT_STB_Msk CLK_CLKSTATUS_HXT_STB_Msk CLK_CLKSTATUS_PLL_STB_Msk none none".split(" ")):"NANO103"===p?(r=[k,L],I='#include "Nano103.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRC0EN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk CLK_PWRCTL_HIRC1EN_Msk CLK_PWRCTL_MIRCEN_Msk".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRC0STB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk CLK_STATUS_HIRC1STB_Msk CLK_STATUS_MIRCSTB_Msk".split(" ")):
"NUC505"===p?(r=["RTC_CLKSRC",k,L,"APLLCTL"],I='#include "NUC505Series.h"',N="none none none CLK_PWRCTL_HXTEN_Msk none none".split(" "),U="none none none none none none".split(" ")):"MINI51AN"===p?(r=[k],I='#include "Mini51.h"',Zb=!1):"MINI51DE"===p?(r=[k],I='#include "Mini51Series.h"',Zb=!1):"MINI55"===p?(r=[k],I='#include "Mini55Series.h"',Zb=!1):"NUC029AE"===p?(r=[k],I='#include "NUC029FAE.h"',N=[],U=[],Zb=!1):"NUC100CN"===p?(r=[k,L],I='#include "NUC100Series.h"',N=[],U=[],Zb=!1):"NM1200"===p?
(r=[k],I='#include "Mini51.h"',N=[],U=[],Zb=!1):"NM1500"===p?(r=[k,L],I='#include "MT500Series.h"',N=[],U=[],Zb=!1):(r=[k,L,"PLL2CTL"],I='#include "NUC472_442.h"',N="CLK_PWRCTL_LIRCEN_Msk CLK_PWRCTL_HIRCEN_Msk CLK_PWRCTL_LXTEN_Msk CLK_PWRCTL_HXTEN_Msk none none".split(" "),U="CLK_STATUS_LIRCSTB_Msk CLK_STATUS_HIRCSTB_Msk CLK_STATUS_LXTSTB_Msk CLK_STATUS_HXTSTB_Msk CLK_STATUS_PLLSTB_Msk none none".split(" "));"undefined"!==typeof NUTOOL_PER&&(I='#include "NuCodeGenProj.h"',"modularizeCode"===b&&(I+=
'\n#include "clk_conf.h"'));P="";if(null!==Ha){P="Base Clocks:\n";t(R)&&0<Kb&&(B={module:"LIRC"},B.busClock=Kb.toHzString(),B.engineClock="",C.push(B),P+="LIRC:"+Kb.toHzString()+"\n");(t(S)||t("HIRC1EN"))&&0<Lb&&(B={},B.module=g,B.busClock=Lb.toHzString(),B.engineClock="",C.push(B),P+=g+":"+Lb.toHzString()+"\n");t("HIRC48EN")&&0<Mb&&(B={module:"HIRC48"},B.busClock=Mb.toHzString(),B.engineClock="",C.push(B),P+="HIRC48:"+Mb.toHzString()+"\n");t("MIRCEN")&&0<Nb&&(B={module:"MIRC"},B.busClock=Nb.toHzString(),
B.engineClock="",C.push(B),P+="MIRC:"+Nb.toHzString()+"\n");t("MIRC1P2MEN")&&0<Ob&&(B={module:"MIRC1P2M"},B.busClock=Ob.toHzString(),B.engineClock="",C.push(B),P+="MIRC1P2M:"+Ob.toHzString()+"\n");(t(c)||t("LIRC32KEN"))&&0<sb&&(B={module:"LXT"},B.busClock=sb.toHzString(),B.engineClock="",C.push(B),P+="LXT:"+sb.toHzString()+"\n");t(na)&&0<fb&&(B={},B.module=e,B.busClock=fb.toHzString(),B.engineClock="",C.push(B),P+=e+":"+fb.toHzString()+"\n");t(na)&&0<Pb&&(B={module:"RTC32k"},B.busClock=Pb.toHzString(),
B.engineClock="",C.push(B),P+="RTC32k:"+Pb.toHzString()+"\n");(!t("PD")||t("PLLEN"))&&0<ia&&(B={},B.module=f,B.busClock=ia.toHzString(),B.engineClock="",C.push(B),P+=f+":"+ia.toHzString()+"\n");t("PLL2CKEN")&&0<cb&&(B={module:"PLL2"},B.busClock=cb.toHzString(),B.engineClock="",C.push(B),P+="PLL2:"+cb.toHzString()+"\n");t("PLL2CKEN")&&0<Ib&&(B={module:"PLL480M"},B.busClock=Ib.toHzString(),B.engineClock="",C.push(B),P+="PLL480M:"+Ib.toHzString()+"\n");!t("APD")&&0<Wa&&(B={module:"APLL"},B.busClock=
Wa.toHzString(),B.engineClock="",C.push(B),P+="APLL:"+Wa.toHzString()+"\n");t(na)&&0<Yb&&(B={module:"HSUSB_OTG_PHY"},B.busClock=Yb.toHzString(),B.engineClock="",C.push(B),P+="HSUSB_OTG_PHY:"+Yb.toHzString()+"\n");0<tb&&(B={},B.module=m,B.busClock=tb.toHzString(),B.engineClock="",C.push(B),P+=m+":"+tb.toHzString()+"\n");0<Eb&&(B={},B.module=D,B.busClock=Eb.toHzString(),B.engineClock="",C.push(B),P+=D+":"+Eb.toHzString()+"\n");0<Cb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(E)&&(B={module:"PCLK0"},B.busClock=
Cb.toHzString(),B.engineClock="",C.push(B),P+="PCLK0:"+Cb.toHzString()+"\n");0<Fb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(w)&&(B={module:"PCLK1"},B.busClock=Fb.toHzString(),B.engineClock="",C.push(B),P+="PCLK1:"+Fb.toHzString()+"\n");P+="Enabled-Module Frequencies:\n";d.sort();var y=0;for(a=d.length;y<a;y+=1){var x=d[y];g=NUTOOL_CLOCK.g_Module[x][1];B=[];D=0;if(-1!==g.indexOf("/"))for(;-1!==g.indexOf("/")&&!(B.push(g.slicePriorToX("/")),g=g.sliceAfterX("/"),D+=1,10<D););B.push(g);var G=!0;g=0;for(D=
B.length;g<D;g+=1)if(!Dc(B[g])){G=!1;break}if(G&&-1===NUTOOL_CLOCK.g_BusNonExistent.indexOf(x)){B={};B.module=x;var J=Dd(x);B.busClock=J.sliceAfterX(":")+" "+J.slicePriorToX(":");P+=x+"=Bus Clock"+J;Ed(x)?(B.engineClock=$("#"+x+"_span_showRealFreq").text().trim(),P=P+"/Engine Clock:"+$("#"+x+"_span_showRealFreq").text().trim()):B.engineClock="";C.push(B);P+="\n"}}P.lastIndexOf("Enabled-Module Frequencies:\n")+28===P.length&&(P=P.slicePriorToX("Enabled-Module Frequencies:\n"))}P+="********************/\n\n";
P+=I;P+="\n\n";if(Zb){0!==fb?"undefined"===typeof NUTOOL_PER?"modularizeCode"===b?(Hc="#undef  __"+e+"\n",Hc+="#define __"+e+"         ("+fb+"UL)  /*!< High Speed External Crystal Clock Frequency */\n\n"):(P+="/*----------------------------------------------------------------------------\n",P+="  Define "+e+" clock.\n",P+="  Please locate and modify the real one in your project.\n",P+="  Otherwise, the project may fail to build.\n",P+=" *----------------------------------------------------------------------------*/\n",
P+="#define __"+e+"         ("+fb+"UL)  /*!< High Speed External Crystal Clock Frequency */\n\n"):Hc="__"+e+"="+fb+"ul;__LXT="+sb+"ul":Hc="";"default"===b?(P+="/*\n * @brief This function updates clock registers to fulfill the configuration\n * @param None\n * @return None\n */\n",P="undefined"===typeof NUTOOL_PER?P+"void SYS_Init(void)\n{\n":P+"void Clock_Init(void)\n{\n"):"modularizeCode"===b&&(wa=kd("modularizeCode"),P+="void NuCodeGenProj_init_base(void)\n{\n",nc+="void NuCodeGenProj_init_base(void);\n",
P+=Ia(),P+="    return;\n}\n\n","undefined"===typeof NUTOOL_PER?(P+="void NuCodeGenProj_init(void)\n{\n",nc+="void NuCodeGenProj_init(void);\n"):(P+="void Clock_Init(void)\n{\n",nc+="void Clock_Init(void);\n"));P+="    /*---------------------------------------------------------------------------------------------------------*/\n";P+="    /* Init System Clock                                                                                       */\n";P+="    /*---------------------------------------------------------------------------------------------------------*/\n";
y=d=0;for(a=Z.length;y<a;y+=1)x=vc(Z[y]).slicePriorToX("/"),x.length>d&&(d=x.length);y=0;for(a=r.length;y<a;y+=1)if("undefined"!==typeof NUTOOL_CLOCK.g_register_map[r[y]]){x=vc(r[y]);var pa=x.sliceAfterX("/");x=x.slicePriorToX("/");if(d>x.length)for(g=0,D=d-x.length;g<D;g+=1)x+=" ";P+="    //"+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[r[y]]).toUpperCase()+"UL;\n"}y=0;for(a=Z.length;y<a;y+=1)if(-1===$.inArray(Z[y],r)&&-1===NUTOOL_CLOCK.g_register_map_description[Z[y]].indexOf("Read Only")){x=vc(Z[y]);
pa=x.sliceAfterX("/");x=x.slicePriorToX("/");if(d>x.length)for(g=0,D=d-x.length;g<D;g+=1)x+=" ";P+="    //"+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[Z[y]]).toUpperCase()+"UL;\n"}P+="\n";"undefined"===typeof NUTOOL_PER&&"NUC505"!==p&&0!==p.indexOf("KM1M7")&&(P+="    /* Unlock protected registers */\n    SYS_UnlockReg();\n\n");"default"===b?P+=Ia():"modularizeCode"===b&&(P+="    /* Enable base clock */\n",P+="    NuCodeGenProj_init_base();\n\n",P+=wa)}else{P+="/*\n * @brief This function updates clock registers to fulfill the configuration\n * @param None\n * @return None\n */\n";
P="undefined"===typeof NUTOOL_PER?P+"void SYS_Init(void)\n{\n":P+"void Clock_Init(void)\n{\n";x=vc(k);pa=x.sliceAfterX("/");x=x.slicePriorToX("/");P+="    "+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[k]).toUpperCase()+"UL;\n";"undefined"!==typeof NUTOOL_CLOCK.g_register_map[L]&&(x=vc(L),pa=x.sliceAfterX("/"),x=x.slicePriorToX("/"),P+="    "+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[L]).toUpperCase()+"UL;\n");y=0;for(a=Z.length;y<a;y+=1)-1===$.inArray(Z[y],r)&&(x=vc(Z[y]),pa=x.sliceAfterX("/"),x=x.slicePriorToX("/"),
P+="    "+x+" = ("+x+" & ~("+pa+")) | 0x"+Sa(ba[Z[y]]).toUpperCase()+"UL;\n");P+="\n    return;\n}\n"}return C}function kd(b){var a,d=Ab(NUTOOL_CLOCK.g_Module),e="CLKO".toEquivalent().toString(),h="CLKO_Divider".toEquivalent().toString(),f="CLKO1".toEquivalent().toString(),g="CLKO1_Divider".toEquivalent().toString(),m="STCLK_S".toEquivalent().toString(),D="_S".toEquivalent().toString(),k="    /* Enable module clock and set clock source */\n";if(Zb){"undefined"===typeof b&&(b="default");"default"===
b?P+="    /* Enable IP clock */\n":"modularizeCode"===b&&(nc="",d=d.sort(Gd));var L="";var H=0;for(a=d.length;H<a;H+=1){var W=d[H];var E=NUTOOL_CLOCK.g_Module[W][1];var w=[];var q=0;if(-1!==E.indexOf("/"))for(;-1!==E.indexOf("/")&&!(w.push(E.slicePriorToX("/")),E=E.sliceAfterX("/"),q+=1,10<q););w.push(E);var A=!0;E=0;for(q=w.length;E<q;E+=1)if(!Dc(w[E])){A=!1;break}A&&(q=w="",W===e?(E=mc(W),"NANO100AN"===p||"NANO100BN"===p?(w="    CLK_EnableCKO("+E+");\n",q="    CLK_DisableCKO();\n"):"NANO112"===
p?(w="    CLK_EnableCKO0("+E+", 1);\n",q="    CLK_DisableCKO0();\n"):(w="    CLK_EnableCKO("+E+", 1);\n",q="    CLK_DisableCKO();\n"),-1!==$.inArray("CLKO_1Hz",d)&&(w+=ld(NUTOOL_CLOCK.g_Module.CLKO_1Hz[1],!1))):W===h?(E=mc(W),"NANO100AN"===p||"NANO100BN"===p?(w="    CLK_EnableCKO("+E+");\n",q="    CLK_DisableCKO();\n"):"NANO112"===p?(w="    CLK_EnableCKO0("+E+", 0);\n",q="    CLK_DisableCKO0();\n"):(w="    CLK_EnableCKO("+E+", 0);\n",q="    CLK_DisableCKO();\n"),-1!==$.inArray("CLKO_1Hz",d)&&(w+=
ld(NUTOOL_CLOCK.g_Module.CLKO_1Hz[1],!1))):W===f?(E=mc(W),w="    CLK_EnableCKO1("+E+", 1);\n",q="    CLK_DisableCKO1();\n"):W===g?(E=mc(W),w="    CLK_EnableCKO1("+E+", 0);\n",q="    CLK_DisableCKO1();\n"):"CLKO_1Hz"===W?(w=ld(NUTOOL_CLOCK.g_Module.CLKO_1Hz[1],!0),q=ld(NUTOOL_CLOCK.g_Module.CLKO_1Hz[1],!1)):"SYSTICK"===W&&(w="",t("CLKSRC")||-1===X("STICKDIV")||(w="    CLK->CLKDIV1 = CLK->CLKDIV1 & ~CLK_CLKDIV1_STICKDIV_Msk;\n",w+="    CLK->CLKDIV1 = CLK->CLKDIV1 + CLK_CLKDIV1_STICK("+(X("STICKDIV")+
1)+");\n"),E=mc("SYSTICK",m,""),w+="    CLK_EnableSysTick("+E+", 0);\n",q="    CLK_DisableSysTick();\n"),""!==w?("modularizeCode"===b&&(P+="void NuCodeGenProj_init_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void)\n{\n",nc+="void NuCodeGenProj_init_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void);\n",k+="    NuCodeGenProj_init_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"();\n"),P+=w,wc+=w):("partial"!==b&&"HSUSBH"!==W&&("WWDT"!==
W||"WWDT"===W&&-1!==NUTOOL_CLOCK.g_Module.WWDT[0].indexOf(D))&&("undefined"!==typeof NUTOOL_CLOCK.g_Module[W][3]?(w="    CLK_EnableModuleClock("+NUTOOL_CLOCK.g_Module[W][3]+");\n",q="    CLK_DisableModuleClock("+NUTOOL_CLOCK.g_Module[W][3]+");\n"):(w="    CLK_EnableModuleClock("+W+"_MODULE);\n",q="    CLK_DisableModuleClock("+W+"_MODULE);\n"),"modularizeCode"===b&&(P+="void NuCodeGenProj_init_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void)\n{\n",nc+="void NuCodeGenProj_init_"+
W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void);\n",k+="    NuCodeGenProj_init_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"();\n"),P+=w,wc+=w),E=mc(W),-1!==E.indexOf("RTC->LXTCTL")?("modularizeCode"===b?P+=E:L+=E,wc+=E):"None"!==E&&"MODULE_NoMsk, MODULE_NoMsk"!==E&&(w="    CLK_SetModuleClock("+W+"_MODULE, "+E+");\n","modularizeCode"===b?P+=w:L+=w,wc+=w)),"modularizeCode"===b&&(""!==w&&(P+="\n    return;\n}\n\n"),""!==q&&(P+="void NuCodeGenProj_deinit_"+
W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void)\n{\n",nc+="void NuCodeGenProj_deinit_"+W.slicePriorToX("_1Hz").slicePriorToX("_Divider").toLowerCase()+"(void);\n",P+=q,P+="\n    return;\n}\n\n")),"functionalTest"===b&&(P+=q))}""!==L&&("default"===b&&(P+="\n    /* Set IP clock */\n"),P+=L);return k}}function zd(){Zb&&(P=P.lastIndexOf("    /* Enable IP clock */\n")+26===P.length?P.slicePriorToX("    /* Enable IP clock */\n"):P.lastIndexOf("    /* Enable module clock and set clock source */\n")+
51===P.length?P.slicePriorToX("    /* Enable module clock and set clock source */\n"):P+"\n",P+="    /* Update System Core Clock */\n    /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */\n    SystemCoreClockUpdate();\n\n","undefined"===typeof NUTOOL_PER&&"NUC505"!==p&&0!==p.indexOf("KM1M7")&&(P+="    /* Lock protected registers */\n    SYS_LockReg();\n\n"),P+="    return;\n}\n\n")}function vc(b){var a,d=0,e=[],h="SYST_CSR".toEquivalent().toString();var f="";if("undefined"!==
typeof NUTOOL_CLOCK.g_register_map[b]){f=0;for(a=NUTOOL_CLOCK.g_register_map[b].length;f<a;f+=1){var g=NUTOOL_CLOCK.g_register_map[b][f].sliceAfterX(":");if(-1===e.indexOf(g))if(e.push(g),-1===g.indexOf("-"))d+=Math.pow(2,g);else{var m=parseInt(g.sliceAfterX("-"),10);for(g=parseInt(g.slicePriorToX("-"),10)+1;m<g;m+=1)d+=Math.pow(2,m)}}f=b===h?"SysTick->CTRL/0x"+Sa(d).toUpperCase()+"UL":"RTC_LXTCTL"===b?"RTC->LXTCTL/0x"+Sa(d).toUpperCase()+"UL":"RTC_CLKSRC"===b?"RTC->CLKSRC/0x"+Sa(d).toUpperCase()+
"UL":"CLK->"+b+"/0x"+Sa(d).toUpperCase()+"UL"}return f}function mc(b,a,d){var e,h,f="CLKO".toEquivalent().toString(),g="CLKO_Divider".toEquivalent().toString(),m="CLKO1".toEquivalent().toString(),D="CLKO1_Divider".toEquivalent().toString();var k="HXT".toEquivalent().toString();var L="HCLK".toEquivalent().toString(),H,W=H=!1;var E="undefined"===typeof a?NUTOOL_CLOCK.g_Module[b][0]:a;var w=-1;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(E))for(a=0,e=Z.length;a<e;a+=1){var q=Z[a];var A=0;for(h=NUTOOL_CLOCK.g_register_map[q].length;A<
h;A+=1){var R=NUTOOL_CLOCK.g_register_map[q][A];if(-1!==R.indexOf(E)&&R.indexOf(":")===E.length){NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(E)?(H=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[E][0],w=parseInt(H.sliceAfterX(":"),10),H=H.slicePriorToX(":"),w=X(E)+(X(H)<<w)>>>0,H=!0):(w=X(E),H=!1);break}}if(-1!==w)break}if(-1!==w){if("SYSTICK"===b&&t("CLKSRC"))R=L;else for(a=0,e=NUTOOL_CLOCK.g_CLKSEL[E].length;a<e&&(R=NUTOOL_CLOCK.g_CLKSEL[E][a],L=parseInt(R.sliceAfterX(":"),10),w!==L);a+=1);R=R.slicePriorToX(":");
Fc&&-1!==R.indexOf("XT")&&(R="MINI57"===p?R.replace(k,"EXT").replace("LXT","EXT"):R.replace(k,"XTAL").replace("LXT","XTAL"));"MINI57"===p?-1!==E.indexOf("STCLK")?k=-1===R.indexOf("/")?"CLK_SYSTICK_SRC_"+R:"CLK_SYSTICK_SRC_"+R.slicePriorToX("/")+"_HALF":-1===R.indexOf("/")?k="CLK_"+E.slicePriorToX("SEL")+"_SRC_"+R:(w=R,k="CLK_"+E.slicePriorToX("SEL")+"_SRC_"+R.slicePriorToX("/")+"_"+w.sliceAfterX("/")):"NUC505"===p?k="CLK_"+E.slicePriorToX("SEL").slicePriorToX("_S")+"_SRC_"+R.replace(k,"EXT").replace("RTC32k",
"RTC"):-1===R.indexOf("/")?k="CLK_"+q+"_"+E+"_"+R:-1!==R.indexOf("/")&&-1!==R.indexOf("DIV")?("undefined"===typeof d&&(d=R.sliceAfterX("(").slicePriorToX("+")),k="CLK_"+q+"_"+E+"_"+R.slicePriorToX("/")):(w=R,k="CLK_"+q+"_"+E+"_"+R.slicePriorToX("/")+"_DIV"+w.sliceAfterX("/"));if((0===p.indexOf("M25")||0===p.indexOf("M030")||0===p.indexOf("M031"))&&-1!==k.indexOf("LXTCTL"))return k=-1!==k.indexOf("LIRC")?"    RTC->LXTCTL |= RTC_LXTCTL_C32KS_Msk;\n":"    RTC->LXTCTL = RTC->LXTCTL & ~RTC_LXTCTL_C32KS_Msk;\n";
if("M2354"===p&&-1!==k.indexOf("LXTCTL"))return k=-1!==k.indexOf("LIRC")?"    RTC->LXTCTL |= RTC_LXTCTL_RTCCKSEL_Msk;\n":"    RTC->LXTCTL = RTC->LXTCTL & ~RTC_LXTCTL_RTCCKSEL_Msk;\n";"NUC2201"!==p&&"NUC029xEE"!==p||-1===k.indexOf("HIRC48")||(k="CLK_CLKSEL0_USB_S_RC48M");"M480LD"===p&&-1!==k.indexOf("HIRC48")&&(k="CLK_CLKSEL0_USBSEL_RC48M");if(H){E=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[E][0].slicePriorToX(":");a=0;for(e=Z.length;a<e;a+=1){q=Z[a];A=0;for(h=NUTOOL_CLOCK.g_register_map[q].length;A<h;A+=1)if(w=
NUTOOL_CLOCK.g_register_map[q][A],-1!==w.indexOf(E)&&w.indexOf(":")===E.length){W=!0;break}if(W)break}k=k+"|CLK_"+q+"_"+E.slicePriorToX("_")+"_EXT_"+R}}else"SYSTICK"===b?(R=t("CLKSRC")?L:-1===NUTOOL_CLOCK.g_Module.SYSTICK[0].indexOf("STICKDIV")?NUTOOL_CLOCK.g_Module.SYSTICK[0]:k,R=R.slicePriorToX(":"),Fc&&-1!==R.indexOf("XT")&&(R=R.replace(k,"XTAL").replace("LXT","XTAL")),"NUC505"!==p?-1===R.indexOf("/")?k="CLK_CLKSEL0_STCLKSEL_"+R:(w=R,k="CLK_CLKSEL0_STCLKSEL_"+R.slicePriorToX("/")+"_DIV"+w.sliceAfterX("/")):
k="CLK_STICK_SRC_"+R.replace(k,"EXT").replace("RTC32k","RTC")):k="MODULE_NoMsk";if("SYSTICK"!==b)if(E="undefined"===typeof d?NUTOOL_CLOCK.g_Module[b][2]:d,"none"===E)k+=", MODULE_NoMsk";else{w=-1;a=0;for(e=Z.length;a<e;a+=1){q=Z[a];A=0;for(h=NUTOOL_CLOCK.g_register_map[q].length;A<h;A+=1)if(R=NUTOOL_CLOCK.g_register_map[q][A],-1!==R.indexOf(E)&&R.indexOf(":")===E.length){-1===R.indexOf("-")?(d=parseInt(R.sliceAfterX(":"),10),R=1<<d>>>0):(d=parseInt(R.sliceAfterX("-"),10),R=parseInt(R.sliceBetweenXandX(":",
"-"),10)-d+1,R=Math.pow(2,R)-1<<d>>>0);w=(ba[q]&R)>>>0;w=w>>>d>>>0;break}if(-1!==w)break}if(-1!==w)if(b!==f&&b!==g&&b!==m&&b!==D){a=0;for(e=NUTOOL_CLOCK.g_DIV_Module_Defines.length;a<e;a+=1)0===b.indexOf(NUTOOL_CLOCK.g_DIV_Module_Defines[a].slicePriorToX(":"))&&(b=NUTOOL_CLOCK.g_DIV_Module_Defines[a].sliceAfterX(":"));k="NANO100AN"===p||"NANO100BN"===p||"NANO112"===p||"NANO103"===p?k+", CLK_"+b+"_CLK_DIVIDER("+(w+1)+")":0!==p.indexOf("M480")||0!==b.indexOf("USB")&&0!==b.indexOf("OTG")?"MINI57"===
p?-1!==b.indexOf("ADC")?k+", CLK_CLKDIV_EADC("+(w+1)+")":k+", CLK_CLKDIV_HCLK("+(w+1)+")":k+", CLK_"+q+"_"+b+"("+(w+1)+")":k+", CLK_"+q+"_USB("+(w+1)+")"}else k=k+", "+w;else k+=", MODULE_NoMsk"}return k}function ld(b,a){var d,e,h="";if("none"===b)h="MODULE_NoMsk";else{var f=0;for(d=Z.length;f<d;f+=1){var g=Z[f];var m=0;for(e=NUTOOL_CLOCK.g_register_map[g].length;m<e;m+=1){var D=NUTOOL_CLOCK.g_register_map[g][m];if(-1!==D.indexOf(b)&&D.indexOf(":")===b.length){h=a?"    CLK->"+g+" = CLK->"+g+" | CLK_"+
g+"_"+b+"_Msk;\n":"    CLK->"+g+" = CLK->"+g+" & ~CLK_"+g+"_"+b+"_Msk;\n";break}}if(""!==h)break}}return h}function Cd(b){var a,d,e="checked=true",h="",f=a="",g=[],m="",D="",k="",L=null,H,W=[];var E=$.ajax({url:"NuToolSetup.txt",async:!1}).responseText;var w="",q=w="";g="";var A=function(O,wa){var C,B='*?"<>|'.split(""),N=!0;var U=0;for(C=B.length;U<C;U+=1){var ra=B[U];if(-1!==wa.indexOf(B[U])){Rb("\u5de5\u7a0b\u8def\u5f84\u4e0d\u5e94\u8be5\u5305\u542b"+ra+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u8def\u5f91\u4e0d\u61c9\u8a72\u5305\u542b"+
ra+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project path should not contain "+ra+". Please fix it.");N=!1;break}}B.push("\\");B.push("/");B.push(":");U=0;for(C=B.length;U<C;U+=1)if(ra=B[U],-1!==O.indexOf(ra)){Rb("\u5de5\u7a0b\u540d\u79f0\u4e0d\u5e94\u8be5\u5305\u542b"+ra+"\u3002\u8bf7\u4fee\u6b63\u5b83\u3002","\u5c08\u6848\u540d\u7a31\u4e0d\u61c9\u8a72\u5305\u542b"+ra+"\u3002\u8acb\u4fee\u6b63\u5b83\u3002","The project name should not contain "+ra+". Please fix it.");N=!1;break}wa.charAt(0).match(/^[a-zA-Z]/)&&
wa.charAt(1).match(/^[:]/)&&wa.charAt(2).match(/^[\/\\]/)||(Rb("\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."),
N=!1);O.slice(-1).match(/^[ .]/)&&(Rb("\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."),N=!1);return N};var R=function(){-1!==T.indexOf("Simplified")?(m="\u6a21\u5757",D="\u6c47\u6d41\u6392\u9891\u7387",k="\u5f15\u64ce\u9891\u7387"):
-1!==T.indexOf("Traditional")?(m="\u6a21\u7d44",D="\u532f\u6d41\u6392\u983b\u7387",k="\u5f15\u64ce\u983b\u7387"):(m="Module",D="Bus Clock",k="Engine Clock");$("#reviewReportTable")[0]||$("<div id='reviewReportTable'></div>").insertAfter($("#generateCodeDialogMainPart_div"));W=Kc();H=10<W.length?"282px":"100%";0<W.length&&(L=new Tabulator("#reviewReportTable",{height:H,data:W,layout:"fitColumns",columns:[{title:m,field:"module"},{title:D,field:"busClock"},{title:k,field:"engineClock"}],rowClick:function(O,
wa){null!==Ha&&(Ha.selectAll("g.node").on("searchFromInput")(wa._row.data.module),$("#tabs").tabs({active:3}),3!==$("#tabs").tabs("option","active")&&$("#tabs").tabs({active:2}))},langs:{Simplified:{headerFilters:{"default":"\u8fc7\u6ee4"}},Traditional:{headerFilters:{"default":"\u904e\u6ffe..."}},English:{headerFilters:{"default":"filter..."}}}}),-1!==T.indexOf("Simplified")?L.setLocale("Simplified"):-1!==T.indexOf("Traditional")?L.setLocale("Traditional"):L.setLocale("English"))};if(id(xd)){if("undefined"!==
typeof E&&-1!==E.indexOf("UIlanguage:")){w=E.sliceAfterX("CheckModularizeCode:");w=w.slicePriorToX("\r");if("No"===w||""===w)e="";w=E.sliceAfterX("ProjectName:");w=w.slicePriorToX("\r");q=E.sliceAfterX("ProjectLocation:");q=q.slicePriorToX("\r");g=E.sliceAfterX("ProjectLocationHistory:");g=g.slicePriorToX("\r");E=E.sliceAfterX("UIlanguage:");E=E.slicePriorToX("\r");if("Simplified Chinese"===E){E="\u4ea7\u751f\u7a0b\u5f0f\u7801";var S="\u5de5\u7a0b\u540d\u79f0";var c="\u8bf7\u8f93\u5165\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u7528\u4e8e\u5b58\u653e\u751f\u6210\u7684\u4ee3\u7801:";
var na="\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";a="\u6216\u662f\u60a8\u53ef\u4ee5\u4ece\u6700\u8fd1\u7684\u5de5\u7a0b\u4e2d\u9009\u62e9\u4e00\u4e2a";f="\u6d4f\u89c8";var u="\u6a21\u7ec4\u5316\u4ee3\u7801";var n="\u68c0\u9605\u62a5\u544a";var M="\u786e\u5b9a"}else"Traditional Chinese"===E?(E="\u7522\u751f\u7a0b\u5f0f\u78bc",
S="\u5c08\u6848\u540d\u7a31",c="\u8acb\u8f38\u5165\u8cc7\u6599\u593e\u8def\u5f91\uff0c\u7528\u65bc\u5b58\u653e\u751f\u6210\u7684\u7a0b\u5f0f\u78bc:",na="\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",a="\u6216\u662f\u60a8\u53ef\u4ee5\u5f9e\u6700\u8fd1\u7684\u5c08\u6848\u4e2d\u9078\u64c7\u4e00\u500b",f="\u700f\u89bd",
u="\u6a21\u7d44\u5316\u7a0b\u5f0f\u78bc",n="\u6aa2\u95b1\u5831\u544a",M="\u78ba\u5b9a"):(E="Generate Code",S="Project Name",c="Please input a folder path for storing the generated code:",na="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.",a="Or you can choose a folder from recent projects",f="Browse",u="Modularize Code",n="Review Report",M="Confirm")}else E="Generate Code",S="Project Name",
c="Please input a folder path for storing the generated code:",na="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.",a="Or you can choose a folder from recent projects",f="Browse",u="Modularize Code",n="Review Report",M="Confirm";""===w.trim()&&(w="MyProject");if(""!==g.trim()){g=g.split(">");h='<br /><label><select id="generateCodeDialogSelect" style="width: 450px;height:32px;"><option value="default">'+
a+"</option>";a=0;for(d=g.length-1;a<d;a++)h+='<option value="'+g[a]+'">'+g[a]+"</option>";h+="</select></label>"}if(-1==="MINI51DE MINI55 NUC029AE NUC100CN NM1200 NM1500".split(" ").indexOf(p))var F="checkbox";else u="",F="hidden",e="";if(null===Ha){n="";var ka="hidden"}else ka="checkbox";cc();"undefined"===typeof b?$('<div id="generateCodeDialog"><div id="generateCodeDialogMainPart_div"><label>'+(S+': <input type="text" id="inputText_projectName" value="'+w+'" style="width:250px;height:24px;"></label><br /><br /><label><p>'+
c+'</p></label><label><input id="generateCodeDialogInput" type="text" style="width:362px;height:24px;" value="'+q+'"><button id="generateCodeDialogBrowseFolder" style="width:80px;height:28px;">'+f+"</button></label>"+h+"<br /><br /><p>"+na+'</p></div><div id="reviewReportTable"></div></div>')).dialog({modal:!1,resizable:!1,title:E,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},create:function(O,wa){O=$(this).dialog("widget").find(".ui-dialog-buttonpane");
$("html").hasClass("ie10+")?$("<div class='generateCodeByModule'><label><input type='"+F+"' id='checkbox_ModularizeCode' "+e+"/>"+u+" </label><input type='"+ka+"' id='checkbox_ReviewReport'/>"+n+"</label></label></div>").prependTo(O):$("<div class='generateCodeByModule'><label><input type='"+F+"' id='checkbox_ModularizeCode' "+e+"/>"+u+" </label></div>").prependTo(O)},buttons:[{id:"generateCodeDialog_buttonOk",text:M,click:function(){$("#generateCodeDialog_buttonOk").button("disable");""===$("#inputText_projectName").val().trim()&&
$("#inputText_projectName").val("MyProject");if(A($("#inputText_projectName").val(),$("#generateCodeDialogInput").val())){try{external.generateCodeFromJS($("#inputText_projectName").val(),$("#generateCodeDialogInput").val(),"CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"))}catch(O){}$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}else $("#generateCodeDialog_buttonOk").button("enable")}}]}):0===b.indexOf("reviewReport")&&($('<div id="generateCodeDialog"><div id="reviewReportTable"><input type="text" size="1" style="position:relative;top:-5000px;"/></div></div>').dialog({modal:!1,
resizable:!1,title:n,width:500,height:"auto",show:"fade",hide:"fade",close:function(){$("#generateCodeDialog").dialog("destroy")},buttons:[{id:"generateCodeDialog_buttonOk",text:M,click:function(){-1!==b.indexOf("runAnotherTool")?runAnotherTool():$("#generateCodeDialog").dialog("isOpen")&&$("#generateCodeDialog").dialog("destroy")}}]}),R());$("#generateCodeDialogInput").keypress(function(O){switch(O.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","CheckModularizeCode:"+$("#checkbox_ModularizeCode").is(":checked"))}catch(O){}""!==NUTOOL_CLOCK.g_clockFunctionString&&-1!==NUTOOL_CLOCK.g_clockFunctionString.indexOf(":")&&$("#generateCodeDialogInput").val(NUTOOL_CLOCK.g_clockFunctionString);$("#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")?(R(),$("#generateCodeDialogMainPart_div").hide(),$("#generateCodeDialogTableWrapper").show(),$("#generateCodeDialog_buttonOk").button("disable")):($("#reviewReportTable").remove(),$("#generateCodeDialogMainPart_div").show(),
$("#generateCodeDialogTableWrapper").hide(),$("#generateCodeDialog_buttonOk").button("enable"))})}}function Rc(){var b;yd=[];var a=0;for(b=Z.length;a<b;a+=1)yd[Z[a]]=ba[Z[a]]}function Nd(){if("undefined"===typeof NUTOOL_PER&&"undefined"!==typeof NUTOOL_CLOCK.g_toolName&&""!==NUTOOL_CLOCK.g_toolName)try{external.changeDialogContentFromJS("dialogCaption:"+NUTOOL_CLOCK.g_toolName)}catch(b){}if(!Id()){Qc();if("undefined"===typeof NUTOOL_PER)try{window.external.updateCurrentDialogSize()}catch(b){ud=!1}vd();
sd();$("#rootTree_Clock")[0].setAttribute("style","width:"+ab+"px; height: "+Nc+"px;");"undefined"===typeof NUTOOL_PER?Sd():gb="undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?4:3;Hd();Jb=!0;nd();Jb=!1;Jd();"undefined"!==typeof NUTOOL_PER&&($("#tabs")[0].style.visibility="hidden",$("#rootTree_Clock").hide())}}var ab=250,Nc,mb,Xb,od="NUC400 NUC505 M451 M480 KM1M7 M2351 M251 M261 NUC100 NUC200 NUC029 M030G M031 M051 M0518 M0519 M0564 MINI51 NANO100 NM1200 NM1500".split(" "),
p="",gc="",kb="",Hb={getContext:null,removeContext:null,addEvent:null,triggerEvent:null},ba=[],yd=[],Uc=[],Z=[],gb=1,xc=1,hc=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,sb=0,fb=0,ia=0,cb=0,Ib=0,Wa=0,Yb=0,tb=0,Eb=0,Cb=0,Fb=0,Vc=0,Wc=0,Xc=0,Yc=0,Zc=0,$c=0,ad=0,bd=0,cd=0,dd=0,ed=0,fd=0,gd=0,hd=0,Za=[],wb="",Fd="",wc="",Gb=-1,Ha=null,Kd,xb,P,Hc,nc,T,rd,tc=!1,ud=!0,Jb=!1,td=!0,Bc=!1,Sc=!1,Mc=!1,Zb=!0,Fc=!1;window.onload=function(){Nd()};Db.prototype.drawWithArrowheads=function(b,a){b.strokeStyle="black";b.fillStyle=
"black";b.lineWidth=1;b.beginPath();b.moveTo(this.x1,this.y1);b.lineTo(this.x2,this.y2);b.stroke();a&&(a=Math.atan((this.y2-this.y1)/(this.x2-this.x1)),a+=(this.x2>this.x1?-90:90)*Math.PI/180,this.drawArrowhead(b,this.x1,this.y1,a));a=Math.atan((this.y2-this.y1)/(this.x2-this.x1));a+=(this.x2>this.x1?90:-90)*Math.PI/180;this.drawArrowhead(b,this.x2,this.y2,a)};Db.prototype.drawArrowhead=function(b,a,d,e){b.save();b.beginPath();b.translate(a,d);b.rotate(e);b.moveTo(0,0);b.lineTo(5,20);b.lineTo(-5,
20);b.closePath();b.restore();b.fill()};NUTOOL_CLOCK={getg_chipType:function(){return p},getg_partNumber_package:function(){return kb},getg_clockRegsString:function(){return P},getg_clockRegsString1:function(){return Hc},getg_clockRegsString2:function(){return nc},getg_userSelectUIlanguage:function(){return T},getg_toolName:function(){return NUTOOL_CLOCK.g_toolName},isFieldBe1:t,isEnabled:Dc,initializationByTest:function(){var b;uc();Z=Ab(NUTOOL_CLOCK.g_register_map_default);ba=[];NUTOOL_CLOCK.g_readConfigFilePath=
"dummyPath";var a=0;for(b=Z.length;a<b;a+=1)ba[Z[a]]=parseInt(NUTOOL_CLOCK.g_register_map_default[Z[a]],16);gb="undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?4:3;"NUC400"===p&&(0===ia&&(ia=84E6),0===cb&&(cb=24E7));"NUC505"===p?(0===ia&&(ia=24E7),0===Wa&&(Wa=24E7)):"M451"===p||0===p.indexOf("M480")?0===ia&&(ia=72E6):"MINI58"===p?0===ia&&(ia=5E7):"NANO100AN"===p||"NANO100BN"===p||"NUC121AE"===p||0===p.indexOf("M030")||0===p.indexOf("M031")?0===ia&&(ia=96E6):"NUC1262"===p?
0===ia&&(ia=144E6):"NANO112"===p||"NANO103"===p?0===ia&&(ia=16E6):0===p.indexOf("KM1M7")?0===ia&&(ia=1E8):0===ia&&(ia=48E6);Gc()},reportBaseClockFrequencies:function(){var b="",a="HXT".toEquivalent().toString(),d="PLL".toEquivalent().toString(),e="HIRC".toEquivalent().toString(),h="HCLK".toEquivalent().toString(),f="PCLK".toEquivalent().toString();0<Kb&&(b="LIRC: "+Kb.toHzString());0<Lb&&(b+=" / "+e+": "+Lb.toHzString());0<Mb&&(b+=" / HIRC48: "+Mb.toHzString());0<Nb&&(b+=" / MIRC: "+Nb.toHzString());
0<Ob&&(b+=" / MIRC1P2M: "+Ob.toHzString());0<sb&&(b+=" / LXT: "+sb.toHzString());0<fb&&(b+=" / "+a+": "+fb.toHzString());0<Pb&&(b+=" / RTC32k: "+Pb.toHzString());0<ia&&(b+=" / "+d+": "+ia.toHzString());0<cb&&(b+=" / PLL2: "+cb.toHzString());0<Ib&&(b+=" / PLL480M: "+Ib.toHzString());0<Wa&&(b+=" / APLL: "+Wa.toHzString());0<Yb&&(b+=" / HSUSB_OTG_PHY: "+Yb.toHzString());0<tb&&(b+=" / "+h+": "+tb.toHzString());0<Eb&&(b+=" / "+f+": "+Eb.toHzString());0<Cb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("PCLK0SEL".toEquivalent().toString())&&
(b+=" / PCLK0: "+Cb.toHzString());0<Fb&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("PCLK1SEL".toEquivalent().toString())&&(b+=" / PCLK1: "+Fb.toHzString());0===b.indexOf(" / ")&&(b=b.sliceAfterX(" / "));return b},doubleClickD3Node:Ld,dragD3Node:function(b,a){var d=window.document.createEvent("Event"),e=window.document.createEvent("Event"),h=window.document.createEvent("Event");d.initEvent("mousedown",!0,!0);e.initEvent("mousemove",!0,!0);h.initEvent("mouseup",!0,!0);d3.select("#"+b.id)[0][0].dispatchEvent(d);
d3.select("#"+b.id)[0][0].dispatchEvent(e);d3.select("#"+b.id).select(".ghostCircle").on("mouseover")(d3.select("#"+a.id)[0][0].__data__);d3.select("#"+b.id)[0][0].dispatchEvent(h)},clickModuleCanvas:function(b,a){Gb=a;$("#"+b.id+"_canvas").click()},changeDividerDialogInput:function(b,a){$("#dividerConfigureDialog").is(":visible")&&($("#"+b+"_input_dialog").val(a),$("#dividerConfigureDialog").dialog("option","buttons")[0].click())},retrieveNodeTooltip:function(){return Fd},retrieveGenerateCodeContent:function(b){if(0===
b)Kc();else if(1===b)wc="",kd("functionalTest");else if(2===b)kd("partial");else if(3===b){var a=wc;wc=""}else if(4===b){var d="HCLK".toEquivalent().toString(),e="HCLK_S".toEquivalent().toString(),h="HCLK_N".toEquivalent().toString();var f="HXTWAIT".toEquivalent().toString();var g="XTL12M_EN".toEquivalent().toString();Jb=!0;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty("BASESEL")){P+="\n    /* Check more... */\n";var m=f;if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(m)){b=0;for(m=NUTOOL_CLOCK.g_CLKSEL[m].length;b<
m;b+=1)$("#"+g+"_select").val(NUTOOL_CLOCK.g_CLKSEL[f][b].slicePriorToX(":")),P+="    CLK_EnableHXO(HXO_WCYCLE_"+$("#"+g+"_select").val()+");\n";P+="    CLK_DisableHXO();\n"}P+="\n";b=0;for(m=NUTOOL_CLOCK.g_CLKSEL.BASESEL.length;b<m;b+=1){Gb=b;$("#HCLK_canvas").click();d="BASESEL";e=X(d).toString();if(-1!==e&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(d))for(f=0,g=NUTOOL_CLOCK.g_CLKSEL[d].length;f<g;f+=1)if(NUTOOL_CLOCK.g_CLKSEL[d][f].sliceAfterX(":")===e){var D=NUTOOL_CLOCK.g_CLKSEL[d][f].slicePriorToX(":");
break}P+="    CLK_SelectBASECLK(SELECT_"+D+");\n"}m="CPUCKDIV";if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(m))for(P+="\n",b=0,m=NUTOOL_CLOCK.g_CLKSEL[m].length;b<m;b+=1){Gb=b;$("#HCLK_canvas1").click();d="CPUCKDIV";e=X(d).toString();if(-1!==e&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(d))for(f=0,g=NUTOOL_CLOCK.g_CLKSEL[d].length;f<g;f+=1)if(NUTOOL_CLOCK.g_CLKSEL[d][f].sliceAfterX(":")===e){D=NUTOOL_CLOCK.g_CLKSEL[d][f].slicePriorToX(":");break}P+="    CLK_SetCPUCLK(CPUCLK_DIV_"+D.slicePriorToX(":").sliceAfterX("/")+
");\n"}m="IOCKDIV";if(NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(m))for(P+="\n",b=0,m=NUTOOL_CLOCK.g_CLKSEL[m].length;b<m;b+=1){Gb=b;$("#PCLK_canvas").click();d="IOCKDIV";e=X(d).toString();if(-1!==e&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(d))for(f=0,g=NUTOOL_CLOCK.g_CLKSEL[d].length;f<g;f+=1)if(NUTOOL_CLOCK.g_CLKSEL[d][f].sliceAfterX(":")===e){D=NUTOOL_CLOCK.g_CLKSEL[d][f].slicePriorToX(":");break}P+="    CLK_SetIOCLK(IOCLK_DIV_"+D.slicePriorToX(":").sliceAfterX("/")+");\n"}}else for(P+="\n    /* Check more. Set "+
d+" clock */\n",b=0,m=NUTOOL_CLOCK.g_CLKSEL[e].length;b<m;b+=1)Gb=b,$("#HCLK_canvas").click(),P+="    CLK_SetHCLK("+mc(d,e,h)+");\n";Jb=!1}else zd(),a=P;return a},checkD3NodeFrequency:function(b){var a;b=b.id;var d=0;"none"!==NUTOOL_CLOCK.g_Module[b][2]&&(d=X(NUTOOL_CLOCK.g_Module[b][2]));var e="";if("SYSTICK"!==b){e=a=NUTOOL_CLOCK.g_Module[b][0];if(NUTOOL_CLOCK.g_CLKSEL_EXTENDED.hasOwnProperty(e)){var h=NUTOOL_CLOCK.g_CLKSEL_EXTENDED[e][0];var f=parseInt(h.sliceAfterX(":"),10);h=h.slicePriorToX(":");
var g=X(e)+(X(h)<<f)>>>0}else g=X(e);if(-1!==g&&NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(a))for(h=0,f=NUTOOL_CLOCK.g_CLKSEL[a].length;h<f;h+=1)if(NUTOOL_CLOCK.g_CLKSEL[a][h].sliceAfterX(":")===g.toString()){e=NUTOOL_CLOCK.g_CLKSEL[a][h].slicePriorToX(":");break}}else if(t("CLKSRC"))e="CPUCLK";else if(a="STCLK_S".toEquivalent().toString(),g=X(a).toString(),NUTOOL_CLOCK.g_CLKSEL.hasOwnProperty(a))for(h=0,f=NUTOOL_CLOCK.g_CLKSEL[a].length;h<f;h+=1){if(NUTOOL_CLOCK.g_CLKSEL[a][h].sliceAfterX(":")===g){e=
NUTOOL_CLOCK.g_CLKSEL[a][h].slicePriorToX(":");break}}else e=NUTOOL_CLOCK.g_Module[b][0];e=b==="CLKO_Divider".toEquivalent().toString()||b==="CLKO1_Divider".toEquivalent().toString()?fc(e)/Math.pow(2,d+1):fc(e)/(d+1);return e.toHzString()===$("#"+b+"_span_showRealFreq").text()?b+" clock is "+$("#"+b+"_span_showRealFreq").text()+".":"Failed: "+b+" clock ("+$("#"+b+"_span_showRealFreq").text()+") is not equal to the result from registers ("+e.toHzString()+")."},decideNewChipType:Jc,readValueFromClockRegs:X,
uncheckAllNodes_core:Md,setg_selectedPartNoValue:function(b){gc=b},loadClockConfigureTool:Nd,loadClockConfigureTool_fromSelectionGuide:function(){if(!Id()){Qc();vd();$("#rootTree_Clock")[0].setAttribute("style","width:"+ab+"px; height: "+Nc+"px;");if(gc!==kb){var b=p;p=Jc(gc);bc("NUC_"+b+"_Content.js","NUC_"+p+"_Content.js","js");kb=gc;uc();NUTOOL_CLOCK.g_readConfigFilePath="dummyPath";Tc();gb="undefined"!==typeof NUTOOL_CLOCK.g_register_map["PLLCON".toEquivalent()]?4:3;Gc()}Jd();$("#tabs")[0].style.visibility=
"hidden";$("#rootTree_Clock").hide()}},getGeneratedClockStatus:function(){var b,a=Ab(NUTOOL_CLOCK.g_Module),d={};P=":";var e=0;for(b=a.length;e<b;e+=1){var h=a[e];P+=h+"/:";var f=NUTOOL_CLOCK.g_Module[h][1];var g=[];var m=0;if(-1!==f.indexOf("/"))for(;-1!==f.indexOf("/")&&!(g.push(f.slicePriorToX("/")),f=f.sliceAfterX("/"),m+=1,10<m););g.push(f);var D=!0;f=0;for(m=g.length;f<m;f+=1)if(!Dc(g[f])){D=!1;break}D&&(P+=h+"=Enabled:",d[h]=$("#"+h+"_span_showRealFreq").text().trim())}Hc=JSON.stringify(d)},
concatenate_generated_code_begin:Kc,showLeftPanel:function(){"undefined"===typeof NUTOOL_PER?"none"===$("#ChipType").css("display")?($("#ChipType").show(),$("#MCU").show(),null!==Ha&&$("#searchModule").show(),$("#tabs").css({left:ab+8+"px"}),$("#tabs").css("width",mb-ab-8+"px")):($("#ChipType").hide(),$("#MCU").hide(),$("#searchModule").hide(),$("#tabs").css({left:"0px"}),$("#tabs").css("width",mb-8+"px")):"none"===$("#clockRegsTree").css("display")?($("#clockRegsTree").show(),null!==Ha&&$("#searchModule").show(),
$("#tabs").css({left:ab+8+"px"}),$("#tabs").css("width",mb-ab-8+"px")):($("#clockRegsTree").hide(),$("#searchModule").hide(),$("#tabs").css({left:"0px"}),$("#tabs").css("width",mb-8+"px"))},loadConfig:function(){jd(function(){try{window.external.loadConfigFromJS()}catch(b){}})},loadConfig_core:function(){uc();sd();Jb=!0;Gc();Jb=!1},saveConfig:function(){if(id(xd))try{window.external.saveConfigFromJS("NUC_BROWSE_PROJECT_PATH")}catch(b){}},generateCode:Cd,concatenate_g_clockRegsString:function(){var b,
a="HXT".toEquivalent().toString(),d="PLL".toEquivalent().toString();P="";var e=0;for(b=Z.length;e<b;e+=1)P+="Reg:"+Z[e]+" = 0x"+Sa(ba[Z[e]]).toUpperCase()+"\n";0<sb&&(P+="LXT:"+sb+"\n");0<fb&&(P+=a+":"+fb+"\n");0<Pb&&(P+="RTC32k:"+Pb+"\n");0<ia&&(P+=d+":"+ia+"\n");0<cb&&(P+="PLL2:"+cb+"\n");0<Ib&&(P+="PLL480M:"+Ib+"\n");0<Wa&&(P+="APLL:"+Wa+"\n");0<Yb&&(P+="HSUSB_OTG_PHY:"+Yb+"\n");P+="Step:"+gb+"\n"},concatenate_generated_code:function(){Kc();kd();zd()},concatenate_generated_modularizedCode:function(){Kc("modularizeCode");
zd()},pageRefresh:function(){var b,a;jd(function(){if(td){td=!1;uc();NUTOOL_CLOCK.g_readConfigFilePath="dummyPath";Z=Ab(NUTOOL_CLOCK.g_register_map_default);ba=[];b=0;for(a=Z.length;b<a;b+=1)ba[Z[b]]=parseInt(NUTOOL_CLOCK.g_register_map_default[Z[b]],16);Gc()}Rc()})},switchD3ClockTree:function(){null!==Ha&&(Mc=!Mc,wd(gb-1-1),$("#tabs").tabs({active:gb-1}))},zoomIn:function(){null!==Ha&&(xc+=.3,Ha.selectAll("g.node").on("zoomFromToolbar")(xc))},bestFit:function(){null!==Ha&&(xc=1,Ha.selectAll("g.node").on("zoomFromToolbar")(1))},
zoomOut:function(){null!==Ha&&(xc-=.3,0>=xc&&(xc=.3),Ha.selectAll("g.node").on("zoomFromToolbar")(xc))},uncheckAllNodes:function(){null!==Ha&&jd(function(){Md();Rc()})},setLanguage:function(){var b="",a="",d="",e,h,f,g,m,D,k,L,H,W,E,w,q,A,R,S,c,na="PLL".toEquivalent().toString();if("Simplified Chinese"===T){var u="\u8bbe\u5b9a";var n="\u4ece\u4e0b\u9762\u9009\u53d6\u4e00\u4e2a\u8bed\u8a00\u663e\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002";var M="\u82f1\u6587";var F="\u7b80\u4f53\u4e2d\u6587";
var ka="\u7e41\u4f53\u4e2d\u6587";a="checked";var O="\u786e\u5b9a";var wa="\u79bb\u5f00"}else"Traditional Chinese"===T?(u="\u8a2d\u5b9a",n="\u5f9e\u4e0b\u9762\u9078\u53d6\u4e00\u500b\u8a9e\u8a00\u986f\u793a\u5728\u64cd\u4f5c\u4ecb\u9762\u4e0a\u3002",M="\u82f1\u6587",F="\u7b80\u9ad4\u4e2d\u6587",ka="\u7e41\u9ad4\u4e2d\u6587",d="checked",O="\u78ba\u5b9a",wa="\u96e2\u958b"):(u="Settings",n="Select one of the following languages displayed in UI.",M="English",F="Simplified Chinese",ka="Traditional Chinese",
b="checked",O="Confirm",wa="Leave");$("#languageDialog").is(":visible")&&$("#languageDialog").dialog("destroy");$('<div id="languageDialog"><p>'+n+'</p><input type="radio" id="engiish" value="English" name="UIlanguage" '+b+'><label for="engiish">'+M+'</label><br /><input type="radio" id="simplifiedChinese" value="Simplified Chinese" name="UIlanguage" '+a+'><label for="simplifiedChinese">'+F+'</label><br /><input type="radio" id="traditionalChinese" value="Traditional Chinese" name="UIlanguage" '+
d+'><label for="traditionalChinese">'+ka+'</label><br /><input type="text" size="1" style="position:relative;top:-5000px;"/></div>').dialog({modal:!1,draggable:!1,resizable:!1,title:u,width:500,height:"auto",show:"fade",hide:"fade",buttons:[{text:O,click:function(){$("input").each(function(){if(!0===this.checked&&"on"!==$(this).val()){$(this).val();T=$(this).val();-1!==T.indexOf("Simplified")?(e="\u578b\u53f7",h="\u6676\u7247\u7cfb\u5217:",f="Clock\u5bc4\u5b58\u5668",g="\u641c\u5bfb\u6a21\u5757",
m="\u542f\u7528",D="\u505c\u7528",k="\u7b49\u5f85",L="\u5468\u671f",H="",W="\u6a21\u5757",E="\u7684\u65f6\u8109\u9891\u7387: ",w="\u4e0b\u4e00\u6b65",q="\u57fa\u7840\u65f6\u8109\u6e90",A=na,R="\u6a21\u5757",S="\u6ca1\u6709"+na+"\u76f8\u5173\u7684\u65f6\u8109\u6e90\u53ef\u4f9b\u4f7f\u7528\u3002",c="\u8f93\u5165\u671f\u671b\u503c"):-1!==T.indexOf("Traditional")?(e="\u578b\u865f",h="\u6676\u7247\u7cfb\u5217:",f="Clock\u6682\u5b58\u5668",g="\u641c\u5c0b\u6a21\u7d44",m="\u555f\u7528",D="\u505c\u7528",
k="\u7b49\u5f85",L="\u9031\u671f",H="",W="\u6a21\u7d44",E="\u7684\u6642\u8108\u983b\u7387: ",w="\u4e0b\u4e00\u6b65",q="\u57fa\u790e\u6642\u8108\u6e90",A=na,R="\u6a21\u7d44",S="\u6c92\u6709"+na+"\u76f8\u95dc\u7684\u6642\u8108\u6e90\u53ef\u4f9b\u4f7f\u7528\u3002",c="\u8f38\u5165\u671f\u671b\u503c"):(e="Part No.",h="Chip Series:",f="Clock Registers",g="Search Module",m="Enable",D="Disable",k="Wait",L="cycles",W=H="The clock of ",E=": ",w="Next Step",q="Base Clocks",A=na,R="Module",S="There are no "+
na+"-related clock sources available.",c="Input the expected value");$("#MCU_span").text(e);$("#ChipType_span").text(h);$("#clockRegsTree").jstree("rename_node",$("#clock_tree"),f);$("#searchModule_span").text(g);$(".enable_span").text(m);$(".disable_span").text(D);$(".wait_span").text(k);$(".cycles_span").text(L);$(".specificRealOutput_before_span").text(H);$(".realOutput_before_span").text(W);$(".realOutput_after_span").text(E);$("#add-tab-1")[0]&&($("#add-tab-1")[0].innerHTML=w);$("#add-tab-2")[0]&&
($("#add-tab-2")[0].innerHTML=w);$("#add-tab-3")[0]&&($("#add-tab-3")[0].innerHTML=w);$("#base_clocks_span").text(q);$("#pll_clocks_span").text(A);$("#module_span").text(R);$("#no_pll_span").text(S);$("[title]").prop("title",c);$("#searchInput").css({left:$("#searchModule_span").width()+10+"px"});$("#searchInput").css("width",ab-16-$("#searchModule_span").width()-10+"px");try{window.external.saveUIlanguage("UIlanguage:"+T)}catch(C){}$("#languageDialog").is(":visible")&&$("#languageDialog").dialog("destroy")}})}},
{text:wa,click:function(){""===T&&(T="English");$(this).is(":visible")&&$(this).dialog("destroy")}}],close:function(){$(this).dialog("destroy")}})},changeUIlanguage:function(){var b="PLL".toEquivalent().toString();Qc();if(-1!==T.indexOf("Simplified")){var a="\u578b\u53f7";var d="\u6676\u7247\u7cfb\u5217:";var e="Clock\u5bc4\u5b58\u5668";var h="\u641c\u5bfb\u6a21\u5757";var f="\u542f\u7528";var g="\u505c\u7528";var m="\u7b49\u5f85";var D="\u5468\u671f";var k="";var L="\u6a21\u5757";var H="\u7684\u65f6\u8109\u9891\u7387: ";
var W="\u4e0b\u4e00\u6b65";var E="\u57fa\u7840\u65f6\u8109\u6e90";var w=b;var q="\u6a21\u5757";b="\u6ca1\u6709"+b+"\u76f8\u5173\u7684\u65f6\u8109\u6e90\u53ef\u4f9b\u4f7f\u7528\u3002";var A="\u8f93\u5165\u671f\u671b\u503c"}else-1!==T.indexOf("Traditional")?(a="\u578b\u865f",d="\u6676\u7247\u7cfb\u5217:",e="Clock\u6682\u5b58\u5668",h="\u641c\u5c0b\u6a21\u7d44",f="\u555f\u7528",g="\u505c\u7528",m="\u7b49\u5f85",D="\u9031\u671f",k="",L="\u6a21\u7d44",H="\u7684\u6642\u8108\u983b\u7387: ",W="\u4e0b\u4e00\u6b65",
E="\u57fa\u790e\u6642\u8108\u6e90",w=b,q="\u6a21\u7d44",b="\u6c92\u6709"+b+"\u76f8\u95dc\u7684\u6642\u8108\u6e90\u53ef\u4f9b\u4f7f\u7528\u3002",A="\u8f38\u5165\u671f\u671b\u503c"):(a="Part No.",d="Chip Series:",e="Clock Registers",h="Search Module",f="Enable",g="Disable",m="Wait",D="cycles",L=k="The clock of ",H=": ",W="Next Step",E="Base Clocks",w=b,q="Module",b="There are no "+b+"-related clock sources available.",A="Input the expected value");$("#MCU_span").text(a);$("#ChipType_span").text(d);
$("#clockRegsTree").jstree("rename_node",$("#clock_tree"),e);$("#searchModule_span").text(h);$(".enable_span").text(f);$(".disable_span").text(g);$(".wait_span").text(m);$(".cycles_span").text(D);$(".specificRealOutput_before_span").text(k);$(".realOutput_before_span").text(L);$(".realOutput_after_span").text(H);$("#add-tab-1")[0]&&($("#add-tab-1")[0].innerHTML=W);$("#add-tab-2")[0]&&($("#add-tab-2")[0].innerHTML=W);$("#add-tab-3")[0]&&($("#add-tab-3")[0].innerHTML=W);$("#base_clocks_span").text(E);
$("#pll_clocks_span").text(w);$("#module_span").text(q);$("#no_pll_span").text(b);$("[title]").prop("title",A);$("#searchInput").css({left:$("#searchModule_span").width()+10+"px"});$("#searchInput").css("width",ab-16-$("#searchModule_span").width()-10+"px")},executePDFfail:function(){Rb("\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.")},handleEnter:function(){$("#"+Kd).change()},redrawForResizingDialog:function(){var b=$("#tabs");vd();"none"!==$("#clockRegsTree").css("display")?(b.css("width",mb-ab-8+"px"),b.css({left:ab+8+"px"})):(b.css("width",mb-8+"px"),b.css({left:"0px"}));b.css("height",Xb-8+"px");$("#tab-4").css("width",mb-ab-8+"px");$("#tab-4").css("height",Xb-8+"px")},recordConfig:Rc,closeAPP:function(){id(Vd)&&jd(function(){try{window.external.closeFromJS()}catch(b){}})},
g_readConfigFilePath:"",g_clockFunctionString:""}})();
