text:
="13.731" y1="10.381" x2="13.731" y2="9.981" width="0.1524" layer="16"/>
<wire x1="11.9" y1="12" x2="12.781" y2="12.881" width="0.1524" layer="16"/>
<wire x1="12.781" y1="12.881" x2="12.781" y2="13.731" width="0.1524" layer="16"/>
<wire x1="12.781" y1="13.731" x2="13.081" y2="13.731" width="0.1524" layer="16"/>
<wire x1="14.981" y1="8.431" x2="14.981" y2="8.481" width="0.1524" layer="16"/>
<wire x1="14.981" y1="8.481" x2="14.781" y2="8.481" width="0.1524" layer="16"/>
<contactref element="U5" pad="1"/>
<contactref element="L1" pad="P$2"/>
<contactref element="C7" pad="1"/>
<wire x1="14.081" y1="9.181" x2="13.119" y2="9.181" width="0.1524" layer="16"/>
<wire x1="13.119" y1="9.181" x2="12.7" y2="9.6" width="0.1524" layer="16"/>
<wire x1="12.781" y1="8.881" x2="11.819" y2="8.881" width="0.1524" layer="16"/>
<wire x1="11.819" y1="8.881" x2="11.1" y2="9.6" width="0.1524" layer="16"/>
<wire x1="16.581" y1="8.431" x2="14.981" y2="8.431" width="0.1524" layer="16"/>
<wire x1="3.8" y1="3.65" x2="5.95" y2="3.65" width="0.381" layer="1"/>
<wire x1="5.95" y1="3.65" x2="5.981" y2="3.681" width="0.381" layer="1"/>
<wire x1="5.981" y1="3.681" x2="6.1" y2="3.562" width="0.381" layer="1"/>
<wire x1="6.1" y1="3.562" x2="6.1" y2="2.2" width="0.381" layer="1"/>
<wire x1="6.1" y1="2.2" x2="6.581" y2="1.719" width="0.381" layer="1"/>
<wire x1="6.581" y1="1.719" x2="6.581" y2="1.481" width="0.381" layer="1"/>
<polygon width="0.1524" layer="15">
<vertex x="-1.143" y="24.384"/>
<vertex x="35.052" y="24.384"/>
<vertex x="35.052" y="-1.143"/>
<vertex x="-1.143" y="-1.143"/>
</polygon>
<via x="5.3" y="4.7" extent="1-16" drill="0.254"/>
<via x="6" y="4.7" extent="1-16" drill="0.254"/>
<via x="6.7" y="4.7" extent="1-16" drill="0.254"/>
<polygon width="0.1524" layer="1" thermals="no">
<vertex x="5" y="3.2"/>
<vertex x="6.9" y="3.2"/>
<vertex x="6.9" y="4.9"/>
<vertex x="5" y="4.9"/>
</polygon>
<wire x1="24.7" y1="3.625" x2="24.7" y2="2.9" width="0.1524" layer="1"/>
<wire x1="24.7" y1="2.9" x2="24.4" y2="2.6" width="0.1524" layer="1"/>
<via x="24.4" y="2.6" extent="1-16" drill="0.254"/>
<wire x1="24.7" y1="18.025" x2="24.7" y2="17.3" width="0.1524" layer="1"/>
<wire x1="24.7" y1="17.3" x2="24.4" y2="17" width="0.1524" layer="1"/>
<via x="24.4" y="17" extent="1-16" drill="0.254"/>
<wire x1="5.831" y1="20.581" x2="5.831" y2="19.781" width="0.1524" layer="16"/>
<wire x1="5.831" y1="18.881" x2="5.831" y2="19.781" width="0.1524" layer="16"/>
<via x="4.9" y="20.9" extent="1-16" drill="0.254"/>
<wire x1="5.831" y1="20.581" x2="5.219" y2="20.581" width="0.1524" layer="16"/>
<wire x1="5.219" y1="20.581" x2="4.9" y2="20.9" width="0.1524" layer="16"/>
</signal>
<signal name="5V">
<contactref element="U4" pad="3"/>
<contactref element="U2" pad="3"/>
<contactref element="C1" pad="1"/>
<contactref element="C2" pad="1"/>
<contactref element="U3" pad="8"/>
<contactref element="C3" pad="1"/>
<contactref element="F1" pad="P$2"/>
<contactref element="U5" pad="4"/>
<contactref element="U5" pad="5"/>
<contactref element="U5" pad="6"/>
<contactref element="C6" pad="1"/>
<wire x1="22.856" y1="8.831" x2="22.856" y2="10.056" width="0.4064" layer="1"/>
<wire x1="22.856" y1="10.056" x2="23.891" y2="11.091" width="0.4064" layer="1"/>
<wire x1="23.891" y1="11.091" x2="24.801" y2="11.091" width="0.4064" layer="1"/>
<wire x1="19.999" y1="4.199" x2="20.175" y2="4.275" width="0.4064" layer="1"/>
<wire x1="20.175" y1="4.275" x2="21.7" y2="4.275" width="0.4064" layer="1"/>
<wire x1="20.201" y1="18.811" x2="20.337" y2="18.675" width="0.4064" layer="1"/>
<wire x1="20.337" y1="18.675" x2="21.7" y2="18.675" width="0.4064" layer="1"/>
<via x="2.7" y="19.7" extent="1-16" drill="0.4064" diameter="0.8128"/>
<via x="2.7" y="18.7" extent="1-16" drill="0.4064" diameter="0.8128"/>
<polygon width="0.1524" layer="1" thermals="no">
<vertex x="1.2" y="20"/>
<vertex x="3.1" y="20"/>
<vertex x="3.1" y="18.4"/>
<vertex x="1.2" y="18.4"/>
</polygon>
<wire x1="2.7" y1="18.7" x2="2.7" y2="19.7" width="0.508" layer="16"/>
<wire x1="2.7" y1="18.7" x2="1" y2="17" width="0.508" layer="16"/>
<wire x1="1" y1="17" x2="1" y2="3.1" width="0.508" layer="16"/>
<wire x1="1" y1="3.1" x2="1.8" y2="2.3" width="0.508" layer="16"/>
<wire x1="1.8" y1="2.3" x2="2.4" y2="2.3" width="0.508" layer="16"/>
<via x="2.4" y="2.3" extent="1-16" drill="0.254"/>
<via x="1.8" y="2.3" extent="1-16" drill="0.254"/>
<wire x1="2.4" y1="2.3" x2="1.8" y2="2.3" width="0.508" layer="1"/>
<wire x1="1.8" y1="2.3" x2="0.95" y2="2.3" width="0.508" layer="1"/>
<wire x1="0.95" y1="2.3" x2="0.881" y2="2.231" width="0.508" layer="1"/>
<wire x1="0.881" y1="2.231" x2="1" y2="2.35" width="0.508" layer="1"/>
<wire x1="1" y1="2.35" x2="1" y2="3.65" width="0.508" layer="1"/>
<wire x1="1" y1="3.65" x2="1" y2="4.6" width="0.508" layer="1"/>
<wire x1="1" y1="4.6" x2="1" y2="5.55" width="0.508" layer="1"/>
<wire x1="2.7" y1="19.7" x2="2.7" y2="20.8" width="0.4064" layer="15"/>
<wire x1="2.7" y1="20.8" x2="4.4" y2="22.5" width="0.4064" layer="15"/>
<wire x1="4.4" y1="22.5" x2="20" y2="22.5" width="0.4064" layer="15"/>
<wire x1="20.201" y1="18.811" x2="20" y2="19.012" width="0.4064" layer="1"/>
<wire x1="20" y1="19.012" x2="20" y2="22.5" width="0.4064" layer="1"/>
<via x="20" y="22.5" extent="1-16" drill="0.254"/>
<via x="25.8" y="10.8" extent="1-16" drill="0.254"/>
<via x="19" y="4.3" extent="1-16" drill="0.254"/>
<wire x1="20" y1="22.5" x2="31" y2="22.5" width="0.4064" layer="15"/>
<wire x1="31" y1="22.5" x2="32.3" y2="21.2" width="0.4064" layer="15"/>
<wire x1="32.3" y1="21.2" x2="32.3" y2="11.1" width="0.4064" layer="15"/>
<wire x1="32.3" y1="11.1" x2="32.3" y2="10.8" width="0.4064" layer="15"/>
<wire x1="32.3" y1="10.8" x2="32.3" y2="10.5" width="0.4064" layer="15"/>
<wire x1="32.3" y1="10.5" x2="32.3" y2="2.3" width="0.4064" layer="15"/>
<wire x1="32.3" y1="2.3" x2="31" y2="1" width="0.4064" layer="15"/>
<wire x1="31" y1="1" x2="22.3" y2="1" width="0.4064" layer="15"/>
<wire x1="22.3" y1="1" x2="19" y2="4.3" width="0.4064" layer="15"/>
<wire x1="19.999" y1="4.199" x2="19.898" y2="4.3" width="0.4064" layer="1"/>
<wire x1="19.898" y1="4.3" x2="19" y2="4.3" width="0.4064" layer="1"/>
<wire x1="24.801" y1="11.091" x2="25.509" y2="11.091" width="0.4064" layer="1"/>
<wire x1="25.509" y1="11.091" x2="25.8" y2="10.8" width="0.4064" layer="1"/>
<wire x1="25.8" y1="10.8" x2="32" y2="10.8" width="0.4064" layer="15"/>
<wire x1="32" y1="10.8" x2="32.3" y2="10.8" width="0.4064" layer="15"/>
<wire x1="32.3" y1="11.1" x2="32" y2="10.8" width="0.4064" layer="15"/>
<wire x1="32" y1="10.8" x2="32.3" y2="10.5" width="0.4064" layer="15"/>
</signal>
<signal name="CANTX0">
<contactref element="U1" pad="H1"/>
<wire x1="14.7" y1="8.4" x2="15.081" y2="7.981" width="0.1524" layer="1"/>
<wire x1="15.081" y1="7.981" x2="17.681" y2="7.981" width="0.1524" layer="1"/>
<contactref element="U4" pad="1"/>
<wire x1="17.681" y1="7.981" x2="20.087" y2="5.575" width="0.1524" layer="1"/>
<wire x1="20.087" y1="5.575" x2="21.7" y2="5.575" width="0.1524" layer="1"/>
</signal>
<signal name="CANRX0">
<contactref element="U1" pad="H2"/>
<wire x1="14.7" y1="9.2" x2="15.081" y2="8.781" width="0.1524" layer="1"/>
<wire x1="15.081" y1="8.781" x2="18.381" y2="8.781" width="0.1524" layer="1"/>
<contactref element="U4" pad="4"/>
<wire x1="18.381" y1="8.781" x2="19.1" y2="8.062" width="0.1524" layer="1"/>
<via x="19.1" y="8.062" extent="1-16" drill="0.254"/>
<wire x1="19.1" y1="8.062" x2="22.2" y2="4.962" width="0.1524" layer="16"/>
<wire x1="22.2" y1="4.962" x2="22.2" y2="2.3" width="0.1524" layer="16"/>
<via x="22.2" y="2.3" extent="1-16" drill="0.254"/>
<wire x1="22.2" y1="2.3" x2="21.7" y2="2.8" width="0.1524" layer="1"/>
<wire x1="21.7" y1="2.8" x2="21.7" y2="3.625" width="0.1524" layer="1"/>
</signal>
<signal name="CANTX1">
<contactref element="U1" pad="E10"/>
<wire x1="12.3" y1="15.6" x2="12.681" y2="15.181" width="0.1524" layer="1"/>
<wire x1="12.681" y1="15.181" x2="12.681" y2="13.781" width="0.1524" layer="1"/>
<wire x1="12.681" y1="13.781" x2="12.881" y2="13.581" width="0.1524" layer="1"/>
<wire x1="18.5" y1="14.9" x2="17.181" y2="13.581" width="0.1524" layer="1"/>
<wire x1="17.181" y1="13.581" x2="12.881" y2="13.581" width="0.1524" layer="1"/>
<contactref element="U2" pad="1"/>
<wire x1="21.7" y1="19.975" x2="21.7" y2="20.4" width="0.1524" layer="1"/>
<wire x1="21.7" y1="20.4" x2="21.5" y2="20.6" width="0.1524" layer="1"/>
<wire x1="21.5" y1="20.6" x2="20.6" y2="20.6" width="0.1524" layer="1"/>
<via x="20.6" y="20.6" extent="1-16" drill="0.254"/>
<wire x1="20.6" y1="20.6" x2="19.5" y2="20.6" width="0.1524" layer="16"/>
<wire x1="19.5" y1="20.6" x2="18.5" y2="19.6" width="0.1524" layer="16"/>
<wire x1="18.5" y1="19.6" x2="18.5" y2="14.9" width="0.1524" layer="16"/>
<via x="18.5" y="14.9" extent="1-16" drill="0.254"/>
</signal>
<signal name="CANRX1">
<contactref element="U1" pad="J7"/>
<wire x1="15.5" y1="13.2" x2="15.881" y2="12.781" width="0.1524" layer="1"/>
<wire x1="19.3" y1="14.2" x2="17.881" y2="12.781" width="0.1524" layer="1"/>
<wire x1="17.881" y1="12.781" x2="15.881" y2="12.781" width="0.1524" layer="1"/>
<contactref element="U2" pad="4"/>
<wire x1="21.7" y1="18.025" x2="21.7" y2="17.2" width="0.1524" layer="1"/>
<wire x1="21.7" y1="17.2" x2="21.4" y2="16.9" width="0.1524" layer="1"/>
<via x="21.4" y="16.9" extent="1-16" drill="0.254"/>
<wire x1="21.4" y1="16.9" x2="20.2" y2="16.9" width="0.1524" layer="16"/>
<wire x1="20.2" y1="16.9" x2="19.3" y2="16" width="0.1524" layer="16"/>
<wire x1="19.3" y1="16" x2="19.3" y2="14.2" width="0.1524" layer="16"/>
<via x="19.3" y="14.2" extent="1-16" drill="0.254"/>
</signal>
<signal name="GND">
<contactref element="U4" pad="2"/>
<contactref element="U4" pad="PAD"/>
<contactref element="U2" pad="2"/>
<contactref element="U2" pad="PAD"/>
<contactref element="C1" pad="2"/>
<contactref element="C2" pad="2"/>
<contactref element="U3" pad="4"/>
<contactref element="C3" pad="2"/>
<contactref element="C4" pad="2"/>
<contactref element="C5" pad="2"/>
<contactref element="Y1" pad="2"/>
<contactref element="Y1" pad="4"/>
<contactref element="C6" pad="2"/>
<contactref element="J1" pad="5"/>
<contactref element="J1" pad="P$6"/>
<contactref element="J1" pad="P$7"/>
<contactref element="J1" pad="P$8"/>
<contactref element="J1" pad="P$9"/>
<contactref element="J1" pad="P$10"/>
<contactref element="J1" pad="P$11"/>
<contactref element="U1" pad="E7"/>
<contactref element="U1" pad="E4"/>
<contactref element="U1" pad="C4"/>
<contactref element="U1" pad="A8"/>
<contactref element="U1" pad="D4"/>
<contactref element="U1" pad="F6"/>
<contactref element="U1" pad="F5"/>
<contactref element="U1" pad="F4"/>
<contactref element="U2" pad="8"/>
<contactref element="U4" pad="8"/>
<contactref element="R5" pad="1"/>
<contactref element="C12" pad="2"/>
<contactref element="J6" pad="3"/>
<contactref element="J6" pad="5"/>
<contactref element="C13" pad="2"/>
<contactref element="C14" pad="2"/>
<contactref element="C15" pad="2"/>
<contactref element="C16" pad="2"/>
<contactref element="C17" pad="2"/>
<contactref element="C18" pad="2"/>
<contactref element="C19" pad="2"/>
<contactref element="C20" pad="2"/>
<contactref element="C21" pad="2"/>
<contactref element="C22" pad="2"/>
<contactref element="C23" pad="2"/>
<contactref element="C24" pad="2"/>
<contactref element="C25" pad="2"/>
<contactref element="C26" pad="2"/>
<contactref element="U5" pad="PAD"/>
<contactref element="U5" pad="2"/>
<contactref element="C7" pad="2"/>
<contactref element="J3" pad="3"/>
<polygon width="0.1524" layer="2">
<vertex x="-0.762" y="24.003"/>
<vertex x="34.671" y="24.003"/>
<vertex x="34.671" y="-0.762"/>
<vertex x="-0.762" y="-0.762"/>
</polygon>
<wire x1="24.801" y1="12.591" x2="25.409" y2="12.591" width="0.1524" layer="1"/>
<wire x1="25.409" y1="12.591" x2="25.8" y2="12.2" width="0.1524" layer="1"/>
<via x="25.8" y="12.2" extent="1-16" drill="0.254"/>
<via x="20.6" y="16.2" extent="1-16" drill="0.254"/>
<via x="19.2" y="17" extent="1-16" drill="0.254"/>
<via x="20.6" y="19.8" extent="1-16" drill="0.254"/>
<via x="20.6" y="5" extent="1-16" drill="0.254"/>
<via x="19" y="2.3" extent="1-16" drill="0.254"/>
<via x="2.4" y="1.4" extent="1-16" drill="0.254"/>
<via x="1.8" y="1.4" extent="1-16" drill="0.254"/>
<via x="2.8" y="5.4" extent="1-16" drill="0.254"/>
<via x="2" y="5.4" extent="1-16" drill="0.254"/>
<via x="2.8" y="4.6" extent="1-16" drill="0.254"/>
<via x="2" y="4.6" extent="1-16" drill="0.254"/>
<via x="2.8" y="3.8" extent="1-16" drill="0.254"/>
<via x="2" y="3.8" extent="1-16" drill="0.254"/>
<via x="7.5" y="5" extent="1-16" drill="0.254"/>
<via x="14.9" y="4.4" extent="1-16" drill="0.254"/>
<via x="6.7" y="9.7" extent="1-16" drill="0.254"/>
<via x="6.1" y="9.7" extent="1-16" drill="0.254"/>
<via x="11.9" y="12.8" extent="1-16" drill="0.254"/>
<via x="12.7" y="12" extent="1-16" drill="0.254"/>
<via x="11.9" y="10.4" extent="1-16" drill="0.254"/>
<via x="13.5" y="11.2" extent="1-16" drill="0.254"/>
<via x="11.1" y="11.2" extent="1-16" drill="0.254"/>
<via x="11.1" y="10.4" extent="1-16" drill="0.254"/>
<wire x1="10.7" y1="10.8" x2="11.1" y2="10.4" width="0.1524" layer="1"/>
<wire x1="11.5" y1="10.8" x2="11.1" y2="11.2" width="0.1524" layer="1"/>
<wire x1="12.3" y1="10.8" x2="11.9" y2="10.4" width="0.1524" layer="1"/>
<wire x1="13.1" y1="11.6" x2="13.5" y2="11.2" width="0.1524" layer="1"/>
<wire x1="13.1" y1="12.4" x2="12.7" y2="12" width="0.1524" layer="1"/>
<wire x1="12.3" y1="13.2" x2="11.9" y2="12.8" width="0.1524" layer="1"/>
<via x="10.3" y="15.2" extent="1-16" drill="0.254"/>
<via x="14.3" y="15.2" extent="1-16" drill="0.254"/>
<via x="15.9" y="14.4" extent="1-16" drill="0.254"/>
<via x="16.8" y="11.9" extent="1-16" drill="0.254"/>
<via x="15.9" y="10.4" extent="1-16" drill="0.254"/>
<via x="17.6" y="6.7" extent="1-16" drill="0.254"/>
<via x="15.8" y="6" extent="1-16" drill="0.254"/>
<via x="14.2" y="6.1" extent="1-16" drill="0.254"/>
<wire x1="11.481" y1="15.231" x2="10.331" y2="15.231" width="0.1524" layer="16"/>
<wire x1="10.331" y1="15.231" x2="10.3" y2="15.2" width="0.1524" layer="16"/>
<wire x1="13.081" y1="15.231" x2="14.269" y2="15.231" width="0.1524" layer="16"/>
<wire x1="14.269" y1="15.231" x2="14.3" y2="15.2" width="0.1524" layer="16"/>
<wire x1="16.031" y1="13.181" x2="16.031" y2="14.269" width="0.1524" layer="16"/>
<wire x1="16.031" y1="14.269" x2="15.9" y2="14.4" width="0.1524" layer="16"/>
<wire x1="16.031" y1="11.581" x2="16.031" y2="11.9" width="0.1524" layer="16"/>
<wire x1="16.031" y1="11.9" x2="16.8" y2="11.9" width="0.1524" layer="16"/>
<wire x1="15.231" y1="9.981" x2="15.4" y2="9.981" width="0.1524" layer="16"/>
<wire x1="15.4" y1="9.981" x2="15.4" y2="10.2" width="0.1524" layer="16"/>
<wire x1="15.4" y1="10.2" x2="15.7" y2="10.2" width="0.1524" layer="16"/>
<wire x1="15.7" y1="10.2" x2="15.9" y2="10.4" width="0.1524" layer="16"/>
<wire x1="16.581" y1="6.931" x2="17.369" y2="6.931" width="0.1524" layer="16"/>
<wire x1="17.369" y1="6.931" x2="17.6" y2="6.7" width="0.1524" layer="16"/>
<wire x1="14.981" y1="6.931" x2="15.169" y2="6.931" width="0.1524" layer="16"/>
<wire x1="15.169" y1="6.931" x2="15.8" y2="6.3" width="0.1524" layer="16"/>
<wire x1="15.8" y1="6.3" x2="15.8" y2="6" width="0.1524" layer="16"/>
<wire x1="13.381" y1="6.931" x2="13.569" y2="6.931" width="0.1524" layer="16"/>
<wire x1="13.569" y1="6.931" x2="14.2" y2="6.3" width="0.1524" layer="16"/>
<wire x1="14.2" y1="6.3" x2="14.2" y2="6.1" width="0.1524" layer="16"/>
<wire x1="11.931" y1="7.981" x2="11.931" y2="6.381" width="0.1524" layer="16"/>
<via x="11.1" y="8.8" extent="1-16" drill="0.254"/>
<wire x1="11.931" y1="7.981" x2="11.931" y2="8.069" width="0.1524" layer="16"/>
<wire x1="11.931" y1="8.069" x2="11.2" y2="8.8" width="0.1524" layer="16"/>
<wire x1="11.2" y1="8.8" x2="11.1" y2="8.8" width="0.1524" layer="16"/>
<wire x1="8.381" y1="5.531" x2="8.231" y2="5.531" width="0.1524" layer="1"/>
<wire x1="8.231" y1="5.531" x2="7.7" y2="5" width="0.1524" layer="1"/>
<wire x1="7.7" y1="5" x2="7.5" y2="5" width="0.1524" layer="1"/>
<wire x1="13.981" y1="3.831" x2="14.131" y2="3.831" width="0.1524" layer="1"/>
<wire x1="14.131" y1="3.831" x2="14.7" y2="4.4" width="0.1524" layer="1"/>
<wire x1="14.7" y1="4.4" x2="14.9" y2="4.4" width="0.1524" layer="1"/>
<wire x1="12.281" y1="3.981" x2="12.431" y2="3.831" width="0.1524" layer="1"/>
<wire x1="12.431" y1="3.831" x2="13.981" y2="3.831" width="0.1524" layer="1"/>
<wire x1="10.081" y1="5.581" x2="10.031" y2="5.531" width="0.1524" layer="1"/>
<wire x1="10.031" y1="5.531" x2="8.381" y2="5.531" width="0.1524" layer="1"/>
<wire x1="21.7" y1="4.925" x2="21.687" y2="5" width="0.1524" layer="1"/>
<wire x1="21.687" y1="5" x2="20.6" y2="5" width="0.1524" layer="1"/>
<via x="23.6" y="5.2" extent="1-16" drill="0.254"/>
<via x="23.6" y="4.6" extent="1-16" drill="0.254"/>
<via x="23.6" y="4" extent="1-16" drill="0.254"/>
<via x="22.8" y="4" extent="1-16" drill="0.254"/>
<via x="22.8" y="4.6" extent="1-16" drill="0.254"/>
<via x="22.8" y="5.2" extent="1-16" drill="0.254"/>
<via x="25.6" y="6.2" extent="1-16" drill="0.254"/>
<via x="25.6" y="20.4" extent="1-16" drill="0.254"/>
<wire x1="24.7" y1="19.975" x2="25.175" y2="19.975" width="0.1524" layer="1"/>
<wire x1="25.175" y1="19.975" x2="25.6" y2="20.4" width="0.1524" layer="1"/>
<wire x1="24.7" y1="5.575" x2="24.975" y2="5.575" width="0.1524" layer="1"/>
<wire x1="24.975" y1="5.575" x2="25.6" y2="6.2" width="0.1524" layer="1"/>
<via x="23.6" y="19" extent="1-16" drill="0.254"/>
<via x="23.6" y="19.6" extent="1-16" drill="0.254"/>
<via x="23.6" y="18.4" extent="1-16" drill="0.254"/>
<via x="22.8" y="18.4" extent="1-16" drill="0.254"/>
<via x="22.8" y="19" extent="1-16" drill="0.254"/>
<via x="22.8" y="19.6" extent="1-16" drill="0.254"/>
<wire x1="21.7" y1="19.325" x2="21.075" y2="19.325" width="0.1524" layer="1"/>
<wire x1="21.075" y1="19.325" x2="20.6" y2="19.8" width="0.1524" layer="1"/>
<wire x1="20.201" y1="17.311" x2="19.511" y2="17.311" width="0.1524" layer="1"/>
<wire x1="19.511" y1="17.311" x2="19.2" y2="17" width="0.1524" layer="1"/>
<wire x1="20.906" y1="14.731" x2="20.906" y2="15.894" width="0.1524" layer="1"/>
<wire x1="20.906" y1="15.894" x2="20.6" y2="16.2" width="0.1524" layer="1"/>
<wire x1="19" y1="2.3" x2="19.4" y2="2.3" width="0.1524" layer="1"/>
<wire x1="19.4" y1="2.3" x2="19.799" y2="2.599" width="0.1524" layer="1"/>
<wire x1="19.799" y1="2.599" x2="19.999" y2="2.699" width="0.1524" layer="1"/>
<wire x1="0.881" y1="0.731" x2="1.031" y2="0.731" width="0.1524" layer="1"/>
<wire x1="1.031" y1="0.731" x2="1.7" y2="1.4" width="0.1524" layer="1"/>
<wire x1="1.7" y1="1.4" x2="1.8" y2="1.4" width="0.1524" layer="1"/>
<wire x1="2.4" y1="1.4" x2="3.5" y2="1.4" width="0.1524" layer="1"/>
<wire x1="3.5" y1="1.4" x2="3.581" y2="1.481" width="0.1524" layer="1"/>
<wire x1="4.581" y1="10.681" x2="5.519" y2="10.681" width="0.381" layer="1"/>
<wire x1="5.519" y1="10.681" x2="6.1" y2="10.1" width="0.381" layer="1"/>
<wire x1="6.1" y1="10.1" x2="6.1" y2="9.7" width="0.381" layer="1"/>
<wire x1="6.1" y1="9.7" x2="6.7" y2="9.7" width="0.381" layer="1"/>
<wire x1="6.031" y1="6.981" x2="6.031" y2="8.581" width="0.1524" layer="16"/>
<wire x1="6.031" y1="8.581" x2="6.1" y2="8.65" width="0.1524" layer="16"/>
<wire x1="6.1" y1="8.65" x2="6.1" y2="9.7" width="0.1524" layer="16"/>
<via x="12.7" y="11.2" extent="1-16" drill="0.254"/>
<wire x1="13.1" y1="10.8" x2="12.7" y2="11.2" width="0.1524" layer="1"/>
<via x="8.4" y="14.8" extent="1-16" drill="0.254"/>
<wire x1="8.531" y1="13.881" x2="8.4" y2="14.012" width="0.1524" layer="16"/>
<wire x1="8.4" y1="14.012" x2="8.4" y2="14.8" width="0.1524" layer="16"/>
<via x="9.5" y="15.2" extent="1-16" drill="0.254"/>
<wire x1="9.1" y1="14" x2="9.5" y2="14.4" width="0.1524" layer="1"/>
<wire x1="9.5" y1="14.4" x2="9.5" y2="15.2" width="0.1524" layer="1"/>
<wire x1="8.981" y1="7.131" x2="8.831" y2="7.131" width="0.1524" layer="16"/>
<wire x1="8.831" y1="7.131" x2="8.4" y2="6.7" width="0.1524" layer="16"/>
<wire x1="8.4" y1="6.7" x2="8.4" y2="5.9" width="0.1524" layer="16"/>
<wire x1="8.4" y1="5.9" x2="7.5" y2="5" width="0.1524" layer="16"/>
<wire x1="7.731" y1="12.281" x2="7.731" y2="10.681" width="0.1524" layer="16"/>
<wire x1="7.731" y1="10.681" x2="7.731" y2="10.531" width="0.1524" layer="16"/>
<wire x1="7.731" y1="10.531" x2="6.9" y2="9.7" width="0.1524" layer="16"/>
<wire x1="6.9" y1="9.7" x2="6.7" y2="9.7" width="0.1524" layer="16"/>
<polygon width="0.1524" layer="16">
<vertex x="-1.524" y="24.765"/>
<vertex x="35.433" y="24.765"/>
<vertex x="35.433" y="-1.524"/>
<vertex x="-1.524" y="-1.524"/>
</polygon>
<polygon width="0.1524" layer="1" rank="2">
<vertex x="-0.381" y="-0.381"/>
<vertex x="34.29" y="-0.381"/>
<vertex x="34.29" y="23.622"/>
<vertex x="-0.381" y="23.622"/>
</polygon>
</signal>
<signal name="N$5">
<contactref element="U2" pad="7"/>
<contactref element="J4" pad="1"/>
<contactref element="U3" pad="2"/>
<wire x1="24.7" y1="19.325" x2="28.925" y2="19.325" width="0.4064" layer="1"/>
<wire x1="28.925" y1="19.325" x2="29.881" y2="20.281" width="0.4064" layer="1"/>
<wire x1="22.206" y1="14.731" x2="22.206" y2="13.406" width="0.4064" layer="1"/>
<wire x1="22.206" y1="13.406" x2="22.2" y2="13.4" width="0.4064" layer="1"/>
<via x="22.2" y="13.4" extent="1-16" drill="0.254"/>
<wire x1="22.2" y1="13.4" x2="23" y2="13.4" width="0.4064" layer="16"/>
<wire x1="23" y1="13.4" x2="29.881" y2="20.281" width="0.4064" layer="16"/>
</signal>
<signal name="N$6">
<contactref element="U2" pad="6"/>
<contactref element="J4" pad="2"/>
<contactref element="R1" pad="2"/>
<wire x1="24.801" y1="14.621" x2="29.221" y2="14.621" width="0.4064" layer="1"/>
<wire x1="29.221" y1="14.621" x2="29.881" y2="15.281" width="0.4064" layer="1"/>
<wire x1="24.7" y1="18.675" x2="26.487" y2="18.675" width="0.4064" layer="1"/>
<wire x1="26.487" y1="18.675" x2="29.881" y2="15.281" width="0.4064" layer="1"/>
</signal>
<signal name="N$7">
<contactref element="U4" pad="7"/>
<contactref element="J5" pad="1"/>
<contactref element="R2" pad="1"/>
<wire x1="24.801" y1="8.911" x2="28.87" y2="8.911" width="0.4064" layer="1"/>
<wire x1="28.87" y1="8.911" x2="29.881" y2="7.9" width="0.4064" layer="1"/>
<wire x1="24.7" y1="4.925" x2="26.906" y2="4.925" width="0.4064" layer="1"/>
<wire x1="26.906" y1="4.925" x2="29.881" y2="7.9" width="0.4064" layer="1"/>
</signal>
<signal name="N$8">
<contactref element="U4" pad="6"/>
<contactref element="J5" pad="2"/>
<contactref element="U3" pad="5"/>
<wire x1="24.7" y1="4.275" x2="28.506" y2="4.275" width="0.4064" layer="1"/>
<wire x1="28.506" y1="4.275" x2="29.881" y2="2.9" width="0.4064" layer="1"/>
<wire x1="20.906" y1="8.831" x2="20.906" y2="7.394" width="0.4064" layer="1"/>
<wire x1="20.906" y1="7.394" x2="21.1" y2="7.2" width="0.4064" layer="1"/>
<via x="21.1" y="7.2" extent="1-16" drill="0.254"/>
<wire x1="21.1" y1="7.2" x2="25.619" y2="7.2" width="0.4064" layer="16"/>
<wire x1="25.619" y1="7.2" x2="29.9" y2="2.919" width="0.4064" layer="16"/>
<wire x1="29.9" y1="2.919" x2="29.881" y2="2.9" width="0.4064" layer="16"/>
</signal>
<signal name="CAN_TERM">
<contactref element="U3" pad="1"/>
<contactref element="U3" pad="7"/>
<wire x1="22.856" y1="14.731" x2="22.856" y2="11.256" width="0.1524" layer="1"/>
<wire x1="22.856" y1="11.256" x2="22.206" y2="10.606" width="0.1524" layer="1"/>
<wire x1="22.206" y1="10.606" x2="22.206" y2="10.2" width="0.1524" layer="1"/>
<contactref element="U1" pad="K3"/>
<wire x1="22.206" y1="10.2" x2="22.206" y2="8.831" width="0.1524" layer="1"/>
<wire x1="16.3" y1="10" x2="16.5" y2="10.2" width="0.1524" layer="1"/>
<wire x1="16.5" y1="10.2" x2="22.1" y2="10.2" width="0.1524" layer="1"/>
<wire x1="22.1" y1="10.2" x2="22.206" y2="10.2" width="0.1524" layer="1"/>
<wire x1="22.2" y1="10.1" x2="22.1" y2="10.2" width="0.1524" layer="1"/>
<wire x1="22.1" y1="10.2" x2="22.2" y2="10.3" width="0.1524" layer="1"/>
</signal>
<signal name="N$1">
<contactref element="R1" pad="1"/>
<contactref element="U3" pad="3"/>
<wire x1="21.556" y1="14.731" x2="21.556" y2="15.756" width="0.381" layer="1"/>
<wire x1="24.801" y1="16.121" x2="21.921" y2="16.121" width="0.4064" layer="1"/>
<wire x1="21.921" y1="16.121" x2="21.556" y2="15.756" width="0.4064" layer="1"/>
</signal>
<signal name="N$2">
<contactref element="R2" pad="2"/>
<contactref element="U3" pad="6"/>
<wire x1="24.801" y1="7.411" x2="21.989" y2="7.411" width="0.4064" layer="1"/>
<wire x1="21.989" y1="7.411" x2="21.556" y2="7.844" width="0.4064" layer="1"/>
<wire x1="21.556" y1="7.844" x2="21.556" y2="8.831" width="0.381" layer="1"/>
</signal>
<signal name="N$3">
<contactref element="Y1" pad="1"/>
<contactref element="C4" pad="1"/>
<contactref element="U1" pad="A2"/>
<wire x1="11.181" y1="4.981" x2="10.681" y2="4.481" width="0.1524" layer="1"/>
<wire x1="10.681" y1="4.481" x2="10.581" y2="4.481" width="0.1524" layer="1"/>
<wire x1="10.581" y1="4.481" x2="10.081" y2="3.981" width="0.1524" layer="1"/>
<wire x1="8.381" y1="4.031" x2="10.081" y2="4.031" width="0.1524" layer="1"/>
<wire x1="10.081" y1="4.031" x2="10.081" y2="3.981" width="0.1524" layer="1"/>
<wire x1="11.181" y1="4.981" x2="11.181" y2="6.281" width="0.1524" layer="1"/>
<wire x1="11.181" y1="6.281" x2="10.881" y2="6.581" width="0.1524" layer="1"/>
<wire x1="10.881" y1="6.581" x2="9.381" y2="6.581" width="0.1524" layer="1"/>
<wire x1="9.381" y1="6.581" x2="8.681" y2="7.281" width="0.1524" layer="1"/>
<wire x1="8.681" y1="7.281" x2="8.681" y2="8.781" width="0.1524" layer="1"/>
<wire x1="8.681" y1="8.781" x2="9.1" y2="9.2" width="0.1524" layer="1"/>
</signal>
<signal name="N$4">
<contactref element="Y1" pad="3"/>
<contactref element="C5" pad="1"/>
<contactref element="U1" pad="A1"/>
<wire x1="13.981" y1="5.331" x2="12.281" y2="5.331" width="0.1524" layer="1"/>
<wire x1="12.281" y1="5.331" x2="12.281" y2="5.581" width="0.1524" layer="1"/>
<wire x1="12.281" y1="5.581" x2="11.681" y2="5.581" width="0.1524" layer="1"/>
<wire x1="11.681" y1="5.581" x2="11.681" y2="6.281" width="0.1524" layer="1"/>
<wire x1="11.681" y1="6.281" x2="10.981" y2="6.981" width="0.1524" layer="1"/>
<wire x1="10.981" y1="6.981" x2="9.481" y2="6.981" width="0.1524" layer="1"/>
<wire x1="9.481" y1="6.981" x2="9.081" y2="7.381" width="0.1524" layer="1"/>
<wire x1="9.081" y1="7.381" x2="9.1" y2="8.4" width="0.1524" layer="1"/>
</signal>
<signal name="N$9">
<contactref element="F1" pad="P$1"/>
<contactref element="J1" pad="1"/>
<wire x1="4.581" y1="13.281" x2="5.581" y2="13.281" width="0.381" layer="1"/>
<wire x1="5.581" y1="13.281" x2="5.781" y2="13.281" width="0.508" layer="1"/>
<wire x1="5.781" y1="13.281" x2="6.1" y2="13.6" width="0.508" layer="1"/>
<wire x1="6.1" y1="13.6" x2="6.1" y2="17.2" width="0.508" layer="1"/>
<wire x1="6.1" y1="17.2" x2="4.8" y2="18.5" width="0.508" layer="1"/>
<wire x1="4.8" y1="18.5" x2="4.8" y2="18.962" width="0.508" layer="1"/>
<wire x1="4.8" y1="18.962" x2="4.6" y2="19.2" width="0.508" layer="1"/>
</signal>
<signal name="!RESET">
<contactref element="U1" pad="G10"/>
<contactref element="J6" pad="10"/>
<wire x1="13.9" y1="15.6" x2="13.8868375" y2="16.695259375" width="0.1524" layer="1"/>
<wire x1="13.8868375" y1="16.695259375" x2="15.373734375" y2="18.2" width="0.1524" layer="1"/>
<contactref element="RN1" pad="3"/>
<wire x1="7.531" y1="20.581" x2="8.081" y2="20.581" width="0.1524" layer="16"/>
<wire x1="8.081" y1="20.581" x2="8.3" y2="20.8" width="0.1524" layer="16"/>
<wire x1="8.3" y1="20.8" x2="8.3" y2="21.5" width="0.1524" layer="16"/>
<wire x1="8.3" y1="21.5" x2="9.118421875" y2="22.318421875" width="0.1524" layer="16"/>
<wire x1="9.118421875" y1="22.318421875" x2="13.918578125" y2="22.318421875" width="0.1524" layer="16"/>
<wire x1="13.918578125" y1="22.318421875" x2="15.221" y2="21.016" width="0.1524" layer="16"/>
<wire x1="15.373734375" y1="18.2" x2="16.1482625" y2="18.974528125" width="0.1524" layer="1"/>
<wire x1="16.1482625" y1="18.974528125" x2="16.1482625" y2="20.0887375" width="0.1524" layer="1"/>
<wire x1="16.1482625" y1="20.0887375" x2="15.221" y2="21.016" width="0.1524" layer="1"/>
</signal>
<signal name="SWCLK">
<contactref element="U1" pad="E9"/>
<contactref element="J6" pad="4"/>
<wire x1="12.3" y1="14.8" x2="11.881" y2="15.181" width="0.1524" layer="1"/>
<wire x1="11.881" y1="15.181" x2="11.881" y2="15.819" width="0.1524" layer="1"/>
<contactref element="RN1" pad="2"/>
<wire x1="7.531" y1="19.781" x2="8.081" y2="19.781" width="0.1524" layer="16"/>
<wire x1="8.081" y1="19.781" x2="8.7" y2="20.4" width="0.1524" layer="16"/>
<wire x1="8.7" y1="20.4" x2="8.7" y2="21.3" width="0.1524" layer="16"/>
<wire x1="8.7" y1="21.3" x2="9.3" y2="21.9" width="0.1524" layer="16"/>
<wire x1="9.3" y1="21.9" x2="10.527" y2="21.9" width="0.1524" layer="16"/>
<wire x1="10.527" y1="21.9" x2="11.411" y2="21.016" width="0.1524" layer="16"/>
<wire x1="11.881" y1="15.819" x2="8.6" y2="19.1" width="0.1524" layer="1"/>
<wire x1="8.6" y1="19.1" x2="8.6" y2="20.9" width="0.1524" layer="1"/>
<wire x1="8.6" y1="20.9" x2="9.6" y2="21.9" width="0.1524" layer="1"/>
<wire x1="9.6" y1="21.9" x2="10.527" y2="21.9" width="0.1524" layer="1"/>
<wire x1="10.527" y1="21.9" x2="11.411" y2="21.016" width="0.1524" layer="1"/>
</signal>
<signal name="SWDIO">
<contactref element="U1" pad="G8"/>
<contactref element="J6" pad="2"/>
<wire x1="13.9" y1="14" x2="13.481" y2="14.381" width="0.1524" layer="1"/>
<wire x1="13.481" y1="14.381" x2="13.481" y2="15.881" width="0.1524" layer="1"/>
<contactref element="RN1" pad="1"/>
<wire x1="7.531" y1="18.881" x2="8.181" y2="18.881" width="0.1524" layer="16"/>
<wire x1="8.181" y1="18.881" x2="9.1" y2="19.8" width="0.1524" layer="16"/>
<wire x1="9.1" y1="19.8" x2="9.1" y2="20.5" width="0.1524" layer="16"/>
<wire x1="9.1" y1="20.5" x2="9.616" y2="21.016" width="0.1524" layer="16"/>
<wire x1="9.616" y1="21.016" x2="10.141" y2="21.016" width="0.1524" layer="16"/>
<wire x1="13.481" y1="15.881" x2="12.162" y2="17.2" width="0.1524" layer="1"/>
<wire x1="12.162" y1="17.2" x2="11.1" y2="17.2" width="0.1524" layer="1"/>
<wire x1="11.1" y1="17.2" x2="9.152846875" y2="19.147153125" width="0.1524" layer="1"/>
<wire x1="9.152846875" y1="19.147153125" x2="9.152846875" y2="20.552846875" width="0.1524" layer="1"/>
<wire x1="9.152846875" y1="20.552846875" x2="9.616" y2="21.016" width="0.1524" layer="1"/>
<wire x1="9.616" y1="21.016" x2="10.141" y2="21.016" width="0.1524" layer="1"/>
</signal>
<signal name="VDDCORE">
<contactref element="C26" pad="1"/>
<contactref element="C20" pad="1"/>
<contactref element="C21" pad="1"/>
<contactref element="C22" pad="1"/>
<contactref element="C23" pad="1"/>
<contactref element="C24" pad="1"/>
<contactref element="C25" pad="1"/>
<via x="9.5" y="9.6" extent="1-16" drill="0.254"/>
<via x="10.3" y="9.6" extent="1-16" drill="0.254"/>
<wire x1="11.1" y1="12.8" x2="10.3" y2="12.8" width="0.1524" layer="1"/>
<via x="10.3" y="12" extent="1-16" drill="0.254"/>
<via x="11.1" y="12" extent="1-16" drill="0.254"/>
<via x="10.3" y="12.8" extent="1-16" drill="0.254"/>
<via x="13.5" y="12" extent="1-16" drill="0.254"/>
<wire x1="10.431" y1="7.981" x2="10.431" y2="6.381" width="0.1524" layer="16"/>
<wire x1="8.981" y1="8.631" x2="9.381" y2="8.631" width="0.1524" layer="16"/>
<wire x1="9.381" y1="8.631" x2="9.381" y2="9.481" width="0.1524" layer="16"/>
<wire x1="9.381" y1="9.481" x2="9.5" y2="9.6" width="0.1524" layer="16"/>
<wire x1="10.3" y1="9.6" x2="10.281" y2="8.131" width="0.1524" layer="16"/>
<wire x1="10.281" y1="8.131" x2="10.431" y2="7.981" width="0.1524" layer="16"/>
<wire x1="10.031" y1="13.881" x2="10.2" y2="13.712" width="0.1524" layer="16"/>
<wire x1="10.2" y1="13.712" x2="10.2" y2="13.7" width="0.1524" layer="16"/>
<wire x1="10.2" y1="13.7" x2="10.2" y2="12.9" width="0.1524" layer="16"/>
<wire x1="10.2" y1="12.9" x2="10.3" y2="12.8" width="0.1524" layer="16"/>
<wire x1="10.3" y1="12" x2="9.512" y2="12" width="0.1524" layer="16"/>
<wire x1="9.512" y1="12" x2="9.231" y2="12.281" width="0.1524" layer="16"/>
<wire x1="11.1" y1="12" x2="11.3" y2="12.2" width="0.1524" layer="16"/>
<wire x1="11.3" y1="12.2" x2="11.3" y2="13.5" width="0.1524" layer="16"/>
<wire x1="11.3" y1="13.5" x2="11.481" y2="13.681" width="0.1524" layer="16"/>
<wire x1="11.481" y1="13.681" x2="11.481" y2="13.731" width="0.1524" layer="16"/>
<wire x1="10.2" y1="13.7" x2="11.45" y2="13.7" width="0.254" layer="16"/>
<wire x1="11.45" y1="13.7" x2="11.481" y2="13.731" width="0.254" layer="16"/>
<wire x1="9.4" y1="12.45" x2="9.4" y2="13.1" width="0.254" layer="16"/>
<wire x1="9.4" y1="13.1" x2="9.9" y2="13.6" width="0.254" layer="16"/>
<wire x1="9.4" y1="12.45" x2="9.231" y2="12.281" width="0.254" layer="16"/>
<wire x1="9.9" y1="13.6" x2="9.9" y2="13.75" width="0.254" layer="16"/>
<wire x1="9.9" y1="13.75" x2="10.031" y2="13.881" width="0.254" layer="16"/>
<wire x1="10.3" y1="8.2" x2="9.6" y2="8.2" width="0.254" layer="16"/>
<wire x1="9.6" y1="8.2" x2="9.3" y2="8.5" width="0.254" layer="16"/>
<wire x1="9.3" y1="8.5" x2="9.112" y2="8.5" width="0.254" layer="16"/>
<wire x1="9.112" y1="8.5" x2="8.981" y2="8.631" width="0.254" layer="16"/>
<wire x1="10.281" y1="8.131" x2="10.281" y2="8.181" width="0.254" layer="16"/>
<wire x1="10.281" y1="8.181" x2="10.3" y2="8.2" width="0.254" layer="16"/>
<wire x1="13.5" y1="12" x2="14.531" y2="12" width="0.1524" layer="16"/>
<wire x1="14.531" y1="12" x2="14.531" y2="11.581" width="0.1524" layer="16"/>
<wire x1="11.8" y1="13.9" x2="12.4" y2="14.5" width="0.254" layer="16"/>
<wire x1="12.4" y1="14.5" x2="14.6" y2="14.5" width="0.254" layer="16"/>
<wire x1="14.6" y1="14.5" x2="15.3" y2="13.8" width="0.254" layer="16"/>
<wire x1="15.3" y1="13.8" x2="15.3" y2="12.5" width="0.254" layer="16"/>
<wire x1="15.3" y1="12.5" x2="14.7" y2="11.9" width="0.254" layer="16"/>
<wire x1="14.7" y1="11.9" x2="14.531" y2="11.9" width="0.254" layer="16"/>
<wire x1="14.531" y1="11.9" x2="14.531" y2="11.581" width="0.254" layer="16"/>
<wire x1="11.8" y1="13.9" x2="11.481" y2="13.9" width="0.254" layer="16"/>
<wire x1="11.481" y1="13.9" x2="11.481" y2="13.731" width="0.254" layer="16"/>
<wire x1="9" y1="11.9" x2="8.5" y2="11.4" width="0.254" layer="16"/>
<wire x1="8.5" y1="11.4" x2="8.5" y2="8.9" width="0.254" layer="16"/>
<wire x1="8.5" y1="8.9" x2="8.6" y2="8.8" width="0.254" layer="16"/>
<wire x1="8.6" y1="8.8" x2="8.812" y2="8.8" width="0.254" layer="16"/>
<wire x1="8.812" y1="8.8" x2="8.981" y2="8.631" width="0.254" layer="16"/>
<wire x1="9" y1="11.9" x2="9" y2="12.05" width="0.254" layer="16"/>
<wire x1="9" y1="12.05" x2="9.231" y2="12.281" width="0.254" layer="16"/>
<contactref element="U1" pad="B3"/>
<contactref element="U1" pad="C3"/>
<contactref element="U1" pad="C6"/>
<contactref element="U1" pad="D6"/>
<contactref element="U1" pad="G6"/>
<contactref element="U1" pad="D7"/>
<wire x1="11.5" y1="13.2" x2="11.1" y2="12.8" width="0.1524" layer="1"/>
<wire x1="10.7" y1="12.4" x2="10.3" y2="12" width="0.1524" layer="1"/>
<wire x1="11.5" y1="12.4" x2="11.1" y2="12" width="0.1524" layer="1"/>
<wire x1="13.9" y1="12.4" x2="13.5" y2="12" width="0.1524" layer="1"/>
<wire x1="9.9" y1="10" x2="9.5" y2="9.6" width="0.1524" layer="1"/>
<wire x1="10.7" y1="10" x2="10.3" y2="9.6" width="0.1524" layer="1"/>
</signal>
<signal name="D_P">
<contactref element="U1" pad="B4"/>
<contactref element="J1" pad="3"/>
<wire x1="9.9" y1="10.8" x2="9.481" y2="10.381" width="0.1524" layer="1"/>
<wire x1="9.481" y1="10.381" x2="8.881" y2="10.381" width="0.1524" layer="1"/>
<wire x1="8.881" y1="10.381" x2="8.8334" y2="10.4286" width="0.1524" layer="1"/>
<wire x1="8.8334" y1="10.4286" x2="6.61786875" y2="10.4286" width="0.1524" layer="1"/>
<wire x1="6.61786875" y1="10.4286" x2="6.1286" y2="10.91786875" width="0.1524" layer="1"/>
<wire x1="6.1286" y1="10.91786875" x2="6.1286" y2="11.71786875" width="0.1524" layer="1"/>
<wire x1="6.1286" y1="11.71786875" x2="5.69286875" y2="12.1536" width="0.1524" layer="1"/>
<wire x1="5.69286875" y1="12.1536" x2="5.3786" y2="12.1536" width="0.1524" layer="1"/>
<wire x1="5.3786" y1="12.1536" x2="5.281" y2="12.056" width="0.1524" layer="1"/>
<wire x1="5.281" y1="12.056" x2="4.656" y2="12.056" width="0.1524" layer="1"/>
<wire x1="4.656" y1="12.056" x2="4.581" y2="11.981" width="0.1524" layer="1"/>
</signal>
<signal name="D_N">
<contactref element="U1" pad="A4"/>
<contactref element="J1" pad="2"/>
<wire x1="9.1" y1="10.8" x2="9.0334" y2="10.7334" width="0.1524" layer="1"/>
<wire x1="9.0334" y1="10.7334" x2="6.74413125" y2="10.7334" width="0.1524" layer="1"/>
<wire x1="6.74413125" y1="10.7334" x2="6.4334" y2="11.04413125" width="0.1524" layer="1"/>
<wire x1="6.4334" y1="11.04413125" x2="6.4334" y2="11.84413125" width="0.1524" layer="1"/>
<wire x1="6.4334" y1="11.84413125" x2="5.81913125" y2="12.4584" width="0.1524" layer="1"/>
<wire x1="5.81913125" y1="12.4584" x2="5.3786" y2="12.4584" width="0.1524" layer="1"/>
<wire x1="5.3786" y1="12.4584" x2="5.281" y2="12.556" width="0.1524" layer="1"/>
<wire x1="5.281" y1="12.556" x2="4.656" y2="12.556" width="0.1524" layer="1"/>
<wire x1="4.656" y1="12.556" x2="4.581" y2="12.631" width="0.1524" layer="1"/>
</signal>
<signal name="TX">
<contactref element="U1" pad="K9"/>
<contactref element="J3" pad="1"/>
<via x="16.681" y="15.181" extent="1-16" drill="0.254"/>
<wire x1="16.3" y1="14.8" x2="16.681" y2="15.181" width="0.1524" layer="1"/>
<wire x1="16.681" y1="15.181" x2="16.681" y2="14.881" width="0.1524" layer="16"/>
<wire x1="16.681" y1="14.881" x2="18.581" y2="12.981" width="0.1524" layer="16"/>
<wire x1="18.581" y1="12.981" x2="18.581" y2="5.441" width="0.1524" layer="16"/>
<wire x1="18.581" y1="5.441" x2="14.921" y2="1.781" width="0.1524" layer="16"/>
</signal>
<signal name="RX">
<contactref element="U1" pad="J9"/>
<contactref element="J3" pad="2"/>
<via x="15.881" y="15.181" extent="1-16" drill="0.254"/>
<wire x1="15.5" y1="14.8" x2="15.881" y2="15.181" width="0.1524" layer="1"/>
<wire x1="15.881" y1="15.181" x2="18.181" y2="12.881" width="0.1524" layer="16"/>
<wire x1="18.181" y1="12.881" x2="18.181" y2="5.607265625" width="0.1524" layer="16"/>
<wire x1="18.181" y1="5.607265625" x2="16.454734375" y2="3.881" width="0.1524" layer="16"/>
<wire x1="16.454734375" y1="3.881" x2="14.481" y2="3.881" width="0.1524" layer="16"/>
<wire x1="14.481" y1="3.881" x2="12.381" y2="1.781" width="0.1524" layer="16"/>
</signal>
<signal name="N$22">
<contactref element="U1" pad="A3"/>
<contactref element="C12" pad="1"/>
<contactref element="R5" pad="2"/>
<via x="7.8" y="9.6" extent="1-16" drill="0.254"/>
<wire x1="7.531" y1="6.981" x2="7.531" y2="8.581" width="0.1524" layer="16"/>
<wire x1="7.531" y1="8.981" x2="7.531" y2="8.581" width="0.1524" layer="16"/>
<wire x1="7.531" y1="8.981" x2="7.781" y2="8.981" width="0.1524" layer="16"/>
<wire x1="9.1" y1="10" x2="8.7" y2="9.6" width="0.1524" layer="1"/>
<wire x1="8.7" y1="9.6" x2="7.8" y2="9.6" width="0.1524" layer="1"/>
<wire x1="7.781" y1="8.981" x2="7.781" y2="9.581" width="0.1524" layer="16"/>
<wire x1="7.781" y1="9.581" x2="7.8" y2="9.6" width="0.1524" layer="16"/>
</signal>
<signal name="TRACESWO">
<contactref element="J6" pad="6"/>
<contactref element="U1" pad="C8"/>
<wire x1="10.7" y1="14" x2="11.081" y2="14.381" width="0.1524" layer="1"/>
<wire x1="11.081" y1="14.381" x2="11.081" y2="15.981" width="0.1524" layer="1"/>
<wire x1="11.081" y1="15.981" x2="8.18115625" y2="18.88084375" width="0.1524" layer="1"/>
<wire x1="8.18115625" y1="18.88084375" x2="8.18115625" y2="21.18115625" width="0.1524" layer="1"/>
<wire x1="8.18115625" y1="21.18115625" x2="9.3" y2="22.3" width="0.1524" layer="1"/>
<wire x1="9.3" y1="22.3" x2="11.397" y2="22.3" width="0.1524" layer="1"/>
<wire x1="11.397" y1="22.3" x2="12.681" y2="21.016" width="0.1524" layer="1"/>
</signal>
<signal name="N$11">
<contactref element="U5" pad="3"/>
<contactref element="L1" pad="P$1"/>
<wire x1="3.8" y1="5.55" x2="4.45" y2="5.55" width="0.381" layer="1"/>
<wire x1="4.45" y1="5.55" x2="4.7" y2="5.8" width="0.381" layer="1"/>
<wire x1="4.7" y1="5.8" x2="5.7" y2="5.8" width="0.381" layer="1"/>
<wire x1="5.7" y1="5.8" x2="5.981" y2="6.081" width="0.381" layer="1"/>
</signal>
<signal name="N$10">
<polygon width="0.1524" layer="1" pour="cutout">
<vertex x="8.3" y="16.4"/>
<vertex x="17.1" y="16.4"/>
<vertex x="17.1" y="7.6"/>
<vertex x="8.3" y="7.6"/>
</polygon>
</signal>
</signals>
</board>
</drawing>
</eagle>

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: brd


text:
// Copyright (C) 2019-2022 The Xaya developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "protoboard.hpp"

#include "boardrules.hpp"
#include "proto/metadata.pb.h"
#include "proto/testprotos.pb.h"

#include <xayautil/hash.hpp>

#include <google/protobuf/message.h>
#include <google/protobuf/text_format.h>

#include <gtest/gtest.h>

#include <glog/logging.h>

namespace xaya
{
namespace
{

using google::protobuf::TextFormat;

/**
 * Parses a text-format TestBoardState proto and serialises it in wire format.
 */
BoardState
TextState (const std::string& str)
{
  proto::TestBoardState pb;
  CHECK (TextFormat::ParseFromString (str, &pb));

  std::string res;
  CHECK (pb.SerializeToString (&res));

  return res;
}

/**
 * Parses a text-format TestBoardMove proto and serialises it in wire format.
 */
BoardState
TextMove (const std::string& str)
{
  proto::TestBoardMove pb;
  CHECK (TextFormat::ParseFromString (str, &pb));

  std::string res;
  CHECK (pb.SerializeToString (&res));

  return res;
}

/**
 * Sets an unknown field on the given proto.
 */
void
AddUnknownField (google::protobuf::Message& msg)
{
  msg.GetReflection ()->MutableUnknownFields (&msg)->AddVarint (123456, 42);
}

using SuperState = ProtoBoardState<proto::TestBoardState, proto::TestBoardMove>;

/**
 * Test implementation for the proto board state with "proper" rules.
 */
class TestState : public SuperState
{

protected:

  bool
  EqualsProto (const proto::TestBoardState& other) const override
  {
    if (GetState ().has_only_compare_this () && other.has_only_compare_this ())
      return GetState ().only_compare_this () == other.only_compare_this ();

    return SuperState::EqualsProto (other);
  }

  bool
  ApplyMoveProto (const proto::TestBoardMove& mv,
                  proto::TestBoardState& newState) const override
  {
    if (!mv.has_msg ())
      return false;

    newState.Clear ();
    newState.set_msg (mv.msg ());
    return true;
  }

public:

  using SuperState::SuperState;

  bool
  IsValid () const override
  {
    CHECK (SuperState::IsValid ());
    return !GetState ().invalid ();
  }

  int
  WhoseTurn () const override
  {
    LOG (FATAL) << "Not implemented";
  }

  unsigned
  TurnCount () const override
  {
    LOG (FATAL) << "Not implemented";
  }

};

class TestRules : public ProtoBoardRules<TestState>
{

public:

  ChannelProtoVersion
  GetProtoVersion (const proto::ChannelMetadata& meta) const override
  {
    return ChannelProtoVersion::ORIGINAL;
  }

};

class ProtoBoardTests : public testing::Test
{

protected:

  /** Fake channel ID used in tests.  */
  const uint256 channelId = SHA256::Hash ("foo");

  /**
   * Metadata instance.  We actually verify that its address is correct
   * (i.e. it gets passed everywhere by reference) rather than the content.
   */
  proto::ChannelMetadata meta;

  TestRules rules;

  ProtoBoardTests ()
  {}

  /**
   * Parses a board state and returns it as TestState pointer (instead of
   * the generic ParsedBoardState).
   */
  std::unique_ptr<TestState>
  ParseState (const BoardState& s)
  {
    auto parsed = rules.ParseState (channelId, meta, s);
    if (parsed == nullptr)
      return nullptr;

    auto* ptr = dynamic_cast<TestState*> (parsed.get ());
    CHECK (ptr != nullptr);

    parsed.release ();
    return std::unique_ptr<TestState> (ptr);
  }

};

TEST_F (ProtoBoardTests, ParseState)
{
  EXPECT_EQ (ParseState ("invalid"), nullptr);
  EXPECT_EQ (ParseState (TextState ("invalid: true")), nullptr);

  auto s = ParseState (TextState ("msg: \"foo\""));
  ASSERT_NE (s, nullptr);
  EXPECT_EQ (s->GetState ().msg (), "foo");
  EXPECT_EQ (s->GetChannelId (), channelId);
  EXPECT_EQ (&s->GetMetadata (), &meta);
}

TEST_F (ProtoBoardTests, Equals)
{
  auto p = ParseState (TextState ("msg: \"foo\""));
  EXPECT_TRUE (p->Equals (TextState ("msg: \"foo\"")));
  EXPECT_FALSE (p->Equals (TextState ("msg: \"bar\"")));
  EXPECT_FALSE (p->Equals ("invalid"));

  p = ParseState (TextState (R"(
    msg: "foo"
    only_compare_this: "value"
  )"));
  EXPECT_TRUE (p->Equals (TextState (R"(
    msg: "bar"
    only_compare_this: "value"
  )")));
  EXPECT_FALSE (p->Equals (TextState (R"(
    msg: "foo"
    only_compare_this: "other value"
  )")));
}

TEST_F (ProtoBoardTests, ApplyMove)
{
  auto p = ParseState (TextState ("msg: \"foo\""));

  BoardState newState;
  EXPECT_FALSE (p->ApplyMove ("invalid", newState));
  EXPECT_FALSE (p->ApplyMove (TextMove (""), newState));

  ASSERT_TRUE (p->ApplyMove (TextMove ("msg: \"bar\""), newState));
  proto::TestBoardState newPb;
  ASSERT_TRUE (newPb.ParseFromString (newState));
  EXPECT_EQ (newPb.msg (), "bar");
}

TEST_F (ProtoBoardTests, UnknownFields)
{
  auto p = ParseState (TextState ("msg: \"foo\""));

  proto::TestBoardState pbState;
  CHECK (TextFormat::ParseFromString ("msg: \"foo\"", &pbState));
  proto::TestBoardMove pbMove;
  CHECK (TextFormat::ParseFromString ("msg: \"bar\"", &pbMove));

  std::string serialised;
  CHECK (pbState.SerializeToString (&serialised));
  EXPECT_TRUE (p->Equals (serialised));
  EXPECT_NE (ParseState (serialised), nullptr);

  AddUnknownField (pbState);
  CHECK (pbState.SerializeToString (&serialised));
  EXPECT_FALSE (p->Equals (serialised));
  EXPECT_EQ (ParseState (serialised), nullptr);

  BoardState newState;
  CHECK (pbMove.SerializeToString (&serialised));
  EXPECT_TRUE (p->ApplyMove (serialised, newState));

  AddUnknownField (pbMove);
  CHECK (pbMove.SerializeToString (&serialised));
  EXPECT_FALSE (p->ApplyMove (serialised, newState));
}

} // anonymous namespace
} // namespace xaya

repository: xaya/libxayagame

repo_name: xaya/libxayagame

gha_license_id: MIT

extension: cpp