text:
" prefix="IC">
<description>NJM

3.3V series regulator

Data Sheet</description>
<gates>
<gate name="U" symbol="NJM2863" x="0" y="0"/>
</gates>
<devices>
<device name="F" package="SOT-23-5-2916-B">
<connects>
<connect gate="U" pin="1_CNTL" pad="1"/>
<connect gate="U" pin="2_VSS" pad="2"/>
<connect gate="U" pin="3_NOISE" pad="3"/>
<connect gate="U" pin="4_VOUT" pad="4"/>
<connect gate="U" pin="5_VIN" pad="5"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="VCC0" prefix="VCC0_">
<description>Common Vcc with circle mark</description>
<gates>
<gate name="G$2" symbol="VCC0" x="0" y="0"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
<technology name="_5.0V"/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="VDD2" prefix="VDD2_">
<description>Common Vdd with Bar</description>
<gates>
<gate name="G$1" symbol="VDD2" x="0" y="2.54"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
<technology name="_3.3V"/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="2SC2712" prefix="U">
<description>TOSHIBA

Silicon NPN Tripple Siffused Type ( PCT process)

High Voltage Control Applications

2SC2712

VCEO=50V

IC=100mA

hFE=120-240</description>
<gates>
<gate name="TR" symbol="NPN" x="0" y="0"/>
</gates>
<devices>
<device name="" package="SOT-23-3-2915-B">
<connects>
<connect gate="TR" pin="B" pad="1"/>
<connect gate="TR" pin="C" pad="3"/>
<connect gate="TR" pin="E" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="IRLML6402" prefix="U">
<description>International Rectifier

Field Effect Transistor  Silicon P Channel MOS

IRLML64026402

VDS=-20V

RON=50m¶(VGS=-4.5V)

ID=-3.7A</description>
<gates>
<gate name="TR" symbol="PMOS" x="0" y="0"/>
</gates>
<devices>
<device name="" package="SC-59-2915">
<connects>
<connect gate="TR" pin="D" pad="3"/>
<connect gate="TR" pin="G" pad="1"/>
<connect gate="TR" pin="S" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="SW_TACT" prefix="SW">
<description>Tacticle Push Switch</description>
<gates>
<gate name="G$1" symbol="TACT-SW" x="0" y="0"/>
</gates>
<devices>
<device name="1" package="SW_TACT-B">
<connects>
<connect gate="G$1" pin="P" pad="1"/>
<connect gate="G$1" pin="P1" pad="2"/>
<connect gate="G$1" pin="S" pad="3"/>
<connect gate="G$1" pin="S1" pad="4"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="CON_2P" prefix="CN" uservalue="yes">
<description>2P Molex Connector</description>
<gates>
<gate name="G$1" symbol="CON_2P" x="0" y="0"/>
</gates>
<devices>
<device name="-B" package="CON_DIP_2-B">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
<connect gate="G$1" pin="2" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-T" package="TERMINAL_2P-B">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
<connect gate="G$1" pin="2" pad="2"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-H" package="TERMINAL_AH-2P">
<connects>
<connect gate="G$1" pin="1" pad="1A"/>
<connect gate="G$1" pin="2" pad="2A"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-V" package="TERMINAL_AV-2P">
<connects>
<connect gate="G$1" pin="1" pad="1A"/>
<connect gate="G$1" pin="2" pad="2A"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="BD6211" prefix="IC">
<description>ROHM

H-bridge  Motor Driver (7V max.)

These H-bridge drivers are full bridge drivers for brush
motor applications.
</description>
<gates>
<gate name="G$1" symbol="BD6211" x="0" y="0"/>
</gates>
<devices>
<device name="F" package="SOP8">
<connects>
<connect gate="G$1" pin="1_OUT1" pad="1"/>
<connect gate="G$1" pin="2_VCC" pad="2"/>
<connect gate="G$1" pin="3_VCC" pad="3"/>
<connect gate="G$1" pin="4_FIN" pad="4"/>
<connect gate="G$1" pin="5_RIN" pad="5"/>
<connect gate="G$1" pin="6_VREF" pad="6"/>
<connect gate="G$1" pin="7_OUT2" pad="7"/>
<connect gate="G$1" pin="8_GND" pad="8"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="Z_DIODE" prefix="D" uservalue="yes">
<description>Z DIODE
</description>
<gates>
<gate name="1" symbol="Z_DIODE" x="0" y="0"/>
</gates>
<devices>
<device name="-2.54" package="ZDIO_2.54-10.16-A">
<connects>
<connect gate="1" pin="A" pad="A"/>
<connect gate="1" pin="C" pad="C"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-1.8" package="ZDIO_1.8-7.62-B">
<connects>
<connect gate="1" pin="A" pad="A"/>
<connect gate="1" pin="C" pad="C"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-2" package="ZDIO_2-10.16-A">
<connects>
<connect gate="1" pin="A" pad="A"/>
<connect gate="1" pin="C" pad="C"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-SC59" package="SOT-23-3-2915-B">
<connects>
<connect gate="1" pin="A" pad="1"/>
<connect gate="1" pin="C" pad="3"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="MOUNT-PAD" prefix="P" uservalue="yes">
<description>2.1mm Mount Pad (Connectable to GND)</description>
<gates>
<gate name="G$1" symbol="MOUNT-PAD" x="0" y="0"/>
</gates>
<devices>
<device name="3.3" package="PAD-3.3-B">
<connects>
<connect gate="G$1" pin="MOUNT" pad="B2,1"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="CON_5P" prefix="CN">
<gates>
<gate name="G$1" symbol="CON_5P" x="0" y="0" swaplevel="1"/>
</gates>
<devices>
<device name="V" package="TERMINAL_AV-5P">
<connects>
<connect gate="G$1" pin="1" pad="1A"/>
<connect gate="G$1" pin="2" pad="2A"/>
<connect gate="G$1" pin="3" pad="3A"/>
<connect gate="G$1" pin="4" pad="4A"/>
<connect gate="G$1" pin="5" pad="5A"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="VR" package="TERMINAL_AV-5P">
<connects>
<connect gate="G$1" pin="1" pad="1B"/>
<connect gate="G$1" pin="2" pad="2B"/>
<connect gate="G$1" pin="3" pad="3B"/>
<connect gate="G$1" pin="4" pad="4B"/>
<connect gate="G$1" pin="5" pad="5B"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="CPOL-EDLC" prefix="C" uservalue="yes">
<description>ELNA

Electric Double Layer Capacitor

DB-5R5D473 T

0.047uF  5.5WV</description>
<gates>
<gate name="G$1" symbol="CPOL" x="0" y="2.54"/>
</gates>
<devices>
<device name="-1F5.5V-V" package="E6-21-B">
<connects>
<connect gate="G$1" pin="+" pad="+"/>
<connect gate="G$1" pin="-" pad="-"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="-1F5.5V-H" package="E5-19V-B">
<connects>
<connect gate="G$1" pin="+" pad="+"/>
<connect gate="G$1" pin="-" pad="-"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
<class number="1" name="VCC0" width="0.762" drill="0">
</class>
<class number="2" name="VCC2" width="0.508" drill="0">
</class>
<class number="3" name="VDD0" width="0.508" drill="0">
</class>
<class number="4" name="VDD2" width="0.508" drill="0">
</class>
</classes>
<parts>
<part name="FRAME1" library="p20130601_WaveClock_Pic32MX120" deviceset="DINA3_L" device=""/>
<part name="IC4" library="p20130601_WaveClock_Pic32MX120" deviceset="PIC32MX120F032B-I/" device="SO" value="PIC32MX120F032B-I/SO"/>
<part name="U$6" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$7" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$8" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$9" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="C18" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="C12" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="C9" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="33pF"/>
<part name="C10" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="33pF"/>
<part name="R19" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10"/>
<part name="R17" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="X1" library="p20130601_WaveClock_Pic32MX120" deviceset="XTAL" device="VT" value="32.768Khz"/>
<part name="U$11" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="CN1" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_6P_ICSP" device="-B"/>
<part name="R22" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R24" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R25" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="U$15" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="SDC" library="p20130601_WaveClock_Pic32MX120" deviceset="DM3AT-SF-PEJ" device="Ｄ"/>
<part name="C22" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="U$18" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="LCD1" library="p20130601_WaveClock_Pic32MX120" deviceset="LCD_I2CLCD" device="_SB1602B"/>
<part name="C19" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="R21" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="47K"/>
<part name="R23" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="47K"/>
<part name="IC3" library="p20130601_WaveClock_Pic32MX120" deviceset="NJM8202" device="R"/>
<part name="U$10" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$5" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$1" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="VDD2_2" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$22" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$23" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$25" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$26" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$2" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device=""/>
<part name="VCC2_3" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC2" device="" technology="_5.0V" value="VCC2_5.0V"/>
<part name="C14" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="100pF"/>
<part name="C11" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="100pF"/>
<part name="C13" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="100pF"/>
<part name="R18" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="R15" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="U$4" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="C8" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="100pF"/>
<part name="R14" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="U$12" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="IC5" library="p20130601_WaveClock_Pic32MX120" deviceset="HT82V739" device=""/>
<part name="C16" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="1uF"/>
<part name="C17" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="1uF"/>
<part name="C20" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="VCC2_4" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC2" device="" technology="_5.0V" value="VCC2_5.0V"/>
<part name="U$19" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$28" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="BZ1" library="p20130601_WaveClock_Pic32MX120" deviceset="SPEAKER" device="-H" value="R"/>
<part name="VR1" library="p20130601_WaveClock_Pic32MX120" deviceset="POT" device="-VOL" value="10K(A)"/>
<part name="U$30" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="R16" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="30K"/>
<part name="R20" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="IC2" library="p20130601_WaveClock_Pic32MX120" deviceset="NJM2863" device="F"/>
<part name="VDD_1" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="C6" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="C2" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="C4" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="U$36" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$38" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$39" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$40" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="VCC0" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC0" device="" technology="_5.0V" value="VCC0_5.0V"/>
<part name="IC1" library="p20130601_WaveClock_Pic32MX120" deviceset="NJM2863" device="F"/>
<part name="C5" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="C1" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="C3" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
<part name="U$44" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$45" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$46" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$47" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="VDD2_1" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD2" device="" technology="_3.3V" value="VDD2_3.3V"/>
<part name="VDD2_3" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD2" device="" technology="_3.3V" value="VDD2_3.3V"/>
<part name="R3" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="R1" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="U2" library="p20130601_WaveClock_Pic32MX120" deviceset="2SC2712" device=""/>
<part name="U1" library="p20130601_WaveClock_Pic32MX120" deviceset="IRLML6402" device=""/>
<part name="R4" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="VCC0_1" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC0" device="" technology="_5.0V" value="VCC0_5.0V"/>
<part name="U$52" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="VCC2_2" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC2" device="" technology="_5.0V" value="VCC2_5.0V"/>
<part name="VCC2_1" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC2" device="" technology="_5.0V" value="VCC2_5.0V"/>
<part name="SW1" library="p20130601_WaveClock_Pic32MX120" deviceset="SW_TACT" device="1"/>
<part name="SW2" library="p20130601_WaveClock_Pic32MX120" deviceset="SW_TACT" device="1"/>
<part name="SW3" library="p20130601_WaveClock_Pic32MX120" deviceset="SW_TACT" device="1"/>
<part name="SW4" library="p20130601_WaveClock_Pic32MX120" deviceset="SW_TACT" device="1"/>
<part name="R2" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R5" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R8" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R13" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R9" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="U$53" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$54" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$55" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$56" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="U$57" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$58" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$59" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$60" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$61" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="IC6" library="p20130601_WaveClock_Pic32MX120" deviceset="BD6211" device="F"/>
<part name="C23" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="1uF"/>
<part name="U$65" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="VCC0_3" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC0" device="" technology="_5.0V" value="VCC0_5.0V"/>
<part name="CN7_MOTOR" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_2P" device="-H" value="CON_2P-B"/>
<part name="VCC0_4" library="p20130601_WaveClock_Pic32MX120" deviceset="VCC0" device="" technology="_5.0V" value="VCC0_5.0V"/>
<part name="C15" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M3216" value="10uF"/>
<part name="R10" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100K"/>
<part name="R11" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="47K"/>
<part name="U$69" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="D1" library="p20130601_WaveClock_Pic32MX120" deviceset="Z_DIODE" device="-SC59" value="RB411D"/>
<part name="R12" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="100"/>
<part name="U$70" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="VDD" library="p20130601_WaveClock_Pic32MX120" deviceset="VDD" device="" technology="_3.3V" value="VDD_3.3V"/>
<part name="P1" library="p20130601_WaveClock_Pic32MX120" deviceset="MOUNT-PAD" device="3.3"/>
<part name="P2" library="p20130601_WaveClock_Pic32MX120" deviceset="MOUNT-PAD" device="3.3"/>
<part name="P3" library="p20130601_WaveClock_Pic32MX120" deviceset="MOUNT-PAD" device="3.3"/>
<part name="P4" library="p20130601_WaveClock_Pic32MX120" deviceset="MOUNT-PAD" device="3.3"/>
<part name="CN3_SWITCH" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_5P" device="VR" value="CON_5PVR"/>
<part name="U$14" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="U$27" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="C7" library="p20130601_WaveClock_Pic32MX120" deviceset="CPOL-EDLC" device="-1F5.5V-H" value="1F"/>
<part name="CN5_I2C" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_2P" device="-B" value="CON_2P-B"/>
<part name="CN2_POWER" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_2P" device="-H" value="CON_2P-B"/>
<part name="U$29" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="CN6_SW" library="p20130601_WaveClock_Pic32MX120" deviceset="CON_2P" device="-H" value="CON_2P-B"/>
<part name="U$31" library="p20130601_WaveClock_Pic32MX120" deviceset="GND" device=""/>
<part name="R6" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="R7" library="p20130601_WaveClock_Pic32MX120" deviceset="R-EU2" device="M1608" value="10K"/>
<part name="C21" library="p20130601_WaveClock_Pic32MX120" deviceset="C-EU2" device="M1608" value="0.1uF"/>
</parts>
<sheets>
<sheet>
<plain>
<text x="19.05" y="72.39" size="1.778" layer="91">for SDC</text>
<text x="19.05" y="36.83" size="1.778" layer="91">for CPU</text>
<text x="74.93" y="34.29" size="1.778" layer="91">Back Up</text>
<text x="73.66" y="112.395" size="1.778" layer="96">1.598V / 5V</text>
<text x="73.66" y="109.22" size="1.778" layer="96">1.24V / 4V</text>
</plain>
<instances>
<instance part="FRAME1" gate="G$1" x="-25.4" y="-7.62"/>
<instance part="FRAME1" gate="G$2" x="261.62" y="-7.62"/>
<instance part="IC4" gate="G$1" x="172.72" y="180.34"/>
<instance part="U$6" gate="G$1" x="127" y="139.7"/>
<instance part="U$7" gate="G$1" x="215.9" y="160.02"/>
<instance part="U$8" gate="G$1" x="215.9" y="203.2"/>
<instance part="U$9" gate="G$1" x="99.06" y="208.28"/>
<instance part="C18" gate="G$1" x="215.9" y="210.82"/>
<instance part="C12" gate="G$1" x="127" y="147.32"/>
<instance part="C9" gate="G$1" x="106.68" y="165.1" smashed="yes" rot="R270">
<attribute name="NAME" x="100.076" y="165.989" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="108.966" y="162.179" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="C10" gate="G$1" x="106.68" y="157.48" smashed="yes" rot="R270">
<attribute name="NAME" x="96.774" y="156.591" size="1.778" layer="95"/>
<attribute name="VALUE" x="103.124" y="152.781" size="1.778" layer="96"/>
</instance>
<instance part="R19" gate="G$1" x="215.9" y="220.98" rot="R90"/>
<instance part="R17" gate="G$1" x="124.46" y="220.98" rot="R90"/>
<instance part="X1" gate="G$1" x="111.76" y="162.56" smashed="yes" rot="R90">
<attribute name="NAME" x="117.475" y="167.513" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="126.492" y="163.957" size="1.778" layer="96" rot="R180"/>
</instance>
<instance part="U$11" gate="G$1" x="101.6" y="139.7"/>
<instance part="CN1" gate="G$1" x="99.06" y="220.98" smashed="yes" rot="MR90">
<attribute name="NAME" x="90.805" y="232.41" size="1.778" layer="95" rot="MR0"/>
<attribute name="VALUE" x="111.76" y="232.41" size="1.778" layer="95" rot="MR0"/>
</instance>
<instance part="R22" gate="G$1" x="279.4" y="162.56" rot="R90"/>
<instance part="R24" gate="G$1" x="287.02" y="162.56" rot="R90"/>
<instance part="R25" gate="G$1" x="350.52" y="144.78" rot="R90"/>
<instance part="U$15" gate="G$1" x="342.9" y="144.78"/>
<instance part="SDC" gate="G$1" x="312.42" y="226.06"/>
<instance part="C22" gate="G$1" x="335.28" y="236.22"/>
<instance part="U$18" gate="G$1" x="335.28" y="228.6"/>
<instance part="LCD1" gate="G$2" x="312.42" y="147.32"/>
<instance part="C19" gate="G$1" x="215.9" y="167.64"/>
<instance part="R21" gate="G$1" x="279.4" y="241.3" rot="R90"/>
<instance part="R23" gate="G$1" x="287.02" y="241.3" rot="R90"/>
<instance part="IC3" gate="B" x="160.02" y="58.42" smashed="yes" rot="MR180">
<attribute name="NAME" x="162.56" y="55.245" size="1.778" layer="95" rot="MR180"/>
<attribute name="VALUE" x="137.16" y="66.04" size="1.778" layer="96" rot="MR180"/>
</instance>
<instance part="IC3" gate="P" x="160.02" y="58.42" smashed="yes"/>
<instance part="U$10" gate="G$1" x="160.02" y="45.72"/>
<instance part="U$5" gate="G$1" x="279.4" y="167.64"/>
<instance part="U$1" gate="G$1" x="127" y="149.86"/>
<instance part="VDD2_2" gate="G$1" x="279.4" y="246.38"/>
<instance part="U$22" gate="G$1" x="215.9" y="226.06"/>
<instance part="U$23" gate="G$1" x="124.46" y="226.06"/>
<instance part="U$25" gate="G$1" x="350.52" y="154.94"/>
<instance part="U$26" gate="G$1" x="342.9" y="154.94" smashed="yes">
<attribute name="VALUE" x="340.36" y="160.655" size="1.778" layer="96"/>
</instance>
<instance part="U$2" gate="G$1" x="106.68" y="208.28"/>
<instance part="VCC2_3" gate="1" x="160.02" y="66.04" smashed="yes">
<attribute name="VALUE" x="153.67" y="74.93" size="1.778" layer="96"/>
</instance>
<instance part="C14" gate="G$1" x="147.32" y="53.34"/>
<instance part="C11" gate="G$1" x="119.38" y="60.96"/>
<instance part="C13" gate="G$1" x="127" y="60.96"/>
<instance part="R18" gate="G$1" x="142.24" y="55.88"/>
<instance part="R15" gate="G$1" x="114.3" y="55.88"/>
<instance part="U$4" gate="G$1" x="147.32" y="45.72"/>
<instance part="C8" gate="G$1" x="101.6" y="53.34"/>
<instance part="R14" gate="G$1" x="96.52" y="55.88"/>
<instance part="U$12" gate="G$1" x="101.6" y="45.72"/>
<instance part="IC5" gate="G$1" x="228.6" y="50.8"/>
<instance part="C16" gate="G$1" x="198.12" y="50.8" rot="R90"/>
<instance part="C17" gate="G$1" x="200.66" y="43.18"/>
<instance part="C20" gate="G$1" x="248.92" y="48.26"/>
<instance part="VCC2_4" gate="1" x="248.92" y="50.8"/>
<instance part="U$19" gate="G$1" x="248.92" y="40.64"/>
<instance part="U$28" gate="G$1" x="200.66" y="35.56"/>
<instance part="BZ1" gate="G$1" x="259.08" y="58.42" smashed="yes">
<attribute name="NAME" x="255.27" y="64.77" size="1.778" layer="95"/>
<attribute name="VALUE" x="262.89" y="60.325" size="1.778" layer="96"/>
</instance>
<instance part="VR1" gate="G$1" x="185.42" y="50.8"/>
<instance part="U$30" gate="G$1" x="185.42" y="35.56"/>
<instance part="R16" gate="G$1" x="121.92" y="157.48" smashed="yes">
<attribute name="NAME" x="118.11" y="158.9786" size="1.778" layer="95"/>
<attribute name="VALUE" x="118.11" y="154.178" size="1.778" layer="96"/>
</instance>
<instance part="R20" gate="G$1" x="228.6" y="71.12"/>
<instance part="IC2" gate="U" x="30.48" y="25.4"/>
<instance part="VDD_1" gate="G$1" x="60.96" y="30.48"/>
<instance part="C6" gate="G$1" x="60.96" y="27.94"/>
<instance part="C2" gate="G$1" x="-2.54" y="27.94" rot="MR0"/>
<instance part="C4" gate="G$1" x="53.34" y="17.78"/>
<instance part="U$36" gate="G$1" x="60.96" y="10.16"/>
<instance part="U$38" gate="G$1" x="53.34" y="10.16"/>
<instance part="U$39" gate="G$1" x="30.48" y="10.16"/>
<instance part="U$40" gate="G$1" x="-2.54" y="10.16"/>
<instance part="VCC0" gate="G$2" x="-2.54" y="30.48"/>
<instance part="IC1" gate="U" x="30.48" y="60.96"/>
<instance part="C5" gate="G$1" x="60.96" y="63.5"/>
<instance part="C1" gate="G$1" x="-2.54" y="63.5" rot="MR0"/>
<instance part="C3" gate="G$1" x="53.34" y="53.34"/>
<instance part="U$44" gate="G$1" x="60.96" y="45.72"/>
<instance part="U$45" gate="G$1" x="53.34" y="45.72"/>
<instance part="U$46" gate="G$1" x="30.48" y="45.72"/>
<instance part="U$47" gate="G$1" x="-2.54" y="45.72"/>
<instance part="VDD2_1" gate="G$1" x="60.96" y="66.04"/>
<instance part="VDD2_3" gate="G$1" x="335.28" y="238.76"/>
<instance part="R3" gate="G$1" x="7.62" y="25.4" rot="R90"/>
<instance part="R1" gate="G$1" x="5.08" y="60.96" rot="R90"/>
<instance part="U2" gate="TR" x="25.4" y="93.98" rot="MR0"/>
<instance part="U1" gate="TR" x="22.86" y="119.38" smashed="yes" rot="MR90">
<attribute name="NAME" x="26.035" y="127" size="1.27" layer="95" rot="MR0"/>
<attribute name="VALUE" x="28.575" y="124.46" size="1.27" layer="96" rot="MR0"/>
</instance>
<instance part="R4" gate="G$1" x="15.24" y="104.14"/>
<instance part="VCC0_1" gate="G$2" x="7.62" y="121.92"/>
<instance part="U$52" gate="G$1" x="22.86" y="86.36"/>
<instance part="VCC2_2" gate="1" x="35.56" y="121.92"/>
<instance part="VCC2_1" gate="1" x="-2.54" y="66.04"/>
<instance part="SW1" gate="G$1" x="0" y="154.94" rot="MR0"/>
<instance part="SW2" gate="G$1" x="22.86" y="154.94" rot="MR0"/>
<instance part="SW3" gate="G$1" x="45.72" y="154.94" rot="MR0"/>
<instance part="SW4" gate="G$1" x="68.58" y="154.94" rot="MR0"/>
<instance part="R2" gate="G$1" x="7.62" y="160.02" rot="R90"/>
<instance part="R5" gate="G$1" x="30.48" y="160.02" rot="R90"/>
<instance part="R8" gate="G$1" x="53.34" y="160.02" rot="R90"/>
<instance part="R13" gate="G$1" x="76.2" y="160.02" rot="R90"/>
<instance part="R9" gate="G$1" x="58.42" y="220.98" rot="R90"/>
<instance part="U$53" gate="G$1" x="7.62" y="165.1" rot="MR0"/>
<instance part="U$54" gate="G$1" x="30.48" y="165.1" rot="MR0"/>
<instance part="U$55" gate="G$1" x="53.34" y="165.1" rot="MR0"/>
<instance part="U$56" gate="G$1" x="76.2" y="165.1" rot="MR0"/>
<instance part="U$57" gate="G$1" x="-5.08" y="147.32" rot="MR0"/>
<instance part="U$58" gate="G$1" x="17.78" y="149.86" rot="MR0"/>
<instance part="U$59" gate="G$1" x="40.64" y="149.86"/>
<instance part="U$60" gate="G$1" x="63.5" y="149.86"/>
<instance part="U$61" gate="G$1" x="58.42" y="226.06"/>
<instance part="IC6" gate="G$1" x="312.42" y="182.88"/>
<instance part="C23" gate="G$1" x="350.52" y="180.34"/>
<instance part="U$65" gate="G$1" x="350.52" y="172.72"/>
<instance part="VCC0_3" gate="G$2" x="350.52" y="182.88"/>
<instance part="CN7_MOTOR" gate="G$1" x="342.9" y="190.5" smashed="yes" rot="MR180">
<attribute name="NAME" x="339.598" y="195.834" size="1.778" layer="95" rot="MR180"/>
</instance>
<instance part="VCC0_4" gate="G$2" x="294.64" y="180.34"/>
<instance part="C15" gate="G$1" x="165.1" y="66.04" rot="R90"/>
<instance part="R10" gate="G$1" x="66.04" y="116.84" rot="R90"/>
<instance part="R11" gate="G$1" x="66.04" y="106.68" rot="R90"/>
<instance part="U$69" gate="G$1" x="66.04" y="99.06"/>
<instance part="D1" gate="1" x="83.82" y="25.4" rot="R90"/>
<instance part="R12" gate="G$1" x="73.66" y="25.4" rot="R90"/>
<instance part="U$70" gate="G$1" x="78.74" y="10.16"/>
<instance part="VDD" gate="G$1" x="248.92" y="71.12"/>
<instance part="P1" gate="G$1" x="307.34" y="68.58"/>
<instance part="P2" gate="G$1" x="307.34" y="60.96"/>
<instance part="P3" gate="G$1" x="307.34" y="53.34"/>
<instance part="P4" gate="G$1" x="307.34" y="45.72"/>
<instance part="CN3_SWITCH" gate="G$1" x="50.8" y="134.62" rot="R270"/>
<instance part="U$14" gate="G$1" x="38.1" y="137.16"/>
<instance part="IC3" gate="A" x="160.02" y="27.94" rot="MR180"/>
<instance part="U$27" gate="G$1" x="152.4" y="22.86"/>
<instance part="C7" gate="G$1" x="78.74" y="17.78"/>
<instance part="CN5_I2C" gate="G$1" x="302.26" y="121.92"/>
<instance part="CN2_POWER" gate="G$1" x="-10.16" y="119.38" rot="MR0"/>
<instance part="U$29" gate="G$1" x="-5.08" y="99.06"/>
<instance part="CN6_SW" gate="G$1" x="302.26" y="106.68"/>
<instance part="U$31" gate="G$1" x="297.18" y="104.14"/>
<instance part="R6" gate="G$1" x="33.02" y="93.98"/>
<instance part="R7" gate="G$1" x="33.02" y="78.74"/>
<instance part="C21" gate="G$1" x="332.74" y="193.04" smashed="yes">
<attribute name="NAME" x="330.708" y="196.723" size="1.778" layer="95"/>
<attribute name="VALUE" x="330.454" y="184.785" size="1.778" layer="96"/>
</instance>
</instances>
<busses>
</busses>
<nets>
<net name="N$1" class="0">
<segment>
<pinref part="R17" gate="G$1" pin="1"/>
<wire x1="124.46" y1="215.9" x2="124.46" y2="213.36" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="1_!MCR"/>
<wire x1="124.46" y1="213.36" x2="134.62" y2="213.36" width="0.1524" layer="91"/>
<pinref part="CN1" gate="G$1" pin="1_!MCLR"/>
<wire x1="104.14" y1="215.9" x2="104.14" y2="213.36" width="0.1524" layer="91"/>
<wire x1="104.14" y1="213.36" x2="124.46" y2="213.36" width="0.1524" layer="91"/>
<junction x="124.46" y="213.36"/>
</segment>
</net>
<net name="GND" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="VSS_19"/>
<wire x1="208.28" y1="162.56" x2="215.9" y2="162.56" width="0.1524" layer="91"/>
<pinref part="U$7" gate="G$1" pin="GND"/>
<pinref part="C19" gate="G$1" pin="2"/>
<junction x="215.9" y="162.56"/>
</segment>
<segment>
<pinref part="C9" gate="G$1" pin="2"/>
<pinref part="C10" gate="G$1" pin="2"/>
<wire x1="101.6" y1="165.1" x2="101.6" y2="157.48" width="0.1524" layer="91"/>
<wire x1="101.6" y1="157.48" x2="101.6" y2="142.24" width="0.1524" layer="91"/>
<pinref part="U$11" gate="G$1" pin="GND"/>
<junction x="101.6" y="157.48"/>
</segment>
<segment>
<pinref part="IC4" gate="G$1" pin="AVSS_27"/>
<pinref part="C18" gate="G$1" pin="2"/>
<wire x1="208.28" y1="205.74" x2="215.9" y2="205.74" width="0.1524" layer="91"/>
<pinref part="U$8" gate="G$1" pin="GND"/>
<junction x="215.9" y="205.74"/>
</segment>
<segment>
<pinref part="CN1" gate="G$1" pin="GND"/>
<pinref part="U$9" gate="G$1" pin="GND"/>
<wire x1="99.06" y1="215.9" x2="99.06" y2="210.82" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U$15" gate="G$1" pin="GND"/>
<pinref part="LCD1" gate="G$2" pin="4_VSS"/>
<wire x1="342.9" y1="147.32" x2="327.66" y2="147.32" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C22" gate="G$1" pin="2"/>
<pinref part="U$18" gate="G$1" pin="GND"/>
<pinref part="SDC" gate="G$1" pin="6_VSS"/>
<wire x1="327.66" y1="231.14" x2="335.28" y2="231.14" width="0.1524" layer="91"/>
<junction x="335.28" y="231.14"/>
</segment>
<segment>
<pinref part="IC3" gate="P" pin="V-"/>
<pinref part="U$10" gate="G$1" pin="GND"/>
<wire x1="160.02" y1="48.26" x2="160.02" y2="50.8" width="0.1524" layer="91"/>
<pinref part="C15" gate="G$1" pin="2"/>
<wire x1="170.18" y1="48.26" x2="170.18" y2="66.04" width="0.1524" layer="91"/>
<wire x1="160.02" y1="48.26" x2="170.18" y2="48.26" width="0.1524" layer="91"/>
<junction x="160.02" y="48.26"/>
</segment>
<segment>
<pinref part="C14" gate="G$1" pin="2"/>
<pinref part="U$4" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="C8" gate="G$1" pin="2"/>
<pinref part="U$12" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="C20" gate="G$1" pin="2"/>
<pinref part="U$19" gate="G$1" pin="GND"/>
<pinref part="IC5" gate="G$1" pin="VSS"/>
<wire x1="243.84" y1="43.18" x2="248.92" y2="43.18" width="0.1524" layer="91"/>
<junction x="248.92" y="43.18"/>
</segment>
<segment>
<pinref part="C17" gate="G$1" pin="2"/>
<pinref part="U$28" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="VR1" gate="G$1" pin="A"/>
<pinref part="U$30" gate="G$1" pin="GND"/>
<wire x1="185.42" y1="43.18" x2="185.42" y2="38.1" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="IC4" gate="G$1" pin="8_VSS"/>
<pinref part="U$6" gate="G$1" pin="GND"/>
<wire x1="134.62" y1="142.24" x2="127" y2="142.24" width="0.1524" layer="91"/>
<pinref part="C12" gate="G$1" pin="2"/>
<junction x="127" y="142.24"/>
</segment>
<segment>
<pinref part="C6" gate="G$1" pin="2"/>
<pinref part="U$36" gate="G$1" pin="GND"/>
<wire x1="60.96" y1="12.7" x2="60.96" y2="22.86" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C4" gate="G$1" pin="2"/>
<pinref part="U$38" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="IC2" gate="U" pin="2_VSS"/>
<pinref part="U$39" gate="G$1" pin="GND"/>
<wire x1="30.48" y1="12.7" x2="30.48" y2="15.24" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C2" gate="G$1" pin="2"/>
<pinref part="U$40" gate="G$1" pin="GND"/>
<wire x1="-2.54" y1="12.7" x2="-2.54" y2="22.86" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C5" gate="G$1" pin="2"/>
<pinref part="U$44" gate="G$1" pin="GND"/>
<wire x1="60.96" y1="48.26" x2="60.96" y2="58.42" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C3" gate="G$1" pin="2"/>
<pinref part="U$45" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="IC1" gate="U" pin="2_VSS"/>
<pinref part="U$46" gate="G$1" pin="GND"/>
<wire x1="30.48" y1="48.26" x2="30.48" y2="50.8" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C1" gate="G$1" pin="2"/>
<pinref part="U$47" gate="G$1" pin="GND"/>
<wire x1="-2.54" y1="48.26" x2="-2.54" y2="58.42" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U2" gate="TR" pin="E"/>
<pinref part="U$52" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="SW1" gate="G$1" pin="S1"/>
<pinref part="U$57" gate="G$1" pin="GND"/>
<wire x1="-5.08" y1="149.86" x2="-5.08" y2="152.4" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="SW2" gate="G$1" pin="S1"/>
<pinref part="U$58" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="SW3" gate="G$1" pin="S1"/>
<pinref part="U$59" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="SW4" gate="G$1" pin="S1"/>
<pinref part="U$60" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="C23" gate="G$1" pin="2"/>
<pinref part="U$65" gate="G$1" pin="GND"/>
<pinref part="IC6" gate="G$1" pin="8_GND"/>
<wire x1="327.66" y1="175.26" x2="350.52" y2="175.26" width="0.1524" layer="91"/>
<junction x="350.52" y="175.26"/>
</segment>
<segment>
<pinref part="R11" gate="G$1" pin="1"/>
<pinref part="U$69" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="CN3_SWITCH" gate="G$1" pin="5"/>
<pinref part="U$14" gate="G$1" pin="GND"/>
<wire x1="45.72" y1="139.7" x2="38.1" y2="139.7" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="IC3" gate="A" pin="+IN"/>
<pinref part="U$27" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="U$70" gate="G$1" pin="GND"/>
<pinref part="C7" gate="G$1" pin="-"/>
</segment>
<segment>
<pinref part="CN2_POWER" gate="G$1" pin="2"/>
<pinref part="U$29" gate="G$1" pin="GND"/>
<wire x1="-5.08" y1="101.6" x2="-5.08" y2="119.38" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="CN6_SW" gate="G$1" pin="2"/>
<pinref part="U$31" gate="G$1" pin="GND"/>
</segment>
</net>
<net name="N$4" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="VCAP_20"/>
<wire x1="208.28" y1="170.18" x2="215.9" y2="170.18" width="0.1524" layer="91"/>
<pinref part="C19" gate="G$1" pin="1"/>
</segment>
</net>
<net name="N$5" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="12_SOSCO"/>
<wire x1="127" y1="157.48" x2="134.62" y2="157.48" width="0.1524" layer="91"/>
<pinref part="R16" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$6" class="0">
<segment>
<pinref part="C9" gate="G$1" pin="1"/>
<pinref part="X1" gate="G$1" pin="2"/>
<wire x1="109.22" y1="165.1" x2="111.76" y2="165.1" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="11_SOSCI"/>
<wire x1="111.76" y1="165.1" x2="134.62" y2="165.1" width="0.1524" layer="91"/>
<junction x="111.76" y="165.1"/>
</segment>
</net>
<net name="N$3" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="AVDD_28"/>
<pinref part="R19" gate="G$1" pin="1"/>
<wire x1="208.28" y1="213.36" x2="215.9" y2="213.36" width="0.1524" layer="91"/>
<pinref part="C18" gate="G$1" pin="1"/>
<wire x1="215.9" y1="215.9" x2="215.9" y2="213.36" width="0.1524" layer="91"/>
<junction x="215.9" y="213.36"/>
</segment>
</net>
<net name="N$2" class="0">
<segment>
<pinref part="CN1" gate="G$1" pin="5_PGC"/>
<pinref part="IC4" gate="G$1" pin="5_PGEC1/AN3/C1INC/C2INA/RPB1/CTED12/RB1"/>
<wire x1="93.98" y1="215.9" x2="93.98" y2="200.66" width="0.1524" layer="91"/>
<wire x1="93.98" y1="200.66" x2="134.62" y2="200.66" width="0.1524" layer="91"/>
<junction x="93.98" y="200.66"/>
<pinref part="R9" gate="G$1" pin="1"/>
<wire x1="58.42" y1="200.66" x2="93.98" y2="200.66" width="0.1524" layer="91"/>
<wire x1="58.42" y1="215.9" x2="58.42" y2="200.66" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$7" class="0">
<segment>
<pinref part="CN1" gate="G$1" pin="4_PGD"/>
<pinref part="IC4" gate="G$1" pin="4_PGED1/AN2/C1IND/C2INB/C3IND/RPB0/RB0"/>
<wire x1="96.52" y1="215.9" x2="96.52" y2="203.2" width="0.1524" layer="91"/>
<wire x1="96.52" y1="203.2" x2="134.62" y2="203.2" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$8" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="TCK/RPB8/SCL1/CTED10/PMD4/RB8_17"/>
<wire x1="208.28" y1="152.4" x2="287.02" y2="152.4" width="0.1524" layer="91"/>
<pinref part="R24" gate="G$1" pin="1"/>
<wire x1="287.02" y1="152.4" x2="297.18" y2="152.4" width="0.1524" layer="91"/>
<wire x1="287.02" y1="157.48" x2="287.02" y2="152.4" width="0.1524" layer="91"/>
<junction x="287.02" y="152.4"/>
<pinref part="LCD1" gate="G$2" pin="2_SCL"/>
<wire x1="287.02" y1="152.4" x2="287.02" y2="121.92" width="0.1524" layer="91"/>
<pinref part="CN5_I2C" gate="G$1" pin="2"/>
<wire x1="287.02" y1="121.92" x2="297.18" y2="121.92" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$9" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="TDO/RPB9/SDA1/CTED4/PMD3/RB9_18"/>
<wire x1="208.28" y1="154.94" x2="279.4" y2="154.94" width="0.1524" layer="91"/>
<pinref part="R22" gate="G$1" pin="1"/>
<wire x1="279.4" y1="154.94" x2="297.18" y2="154.94" width="0.1524" layer="91"/>
<wire x1="279.4" y1="157.48" x2="279.4" y2="154.94" width="0.1524" layer="91"/>
<junction x="279.4" y="154.94"/>
<pinref part="LCD1" gate="G$2" pin="3_SDA"/>
<wire x1="279.4" y1="154.94" x2="279.4" y2="124.46" width="0.1524" layer="91"/>
<pinref part="CN5_I2C" gate="G$1" pin="1"/>
<wire x1="279.4" y1="124.46" x2="297.18" y2="124.46" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$10" class="0">
<segment>
<pinref part="R25" gate="G$1" pin="1"/>
<wire x1="350.52" y1="139.7" x2="327.66" y2="139.7" width="0.1524" layer="91"/>
<pinref part="LCD1" gate="G$2" pin="1_!RST"/>
</segment>
</net>
<net name="N$11" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="AN9/C3INA/RPB15/SCK2/CTED6/PMCS1/RB15_26"/>
<wire x1="208.28" y1="195.58" x2="271.78" y2="195.58" width="0.1524" layer="91"/>
<wire x1="271.78" y1="195.58" x2="271.78" y2="231.14" width="0.1524" layer="91"/>
<wire x1="271.78" y1="231.14" x2="297.18" y2="231.14" width="0.1524" layer="91"/>
<pinref part="SDC" gate="G$1" pin="5_CLK"/>
</segment>
</net>
<net name="N$12" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="AN11/RPB13/CTPLS/PMRD/RB13_24"/>
<wire x1="208.28" y1="190.5" x2="279.4" y2="190.5" width="0.1524" layer="91"/>
<wire x1="279.4" y1="190.5" x2="279.4" y2="226.06" width="0.1524" layer="91"/>
<pinref part="SDC" gate="G$1" pin="7_DO(DATA0)"/>
<pinref part="R21" gate="G$1" pin="1"/>
<wire x1="279.4" y1="226.06" x2="297.18" y2="226.06" width="0.1524" layer="91"/>
<wire x1="279.4" y1="236.22" x2="279.4" y2="226.06" width="0.1524" layer="91"/>
<junction x="279.4" y="226.06"/>
</segment>
</net>
<net name="N$13" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="CVREFOUT/AN10/C3INB/RPB14/SCK1/CTED5/PMWR/RB14_25"/>
<wire x1="208.28" y1="193.04" x2="274.32" y2="193.04" width="0.1524" layer="91"/>
<wire x1="274.32" y1="193.04" x2="274.32" y2="228.6" width="0.1524" layer="91"/>
<wire x1="274.32" y1="228.6" x2="297.18" y2="228.6" width="0.1524" layer="91"/>
<pinref part="SDC" gate="G$1" pin="2_!CS!(CD/DAT3)"/>
</segment>
</net>
<net name="N$14" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="3_VREF-/CVREF-/AN1/RPA1/CTED2/RA1"/>
<wire x1="134.62" y1="205.74" x2="129.54" y2="205.74" width="0.1524" layer="91"/>
<wire x1="129.54" y1="205.74" x2="129.54" y2="233.68" width="0.1524" layer="91"/>
<wire x1="129.54" y1="233.68" x2="287.02" y2="233.68" width="0.1524" layer="91"/>
<pinref part="SDC" gate="G$1" pin="3_DI(CMD)"/>
<pinref part="R23" gate="G$1" pin="1"/>
<wire x1="287.02" y1="236.22" x2="287.02" y2="233.68" width="0.1524" layer="91"/>
<wire x1="287.02" y1="233.68" x2="297.18" y2="233.68" width="0.1524" layer="91"/>
<junction x="287.02" y="233.68"/>
</segment>
</net>
<net name="VDD" class="0">
<segment>
<pinref part="R22" gate="G$1" pin="2"/>
<pinref part="R24" gate="G$1" pin="2"/>
<junction x="279.4" y="167.64"/>
<wire x1="279.4" y1="167.64" x2="287.02" y2="167.64" width="0.1524" layer="91"/>
<pinref part="U$5" gate="G$1" pin="VDD"/>
</segment>
<segment>
<wire x1="342.9" y1="154.94" x2="327.66" y2="154.94" width="0.1524" layer="91"/>
<pinref part="LCD1" gate="G$2" pin="5_VDD"/>
<pinref part="U$26" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R25" gate="G$1" pin="2"/>
<wire x1="350.52" y1="154.94" x2="350.52" y2="149.86" width="0.1524" layer="91"/>
<pinref part="U$25" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R19" gate="G$1" pin="2"/>
<pinref part="U$22" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R17" gate="G$1" pin="2"/>
<pinref part="U$23" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="CN1" gate="G$1" pin="VDD"/>
<wire x1="101.6" y1="215.9" x2="101.6" y2="208.28" width="0.1524" layer="91"/>
<wire x1="101.6" y1="208.28" x2="106.68" y2="208.28" width="0.1524" layer="91"/>
<pinref part="U$2" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="IC4" gate="G$1" pin="13_VDD"/>
<pinref part="U$1" gate="G$1" pin="VDD"/>
<wire x1="134.62" y1="149.86" x2="127" y2="149.86" width="0.1524" layer="91"/>
<pinref part="C12" gate="G$1" pin="1"/>
<junction x="127" y="149.86"/>
</segment>
<segment>
<pinref part="C6" gate="G$1" pin="1"/>
<pinref part="VDD_1" gate="G$1" pin="VDD"/>
<pinref part="IC2" gate="U" pin="4_VOUT"/>
<wire x1="48.26" y1="30.48" x2="60.96" y2="30.48" width="0.1524" layer="91"/>
<pinref part="R12" gate="G$1" pin="2"/>
<wire x1="60.96" y1="30.48" x2="73.66" y2="30.48" width="0.1524" layer="91"/>
<wire x1="73.66" y1="30.48" x2="83.82" y2="30.48" width="0.1524" layer="91"/>
<pinref part="D1" gate="1" pin="C"/>
<wire x1="83.82" y1="30.48" x2="83.82" y2="27.94" width="0.1524" layer="91"/>
<junction x="60.96" y="30.48"/>
<junction x="73.66" y="30.48"/>
</segment>
<segment>
<pinref part="R2" gate="G$1" pin="2"/>
<pinref part="U$53" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R5" gate="G$1" pin="2"/>
<pinref part="U$54" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R8" gate="G$1" pin="2"/>
<pinref part="U$55" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R13" gate="G$1" pin="2"/>
<pinref part="U$56" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R9" gate="G$1" pin="2"/>
<pinref part="U$61" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R20" gate="G$1" pin="2"/>
<wire x1="233.68" y1="71.12" x2="248.92" y2="71.12" width="0.1524" layer="91"/>
<pinref part="VDD" gate="G$1" pin="VDD"/>
</segment>
<segment>
<pinref part="R21" gate="G$1" pin="2"/>
<pinref part="R23" gate="G$1" pin="2"/>
<wire x1="279.4" y1="246.38" x2="287.02" y2="246.38" width="0.1524" layer="91"/>
<pinref part="VDD2_2" gate="G$1" pin="VDD"/>
<junction x="279.4" y="246.38"/>
</segment>
</net>
<net name="N$18" class="0">
<segment>
<pinref part="C14" gate="G$1" pin="1"/>
<pinref part="R18" gate="G$1" pin="2"/>
<pinref part="IC3" gate="B" pin="+IN"/>
<wire x1="147.32" y1="55.88" x2="152.4" y2="55.88" width="0.1524" layer="91"/>
<junction x="147.32" y="55.88"/>
</segment>
</net>
<net name="N$20" class="0">
<segment>
<pinref part="R18" gate="G$1" pin="1"/>
<pinref part="C13" gate="G$1" pin="2"/>
<wire x1="137.16" y1="55.88" x2="127" y2="55.88" width="0.1524" layer="91"/>
<pinref part="C11" gate="G$1" pin="2"/>
<wire x1="127" y1="55.88" x2="119.38" y2="55.88" width="0.1524" layer="91"/>
<pinref part="R15" gate="G$1" pin="2"/>
<junction x="127" y="55.88"/>
<junction x="119.38" y="55.88"/>
</segment>
</net>
<net name="N$19" class="0">
<segment>
<pinref part="C8" gate="G$1" pin="1"/>
<pinref part="R14" gate="G$1" pin="2"/>
<wire x1="101.6" y1="55.88" x2="109.22" y2="55.88" width="0.1524" layer="91"/>
<junction x="101.6" y="55.88"/>
<pinref part="R15" gate="G$1" pin="1"/>
</segment>
</net>
<net name="N$27" class="0">
<segment>
<pinref part="C17" gate="G$1" pin="1"/>
<pinref part="IC5" gate="G$1" pin="3_VREF"/>
<wire x1="200.66" y1="45.72" x2="213.36" y2="45.72" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$28" class="0">
<segment>
<pinref part="C16" gate="G$1" pin="2"/>
<pinref part="IC5" gate="G$1" pin="2_AUD_IN"/>
<wire x1="203.2" y1="50.8" x2="213.36" y2="50.8" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$29" class="0">
<segment>
<pinref part="IC5" gate="G$1" pin="1_OUTN"/>
<pinref part="BZ1" gate="G$1" pin="P$1"/>
<wire x1="243.84" y1="60.96" x2="254" y2="60.96" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$30" class="0">
<segment>
<pinref part="IC5" gate="G$1" pin="7_OUTP"/>
<wire x1="243.84" y1="58.42" x2="254" y2="58.42" width="0.1524" layer="91"/>
<pinref part="BZ1" gate="G$1" pin="P$2"/>
</segment>
</net>
<net name="N$33" class="0">
<segment>
<pinref part="VR1" gate="G$1" pin="S"/>
<pinref part="C16" gate="G$1" pin="1"/>
<wire x1="190.5" y1="50.8" x2="195.58" y2="50.8" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$16" class="0">
<segment>
<pinref part="R14" gate="G$1" pin="1"/>
<wire x1="213.36" y1="78.74" x2="91.44" y2="78.74" width="0.1524" layer="91"/>
<wire x1="91.44" y1="78.74" x2="91.44" y2="55.88" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="TDI/RPB7/CTED3/PMD5/INT0/RB7_16"/>
<wire x1="208.28" y1="149.86" x2="213.36" y2="149.86" width="0.1524" layer="91"/>
<wire x1="213.36" y1="149.86" x2="213.36" y2="78.74" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$37" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="7_AN5/C1INA/C2INC/RTCC/RPB3/SCL2/RB3"/>
<wire x1="134.62" y1="182.88" x2="35.56" y2="182.88" width="0.1524" layer="91"/>
<wire x1="35.56" y1="182.88" x2="35.56" y2="154.94" width="0.1524" layer="91"/>
<pinref part="R5" gate="G$1" pin="1"/>
<pinref part="SW2" gate="G$1" pin="P"/>
<wire x1="30.48" y1="154.94" x2="27.94" y2="154.94" width="0.1524" layer="91"/>
<wire x1="35.56" y1="154.94" x2="30.48" y2="154.94" width="0.1524" layer="91"/>
<junction x="30.48" y="154.94"/>
<wire x1="30.48" y1="144.78" x2="50.8" y2="144.78" width="0.1524" layer="91"/>
<wire x1="30.48" y1="154.94" x2="30.48" y2="144.78" width="0.1524" layer="91"/>
<pinref part="CN3_SWITCH" gate="G$1" pin="3"/>
<wire x1="50.8" y1="144.78" x2="50.8" y2="139.7" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$38" class="0">
<segment>
<pinref part="IC2" gate="U" pin="3_NOISE"/>
<pinref part="C4" gate="G$1" pin="1"/>
<wire x1="48.26" y1="20.32" x2="53.34" y2="20.32" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VCC0" class="0">
<segment>
<pinref part="VCC0_1" gate="G$2" pin="VCC0"/>
<pinref part="U1" gate="TR" pin="S"/>
<pinref part="R4" gate="G$1" pin="1"/>
<wire x1="7.62" y1="121.92" x2="20.32" y2="121.92" width="0.1524" layer="91"/>
<wire x1="7.62" y1="121.92" x2="7.62" y2="104.14" width="0.1524" layer="91"/>
<junction x="7.62" y="121.92"/>
<wire x1="7.62" y1="104.14" x2="10.16" y2="104.14" width="0.1524" layer="91"/>
<pinref part="CN2_POWER" gate="G$1" pin="1"/>
<wire x1="-5.08" y1="121.92" x2="7.62" y2="121.92" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C23" gate="G$1" pin="1"/>
<pinref part="VCC0_3" gate="G$2" pin="VCC0"/>
<pinref part="IC6" gate="G$1" pin="2_VCC"/>
<wire x1="327.66" y1="182.88" x2="330.2" y2="182.88" width="0.1524" layer="91"/>
<pinref part="IC6" gate="G$1" pin="3_VCC"/>
<wire x1="330.2" y1="182.88" x2="350.52" y2="182.88" width="0.1524" layer="91"/>
<wire x1="327.66" y1="180.34" x2="330.2" y2="180.34" width="0.1524" layer="91"/>
<wire x1="330.2" y1="180.34" x2="330.2" y2="182.88" width="0.1524" layer="91"/>
<junction x="350.52" y="182.88"/>
<junction x="330.2" y="182.88"/>
</segment>
<segment>
<pinref part="IC6" gate="G$1" pin="6_VREF"/>
<pinref part="VCC0_4" gate="G$2" pin="VCC0"/>
<wire x1="294.64" y1="180.34" x2="297.18" y2="180.34" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C2" gate="G$1" pin="1"/>
<pinref part="IC2" gate="U" pin="5_VIN"/>
<wire x1="-2.54" y1="30.48" x2="7.62" y2="30.48" width="0.1524" layer="91"/>
<pinref part="VCC0" gate="G$2" pin="VCC0"/>
<junction x="-2.54" y="30.48"/>
<pinref part="R3" gate="G$1" pin="2"/>
<junction x="7.62" y="30.48"/>
<wire x1="7.62" y1="30.48" x2="12.7" y2="30.48" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$36" class="0">
<segment>
<pinref part="IC1" gate="U" pin="3_NOISE"/>
<pinref part="C3" gate="G$1" pin="1"/>
<wire x1="48.26" y1="55.88" x2="53.34" y2="55.88" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$39" class="0">
<segment>
<pinref part="IC2" gate="U" pin="1_CNTL"/>
<pinref part="R3" gate="G$1" pin="1"/>
<wire x1="7.62" y1="20.32" x2="12.7" y2="20.32" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$40" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="PGED2/RPB10/CTED11/PMD2/RB10_21"/>
<wire x1="208.28" y1="175.26" x2="226.06" y2="175.26" width="0.1524" layer="91"/>
<wire x1="226.06" y1="175.26" x2="226.06" y2="93.98" width="0.1524" layer="91"/>
<wire x1="226.06" y1="93.98" x2="40.64" y2="93.98" width="0.1524" layer="91"/>
<junction x="40.64" y="93.98"/>
<pinref part="R6" gate="G$1" pin="2"/>
<wire x1="40.64" y1="78.74" x2="40.64" y2="93.98" width="0.1524" layer="91"/>
<wire x1="38.1" y1="93.98" x2="40.64" y2="93.98" width="0.1524" layer="91"/>
<pinref part="R7" gate="G$1" pin="2"/>
<wire x1="38.1" y1="78.74" x2="40.64" y2="78.74" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VCC2" class="0">
<segment>
<pinref part="C1" gate="G$1" pin="1"/>
<pinref part="IC1" gate="U" pin="5_VIN"/>
<wire x1="-2.54" y1="66.04" x2="5.08" y2="66.04" width="0.1524" layer="91"/>
<pinref part="R1" gate="G$1" pin="2"/>
<junction x="5.08" y="66.04"/>
<wire x1="5.08" y1="66.04" x2="12.7" y2="66.04" width="0.1524" layer="91"/>
<pinref part="VCC2_1" gate="1" pin="VCC2"/>
<junction x="-2.54" y="66.04"/>
</segment>
<segment>
<pinref part="U1" gate="TR" pin="D"/>
<pinref part="VCC2_2" gate="1" pin="VCC2"/>
<wire x1="27.94" y1="121.92" x2="35.56" y2="121.92" width="0.1524" layer="91"/>
<junction x="35.56" y="121.92"/>
<pinref part="R10" gate="G$1" pin="2"/>
<wire x1="35.56" y1="121.92" x2="66.04" y2="121.92" width="0.1524" layer="91"/>
<junction x="35.56" y="121.92"/>
</segment>
<segment>
<pinref part="C20" gate="G$1" pin="1"/>
<pinref part="VCC2_4" gate="1" pin="VCC2"/>
<pinref part="IC5" gate="G$1" pin="VDD"/>
<wire x1="243.84" y1="50.8" x2="248.92" y2="50.8" width="0.1524" layer="91"/>
<junction x="248.92" y="50.8"/>
</segment>
<segment>
<pinref part="IC3" gate="P" pin="V+"/>
<pinref part="VCC2_3" gate="1" pin="VCC2"/>
<pinref part="C15" gate="G$1" pin="1"/>
<wire x1="162.56" y1="66.04" x2="160.02" y2="66.04" width="0.1524" layer="91"/>
<junction x="160.02" y="66.04"/>
</segment>
</net>
<net name="N$41" class="0">
<segment>
<pinref part="U1" gate="TR" pin="G"/>
<pinref part="R4" gate="G$1" pin="2"/>
<wire x1="22.86" y1="114.3" x2="22.86" y2="104.14" width="0.1524" layer="91"/>
<pinref part="U2" gate="TR" pin="C"/>
<wire x1="22.86" y1="104.14" x2="22.86" y2="99.06" width="0.1524" layer="91"/>
<wire x1="20.32" y1="104.14" x2="22.86" y2="104.14" width="0.1524" layer="91"/>
<junction x="22.86" y="104.14"/>
</segment>
</net>
<net name="N$43" class="0">
<segment>
<pinref part="R20" gate="G$1" pin="1"/>
<wire x1="210.82" y1="60.96" x2="210.82" y2="71.12" width="0.1524" layer="91"/>
<pinref part="IC5" gate="G$1" pin="5_!CE"/>
<wire x1="210.82" y1="71.12" x2="223.52" y2="71.12" width="0.1524" layer="91"/>
<wire x1="210.82" y1="60.96" x2="213.36" y2="60.96" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="PGED3/RPB5/PMD7/RB5_14"/>
<wire x1="208.28" y1="144.78" x2="210.82" y2="144.78" width="0.1524" layer="91"/>
<wire x1="210.82" y1="144.78" x2="210.82" y2="71.12" width="0.1524" layer="91"/>
<junction x="210.82" y="71.12"/>
</segment>
</net>
<net name="N$15" class="0">
<segment>
<pinref part="SW3" gate="G$1" pin="P"/>
<pinref part="R8" gate="G$1" pin="1"/>
<wire x1="50.8" y1="154.94" x2="53.34" y2="154.94" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="9_OSC1/CLKI/RPA2/RA2"/>
<wire x1="53.34" y1="154.94" x2="58.42" y2="154.94" width="0.1524" layer="91"/>
<wire x1="58.42" y1="154.94" x2="58.42" y2="172.72" width="0.1524" layer="91"/>
<wire x1="58.42" y1="172.72" x2="134.62" y2="172.72" width="0.1524" layer="91"/>
<junction x="53.34" y="154.94"/>
<pinref part="CN3_SWITCH" gate="G$1" pin="2"/>
<wire x1="53.34" y1="154.94" x2="53.34" y2="139.7" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$44" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="10_OSC2/CLKO/RPA3/PMA0/RA3"/>
<wire x1="134.62" y1="170.18" x2="81.28" y2="170.18" width="0.1524" layer="91"/>
<wire x1="81.28" y1="170.18" x2="81.28" y2="154.94" width="0.1524" layer="91"/>
<pinref part="R13" gate="G$1" pin="1"/>
<wire x1="81.28" y1="154.94" x2="76.2" y2="154.94" width="0.1524" layer="91"/>
<pinref part="SW4" gate="G$1" pin="P"/>
<wire x1="73.66" y1="154.94" x2="76.2" y2="154.94" width="0.1524" layer="91"/>
<junction x="76.2" y="154.94"/>
<wire x1="55.88" y1="144.78" x2="76.2" y2="144.78" width="0.1524" layer="91"/>
<wire x1="76.2" y1="154.94" x2="76.2" y2="144.78" width="0.1524" layer="91"/>
<pinref part="CN3_SWITCH" gate="G$1" pin="1"/>
<wire x1="55.88" y1="144.78" x2="55.88" y2="139.7" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$42" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="6_AN4/C1INB/C2IND/RPB2/SDA2/CTED13/RB2"/>
<wire x1="134.62" y1="185.42" x2="12.7" y2="185.42" width="0.1524" layer="91"/>
<wire x1="12.7" y1="185.42" x2="12.7" y2="154.94" width="0.1524" layer="91"/>
<pinref part="SW1" gate="G$1" pin="P"/>
<pinref part="R2" gate="G$1" pin="1"/>
<wire x1="5.08" y1="154.94" x2="7.62" y2="154.94" width="0.1524" layer="91"/>
<wire x1="12.7" y1="154.94" x2="7.62" y2="154.94" width="0.1524" layer="91"/>
<junction x="7.62" y="154.94"/>
<wire x1="7.62" y1="154.94" x2="7.62" y2="142.24" width="0.1524" layer="91"/>
<wire x1="7.62" y1="142.24" x2="48.26" y2="142.24" width="0.1524" layer="91"/>
<pinref part="CN3_SWITCH" gate="G$1" pin="4"/>
<wire x1="48.26" y1="142.24" x2="48.26" y2="139.7" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$56" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="AN12/PMD0/RB12_23"/>
<wire x1="208.28" y1="180.34" x2="287.02" y2="180.34" width="0.1524" layer="91"/>
<wire x1="287.02" y1="180.34" x2="287.02" y2="190.5" width="0.1524" layer="91"/>
<pinref part="IC6" gate="G$1" pin="4_FIN"/>
<wire x1="287.02" y1="190.5" x2="297.18" y2="190.5" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$57" class="0">
<segment>
<pinref part="IC6" gate="G$1" pin="5_RIN"/>
<wire x1="297.18" y1="187.96" x2="289.56" y2="187.96" width="0.1524" layer="91"/>
<wire x1="289.56" y1="187.96" x2="289.56" y2="177.8" width="0.1524" layer="91"/>
<pinref part="IC4" gate="G$1" pin="PGEC2/TMS/RPB11/PMD1/RB11_22"/>
<wire x1="289.56" y1="177.8" x2="208.28" y2="177.8" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$58" class="0">
<segment>
<pinref part="R10" gate="G$1" pin="1"/>
<pinref part="R11" gate="G$1" pin="2"/>
<pinref part="IC4" gate="G$1" pin="2_VREF+/CVREF+/AN0/C3INC/RPA0/CTED1/RA0"/>
<wire x1="134.62" y1="208.28" x2="132.08" y2="208.28" width="0.1524" layer="91"/>
<wire x1="132.08" y1="208.28" x2="132.08" y2="187.96" width="0.1524" layer="91"/>
<wire x1="132.08" y1="187.96" x2="88.9" y2="187.96" width="0.1524" layer="91"/>
<wire x1="88.9" y1="187.96" x2="88.9" y2="111.76" width="0.1524" layer="91"/>
<wire x1="88.9" y1="111.76" x2="66.04" y2="111.76" width="0.1524" layer="91"/>
<junction x="66.04" y="111.76"/>
</segment>
</net>
<net name="N$59" class="0">
<segment>
<pinref part="R12" gate="G$1" pin="1"/>
<wire x1="73.66" y1="20.32" x2="78.74" y2="20.32" width="0.1524" layer="91"/>
<wire x1="78.74" y1="20.32" x2="83.82" y2="20.32" width="0.1524" layer="91"/>
<pinref part="D1" gate="1" pin="A"/>
<wire x1="83.82" y1="20.32" x2="83.82" y2="22.86" width="0.1524" layer="91"/>
<junction x="78.74" y="20.32"/>
<pinref part="C7" gate="G$1" pin="+"/>
</segment>
</net>
<net name="VDD2" class="0">
<segment>
<pinref part="C22" gate="G$1" pin="1"/>
<pinref part="VDD2_3" gate="G$1" pin="VDD2"/>
<pinref part="SDC" gate="G$1" pin="4_VDD"/>
<wire x1="327.66" y1="238.76" x2="335.28" y2="238.76" width="0.1524" layer="91"/>
<junction x="335.28" y="238.76"/>
</segment>
<segment>
<pinref part="C5" gate="G$1" pin="1"/>
<pinref part="IC1" gate="U" pin="4_VOUT"/>
<wire x1="48.26" y1="66.04" x2="60.96" y2="66.04" width="0.1524" layer="91"/>
<pinref part="V

extension: sch


text:
DD2_1" gate="G$1" pin="VDD2"/>
<junction x="60.96" y="66.04"/>
</segment>
</net>
<net name="N$49" class="0">
<segment>
<pinref part="IC3" gate="B" pin="OUT"/>
<wire x1="167.64" y1="58.42" x2="175.26" y2="58.42" width="0.1524" layer="91"/>
<wire x1="175.26" y1="73.66" x2="149.86" y2="73.66" width="0.1524" layer="91"/>
<wire x1="149.86" y1="73.66" x2="149.86" y2="60.96" width="0.1524" layer="91"/>
<pinref part="IC3" gate="B" pin="-IN"/>
<wire x1="149.86" y1="60.96" x2="152.4" y2="60.96" width="0.1524" layer="91"/>
<pinref part="C11" gate="G$1" pin="1"/>
<pinref part="C13" gate="G$1" pin="1"/>
<wire x1="119.38" y1="63.5" x2="119.38" y2="73.66" width="0.1524" layer="91"/>
<wire x1="119.38" y1="73.66" x2="127" y2="73.66" width="0.1524" layer="91"/>
<wire x1="127" y1="63.5" x2="127" y2="73.66" width="0.1524" layer="91"/>
<wire x1="127" y1="73.66" x2="149.86" y2="73.66" width="0.1524" layer="91"/>
<junction x="127" y="73.66"/>
<junction x="149.86" y="73.66"/>
<wire x1="175.26" y1="58.42" x2="175.26" y2="73.66" width="0.1524" layer="91"/>
<pinref part="VR1" gate="G$1" pin="E"/>
<wire x1="175.26" y1="58.42" x2="185.42" y2="58.42" width="0.1524" layer="91"/>
<junction x="175.26" y="58.42"/>
</segment>
</net>
<net name="N$25" class="0">
<segment>
<pinref part="IC3" gate="A" pin="OUT"/>
<wire x1="167.64" y1="27.94" x2="167.64" y2="35.56" width="0.1524" layer="91"/>
<pinref part="IC3" gate="A" pin="-IN"/>
<wire x1="167.64" y1="35.56" x2="152.4" y2="35.56" width="0.1524" layer="91"/>
<wire x1="152.4" y1="35.56" x2="152.4" y2="30.48" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$26" class="0">
<segment>
<pinref part="IC4" gate="G$1" pin="PGEC3/RPB6/PMD6/RB6_15"/>
<wire x1="208.28" y1="147.32" x2="274.32" y2="147.32" width="0.1524" layer="91"/>
<wire x1="274.32" y1="147.32" x2="274.32" y2="109.22" width="0.1524" layer="91"/>
<pinref part="CN6_SW" gate="G$1" pin="1"/>
<wire x1="274.32" y1="109.22" x2="297.18" y2="109.22" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$32" class="0">
<segment>
<pinref part="U2" gate="TR" pin="B"/>
<pinref part="R6" gate="G$1" pin="1"/>
</segment>
</net>
<net name="N$31" class="0">
<segment>
<pinref part="C10" gate="G$1" pin="1"/>
<pinref part="X1" gate="G$1" pin="1"/>
<wire x1="109.22" y1="157.48" x2="111.76" y2="157.48" width="0.1524" layer="91"/>
<pinref part="R16" gate="G$1" pin="1"/>
<wire x1="111.76" y1="157.48" x2="116.84" y2="157.48" width="0.1524" layer="91"/>
<junction x="111.76" y="157.48"/>
</segment>
</net>
<net name="N$34" class="0">
<segment>
<pinref part="R7" gate="G$1" pin="1"/>
<wire x1="27.94" y1="78.74" x2="10.16" y2="78.74" width="0.1524" layer="91"/>
<pinref part="IC1" gate="U" pin="1_CNTL"/>
<wire x1="10.16" y1="55.88" x2="12.7" y2="55.88" width="0.1524" layer="91"/>
<wire x1="10.16" y1="55.88" x2="10.16" y2="78.74" width="0.1524" layer="91"/>
<junction x="10.16" y="55.88"/>
<pinref part="R1" gate="G$1" pin="1"/>
<wire x1="5.08" y1="55.88" x2="10.16" y2="55.88" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$35" class="0">
<segment>
<pinref part="IC6" gate="G$1" pin="7_OUT2"/>
<pinref part="CN7_MOTOR" gate="G$1" pin="1"/>
<wire x1="327.66" y1="187.96" x2="332.74" y2="187.96" width="0.1524" layer="91"/>
<pinref part="C21" gate="G$1" pin="2"/>
<wire x1="332.74" y1="187.96" x2="337.82" y2="187.96" width="0.1524" layer="91"/>
<junction x="332.74" y="187.96"/>
</segment>
</net>
<net name="N$45" class="0">
<segment>
<pinref part="IC6" gate="G$1" pin="1_OUT1"/>
<pinref part="CN7_MOTOR" gate="G$1" pin="2"/>
<wire x1="327.66" y1="190.5" x2="327.66" y2="195.58" width="0.1524" layer="91"/>
<wire x1="327.66" y1="195.58" x2="332.74" y2="195.58" width="0.1524" layer="91"/>
<wire x1="332.74" y1="195.58" x2="337.82" y2="195.58" width="0.1524" layer="91"/>
<wire x1="337.82" y1="195.58" x2="337.82" y2="190.5" width="0.1524" layer="91"/>
<pinref part="C21" gate="G$1" pin="1"/>
<junction x="332.74" y="195.58"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
<errors>
<approved hash="101,1,307.34,68.58,P1,MOUNT,,,,"/>
<approved hash="101,1,307.34,60.96,P2,MOUNT,,,,"/>
<approved hash="101,1,307.34,53.34,P3,MOUNT,,,,"/>
<approved hash="101,1,307.34,45.72,P4,MOUNT,,,,"/>
<approved hash="104,1,327.66,238.76,SDC,4_VDD,VDD2,,,"/>
<approved hash="104,1,327.66,231.14,SDC,6_VSS,GND,,,"/>
<approved hash="104,1,327.66,154.94,LCD1,5_VDD,VDD,,,"/>
<approved hash="104,1,327.66,147.32,LCD1,4_VSS,GND,,,"/>
<approved hash="115,1,308.432,68.7894,P1,,,,,"/>
<approved hash="115,1,308.432,61.1694,P2,,,,,"/>
<approved hash="115,1,308.432,53.5494,P3,,,,,"/>
<approved hash="115,1,308.432,45.9294,P4,,,,,"/>
</errors>
</schematic>
</drawing>
</eagle>

license: MIT

license_type: permissive

branch_name: refs/heads/master


text:
// Copyright 2020 YBCZ, Inc. All rights reserved.
//
// Use of this source code is governed by a MIT license
// that can be found in the LICENSE file in the root of the source
// tree.

package wx

import (
	"bytes"
	"encoding/xml"
	"errors"
	"fmt"
	"github.com/blusewang/wx/mch_api"
	"net/http"
	"reflect"
	"strings"
)

var privateClientCache = make(map[string]*http.Client)

// 商户请求
type mchReq struct {
	account         MchAccount
	privateClient   *http.Client // 私有加密传输客户端
	api             mch_api.MchApi
	appId           string
	isHmacSign      bool
	isPrivateClient bool
	sendData        interface{}
	res             interface{}
	err             error
}

// 填充POST里的Body数据
func (mr *mchReq) Send(data interface{}) *mchReq {
	mr.sendData = data
	return mr
}

// 使用 HMAC-SHA256 签名
// 默认采用 MD5 签名
func (mr *mchReq) UseHMacSign() *mchReq {
	mr.isHmacSign = true
	return mr
}

// 使用私有证书通信
func (mr *mchReq) UsePrivateCert() *mchReq {
	mr.isPrivateClient = true
	return mr
}

// 绑定请求结果的解码数据体
func (mr *mchReq) Bind(data interface{}) *mchReq {
	mr.res = data
	return mr
}

// 执行
func (mr *mchReq) Do() (err error) {
	var cli = *http.DefaultClient
	if mr.isPrivateClient {
		if privateClientCache[mr.account.MchId] != nil {
			cli = *privateClientCache[mr.account.MchId]
		} else {
			cli, err = mr.account.newPrivateClient()
			if err != nil {
				return
			}
			privateClientCache[mr.account.MchId] = &cli
		}
	}
	if err = mr.sign(); err != nil {
		return
	}

	var buf = new(bytes.Buffer)
	if err = xml.NewEncoder(buf).Encode(mr.sendData); err != nil {
		return
	}
	api := fmt.Sprintf("https://api.mch.weixin.qq.com/%v", mr.api)
	if strings.HasPrefix(string(mr.api), "http") {
		api = string(mr.api)
	}
	resp, err := cli.Post(api, "application/xml", buf)
	if err != nil {
		return
	}
	if resp.StatusCode != http.StatusOK {
		return errors.New(resp.Status)
	}
	if err = xml.NewDecoder(resp.Body).Decode(&mr.res); err != nil {
		return
	}
	return
}

func (mr *mchReq) sign() (err error) {
	if mr.sendData == nil {
		return errors.New("the data to be sign is not set")
	}

	vf := reflect.ValueOf(mr.sendData)
	if vf.Kind() != reflect.Ptr {
		return errors.New("the send data must be ptr")
	}

	if vf.Elem().FieldByName("MchBase").IsValid() {
		var base = vf.Elem().FieldByName("MchBase")
		base.FieldByName("MchId").SetString(mr.account.MchId)
		base.FieldByName("AppId").SetString(mr.appId)
		base.FieldByName("NonceStr").SetString(NewRandStr(32))

		var sign string
		if mr.isHmacSign {
			base.FieldByName("SignType").SetString(mch_api.MchSignTypeHMACSHA256)
			sign = mr.account.signHmacSha256(mr.sendData)
		} else {
			sign = mr.account.signMd5(mr.sendData)
		}
		base.FieldByName("Sign").SetString(sign)
	} else if vf.Elem().FieldByName("Sign").IsValid() && vf.Elem().FieldByName("NonceStr").IsValid() {
		vf.Elem().FieldByName("NonceStr").SetString(NewRandStr(32))
		var sign string
		if mr.isHmacSign {
			if vf.Elem().FieldByName("SignType").IsValid() {
				vf.Elem().FieldByName("SignType").SetString(mch_api.MchSignTypeHMACSHA256)
				sign = mr.account.signHmacSha256(mr.sendData)
			}
		} else {
			sign = mr.account.signMd5(mr.sendData)
		}
		vf.Elem().FieldByName("Sign").SetString(sign)
	}

	return
}

repository: lovefcaaa/wx

repo_name: lovefcaaa/wx

extension: go


text:
using Microsoft.EntityFrameworkCore.Migrations;

namespace RecompildPOS.Services.Migrations
{
    public partial class synclog_update : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "AckCount",
                table: "UserSyncLogs",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Count",
                table: "UserSyncLogs",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "TerminalLogId",
                table: "UserSyncLogs",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "AckCount",
                table: "UserSyncLogs");

            migrationBuilder.DropColumn(
                name: "Count",
                table: "UserSyncLogs");

            migrationBuilder.DropColumn(
                name: "TerminalLogId",
                table: "UserSyncLogs");
        }
    }
}

repository: arbellaio/web-pos-basic

repo_name: arbellaio/web-pos-basic

branch_name: refs/heads/main

extension: cs


text:
using System.Linq;

namespace Noef.CodeGen
{
	/// <summary>
	/// See the Table.GetAll() method to see how Column objects are populated.
	/// </summary>
	public class Column
	{
		/// <summary>
		/// All of the type names in getClrPropertyTypeName() that are reference types
		/// </summary>
		private static readonly string[] REF_TYPES = {
			"object",
			"string",
			"byte[]",
			"Microsoft.SqlServer.Types.SqlGeometry",
			"Microsoft.SqlServer.Types.SqlGeography"
		};

		public string ColumnName { get; set; }
		public string PropertyName { get; set; }

		/// <summary>
		/// This is the name of the SQL Type, but without any parens even when it's required by that type.
		/// So values here look like "int", "datetime", "varchar", but not "varchar(50)".
		/// If you need the parens, use <see cref="GetSqlDeclaration" />.
		/// </summary>
		public string Type { get; set; }

		public int ID { get; set; }
		public short MaxLength { get; set; }
		public byte Precision { get; set; }
		public byte Scale { get; set; }
		public bool IsNullable { get; set; }
		public bool IsIdentity { get; set; }
		public bool IsComputed { get; set; }
		public bool IsPrimaryKey { get; set; }
		public bool IsForeignKey { get; set; }
		public bool IsPropertyExcluded { get; set; }

		/// <summary>
		/// If the user specifies a specific type in the config file, set this to true.
		/// </summary>
		public bool IsUserType { get; set; }

		/// <summary>
		/// Null if it's not a foreign key
		/// </summary>
		public string FkName { get; set; }

		public bool IsUnique { get; set; }

		public string ClrTypeName { get { return GetClrTypeName(); } }

		public string GetClrTypeName()
		{
			if (IsUserType)
				// The user specified a type to use in the config, and we'll just take it literally, whatever it is.
				return Type;

			string propertyType = SqlTypeMap.GetClrTypeName(Type);

			bool isValueType = !REF_TYPES.Contains(propertyType);

			// Don't add a ? to the end of nullable reference types (ref types are already nullable)
			if (isValueType && IsNullable)
				propertyType += "?";
			return propertyType;
		}

		public string GetSqlDeclaration()
		{
			bool needsParens = SqlTypeMap.SqlDeclRequiresParens(Type);
			if (needsParens)
			{
				if (ClrTypeName == "string")
					return Type + "(" + MaxLength + ")";
				return Type + "(" + Precision + "," + Scale + ")";
			}
			return Type;
		}
	}
}

repository: sam-meacham/Noef

repo_name: sam-meacham/Noef


text:
#include "turnipemu/arm7tdmi/alu.h"

#include "turnipemu/utils.h"
#include "turnipemu/log.h"

namespace TurnipEmu::ARM7TDMI::ALU {
	template<bool WithCarry>
	auto Add(word arg1, word arg2, int carryIn){
		uint64_t ulongResult = (uint64_t)arg1 + (uint64_t)arg2 + (WithCarry ? carryIn : 0);
		int64_t slongResult = TURNIPEMU_UINT32_TO_SINT64(arg1) + TURNIPEMU_UINT32_TO_SINT64(arg2) + (WithCarry ? carryIn : 0);
		OpOutput<OpType::Arithmetic> output(
			word(ulongResult),
			(ulongResult >> 32) & 1,
			(slongResult > std::numeric_limits<int32_t>::max()) || (slongResult < std::numeric_limits<int32_t>::lowest())
			);
		return output;
	}
	template<bool WithCarry, bool Reverse>
	auto Sub(word arg1, word arg2, int carryIn){
		if (!WithCarry) carryIn = 1;
		if (Reverse)
			return Add<true>(arg2, ~arg1, carryIn);
		else
			return Add<true>(arg1, ~arg2, carryIn);
	}

	auto LogicalShiftLeft(word value, word amount) {
		return OpOutput<OpType::Logical>(value << amount);
	}
	auto LogicalShiftRight(word value, word amount) {
		return OpOutput<OpType::Logical>(value >> amount);
	}
	// Arithmetic Shift Right (sign extended)
	auto ArithmeticShiftRight(word value, word amount, int carryIn) {
		// Although this is arithmetic, it doesn't use Cin.
		// TODO: Should this return an OpOutput<Arithmetic>?
		word result = value >> amount;
		if ((value >> 31) & 1){ // TODO: This assumes the source width is word
			// Sign bit set, extend to the left
			result |= word(~0) << (32 - amount);
		}
		return OpOutput<OpType::Arithmetic>(result, false, false);
	}
	auto RotateRight(word value, word amount) {
		return OpOutput<OpType::Logical>(
			value >> amount |
			((value << (32 - amount)) & word(~0))
			);
	};
	auto RotateRightExtended(word value, word amount, int carryIn){
		return OpOutput<OpType::Arithmetic>(
			((carryIn << 31) & 1) |
			value >> amount |
			((value << (33 - amount)) & word(~0)),

			(value >> (amount - 1)) & 1,
			false // No Overflow
			);
	}

	word RequestInput::Evaluate(Instructions::InstructionRegisterInterface registers, int* shiftedCarryOut) const {
		word value = (type == ValueType::Immediate) ? immediateValue : registers.get(registerIndex);
		if (type == ValueType::Immediate && immediateRotation){
			value = RotateRight(value, immediateRotation).result;
		}

		if (shift.enabled){
			word amount = (shift.amountType == ValueType::Immediate) ? shift.amountImmediateValue : registers.get(shift.amountRegisterIndex);

			switch(shift.shiftType){
			case ShiftType::LogicalShiftLeft:
				if (value != 0 && shiftedCarryOut) *shiftedCarryOut = (value >> (32 - amount)) & 1;
				value = LogicalShiftLeft(value, amount).result;
				break;
			case ShiftType::LogicalShiftRight:
				if (shiftedCarryOut) *shiftedCarryOut = (value >> (amount - 1)) & 1;
				value = LogicalShiftRight(value, amount).result;
				break;
			case ShiftType::ArithmeticShiftRight:
				if (shiftedCarryOut) *shiftedCarryOut = (value >> (amount - 1)) & 1;
				value = ArithmeticShiftRight(value, amount, registers.cpsr().carry).result;
				break;
			case ShiftType::RotateRight:
				if (shift.amountType == ValueType::Immediate && amount == 0){
					auto rorxResult = RotateRightExtended(value, amount, registers.cpsr().carry);
					if (shiftedCarryOut) *shiftedCarryOut = rorxResult.carry;
					value = rorxResult.result;
				}else
					value = RotateRight(value, amount).result;
				break;
			}
		}

		return value;
	}
	std::ostream& operator << (std::ostream& os, const RequestInput& requestInput){
		if (requestInput.type == RequestInput::ValueType::Immediate){
			os << Utils::HexFormat<word>(requestInput.immediateValue);
			if (requestInput.immediateRotation)
				os << " ROR by " << (int)requestInput.immediateRotation;
		}else{
			os << "Register " << (int)requestInput.registerIndex;
		}
		if (requestInput.shift.enabled){
			switch(requestInput.shift.shiftType){
			case RequestInput::ShiftType::LogicalShiftLeft:
				os << " << ";
				break;
			case RequestInput::ShiftType::LogicalShiftRight:
				os << " >> ";
				break;
			case RequestInput::ShiftType::ArithmeticShiftRight:
				os << " ASR ";
				break;
			case RequestInput::ShiftType::RotateRight:
				os << ((requestInput.shift.amountType == RequestInput::ValueType::Immediate && requestInput.shift.amountImmediateValue == 0) ? " RORX " : " ROR ");
				break;
			}
			if (requestInput.shift.amountType == RequestInput::ValueType::Immediate){
				os << Utils::HexFormat<word>(requestInput.shift.amountImmediateValue);
			}else{
				os << "Register " << (int)requestInput.shift.amountRegisterIndex;
			}
		}

		return os;
	}

	void Request::Evaluate(Instructions::InstructionRegisterInterface registers) const {
		if (op->selectedOperationType == OpType::Logical){
			int carryOut = 0;
			word operand1Value = operand1.Evaluate(registers, &carryOut);
			word operand2Value = operand2.Evaluate(registers, &carryOut);

			const auto result = op->logicalOp.execute(operand1Value, operand2Value);

			if (op->logicalOp.writeResult) registers.set(destinationRegister, result.result);
			if (setFlags) result.ApplyToPSR(registers.cpsr(), carryOut);

			if (!op->logicalOp.writeResult && !setFlags)
				throw std::runtime_error("ALU Request did not set flags or write result!");
		}else{
			word operand1Value = operand1.Evaluate(registers);
			word operand2Value = operand2.Evaluate(registers);

			const auto result = op->arithmeticOp.execute(operand1Value, operand2Value, registers.cpsr().carry ? 1 : 0);

			if (op->arithmeticOp.writeResult) registers.set(destinationRegister, result.result);
			if (setFlags) result.ApplyToPSR(registers.cpsr());

			if (!op->arithmeticOp.writeResult && !setFlags)
				throw std::runtime_error("ALU Request did not set flags or write result!");
		}
	}
	std::ostream& operator << (std::ostream& os, const Request& request) {
		os << "ALU OP " << ((request.op->selectedOperationType == OpType::Logical) ? request.op->logicalOp.mnemonic : request.op->arithmeticOp.mnemonic);
		os << "\nOperand 1: " << request.operand1;
		os << "\nOperand 2: " << request.operand2;
		os << "\nDestination: Register " << ((int)request.destinationRegister);
		os << "\nFlags: " << std::boolalpha << request.setFlags;
	    return os;
	}

	void MultiplyRequest::Evaluate(Instructions::InstructionRegisterInterface registers) const {
		word operand1Value = operand1.Evaluate(registers);
		word operand2Value = operand2.Evaluate(registers);

		uint64_t uResult;

		if (isSigned){
			uResult = static_cast<uint64_t>(
				TURNIPEMU_UINT32_TO_SINT64(operand1Value) * TURNIPEMU_UINT32_TO_SINT64(operand2Value)
				);
		}else{
			uResult = operand1Value * operand2Value;
		}

		uint64_t uFullResult = uResult;
		if (accumulate){
			uFullResult += registers.get(destinationRegister1);
			if (isLong) uFullResult += ((uint64_t)registers.get(destinationRegister2)) << 32;
		}

		registers.set(destinationRegister1, uFullResult & word(~0));
		if (isLong) registers.set(destinationRegister2, (uFullResult << 32) & word(~0));

		registers.cpsr().zero = uFullResult == 0;
		registers.cpsr().negative = (uFullResult >> 63) & 1;
		// Carry and Overflow are defined to "set garbage values", so we don't need to modify them.
	}
	std::ostream& operator << (std::ostream& os, const MultiplyRequest& request) {
		os << "Multiply " << (request.isSigned ? 'S' : '/') << (request.accumulate ? 'A' : '/') << (request.isLong ? 'L' : '/');
		os << "\nOperand 1: " << request.operand1;
		os << "\nOperand 2: " << request.operand2;
		os << "\nDestination: Register " << ((int)request.destinationRegister1);
		if (request.isLong) os << " [Low] Register " << ((int)request.destinationRegister2) << " [High]";
		os << "\nFlags: " << std::boolalpha << request.setFlags;
	    return os;
	}

	// Arithmetic Ops
	const ALU::Operation ADD = {
		"ADD",
		ALU::Add<false>
	};
	const ALU::Operation ADC = {
		"ADC",
		ALU::Add<true>
	};
	const ALU::Operation SUB = {
		"SUB",
		ALU::Sub<false, false>
	};
	const ALU::Operation SBC = {
		"SBC",
		ALU::Sub<true, false>
	};
	const ALU::Operation RSB = {
		"RSB",
		ALU::Sub<false, true>
	};
	const ALU::Operation RSC = {
		"RSC",
		ALU::Sub<true, true>
	};

	// Logical Ops
	const ALU::Operation AND = {
		"AND",
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 & arg2);
		}
	};
	const ALU::Operation EOR = {
		"EOR", // XOR
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 ^ arg2);
		}
	};
	const ALU::Operation ORR = {
		"ORR", // OR
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 | arg2);
		}
	};
	const ALU::Operation MOV = {
		"MOV",
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg2);
		}
	};
	const ALU::Operation BIC = {
		"BIC", // A AND NOT B
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 & ~arg2);
		}
	};
	const ALU::Operation MVN = {
		"MVN", // MOV NOT
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(~arg2);
		}
	};

	// Test Ops (only sets flags)
	const ALU::Operation TST = {
		"TST", // AND without result
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 & arg2);
		},
		false
	};
	const ALU::Operation TEQ = {
		"TEQ", // XOR without result
		[](word arg1, word arg2){
			return OpOutput<OpType::Logical>(arg1 ^ arg2);
		},
		false
	};
	const ALU::Operation CMP = {
		"CMP", // SUB without result
		Sub<false, false>,
		false
	};
	const ALU::Operation CMN = {
		"CMN", // ADD without result
		Add<false>,
		false
	};

	namespace Thumb {
		// Logical Shifts: A shifted by B
		const ALU::Operation LSL = {
			"LSL", // Logical Shift Left
			LogicalShiftLeft
		};
		const ALU::Operation LSR = {
			"LSR", // Logical Shift Right
			LogicalShiftRight
		};
		const ALU::Operation ASR = {
			"ASR", // Arithmetic Shift Right (sign extended)
			ArithmeticShiftRight
		};
		const ALU::Operation ROR = {
			"ROR", // Rotate Right (no carry)
			RotateRight
		};

		// Misc. Ops
		const ALU::Operation MUL = {
			"MUL", // Multiply
			[](word arg1, word arg2, int carryIn){
				// TODO: Flags
				throw std::runtime_error("Thumb MUL doesn't have the correct flags implemented");
				return ALU::OpOutput<OpType::Arithmetic>(arg1 * arg2, false, false);
			}
		};
		const ALU::Operation NEG = {
			"NEG", // Negate
			[](word arg1, word arg2, int carryIn){
				// Use ALU::Sub to make sure the flags will be correct
				return ALU::Sub<false, false>(0, arg2, carryIn);
			}
		};
	}
}

repository: theturboturnip/turnipemu

repo_name: theturboturnip/turnipemu

extension: cpp


text:
SUMMARY = "recipe to copy startup script file to rootfs \
	and set it with update-rc.d"
DESCRIPTION = "Recipe created by David Gherghita"
LICENSE = "CLOSED"

inherit update-rc.d

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "startup-script.sh"

SRC_URI = "file://startup-script.sh"

do_install() {
    install -d ${D}${INIT_D_DIR}
    install -m 0755 ${WORKDIR}/startup-script.sh ${D}${INIT_D_DIR}
}

FILES_${PN} = "${INIT_D_DIR}/startup-script.sh"

repository: david-gherghita/meta-mylayer

repo_name: david-gherghita/meta-mylayer

extension: bb


text:
package main

import (
	"database-autoupdater/globals"
	"database-autoupdater/handlers"
	"database-autoupdater/watchers"
	"flag"
	"fmt"

	"github.com/sirupsen/logrus"
)

var incomingDataFolder string
var successProcessedFolder string
var failProcessedFolder string
var warehouseArticleEndpoint string
var warehouseProductEndpoint string

func init() {

	logrus.Infof("Starting file watcher database auto-updater")

	//flags parse
	logLevel := "info"
	flag.StringVar(&logLevel, "logLevel", "info", "Log level")
	flag.StringVar(&incomingDataFolder, "incomingDataFolder", "", "Folder where the products.json and inventory.json will be placed to get the read the data from")
	flag.StringVar(&successProcessedFolder, "successProcessedFolder", "", "Folder where the products.json and inventory.json that were successly processed will be moved to")
	flag.StringVar(&failProcessedFolder, "failProcessedFolder", "", "Folder where the products.json and inventory.json that has fail in the processing will be moved to")
	flag.StringVar(&warehouseArticleEndpoint, "warehouseArticleEndpoint", "", "Endpoint of the Article Warehouse API. E.g.: http://localhost:4000/article")
	flag.StringVar(&warehouseProductEndpoint, "warehouseProductEndpoint", "", "Endpoint of the Product Warehouse API. E.g.: http://localhost:4000/product")
	flag.Parse()

	flagMessge := ""

	if incomingDataFolder == "" {
		flagMessge += "--incomingDataFolder flag must be provided\n"
	}
	if successProcessedFolder == "" {
		flagMessge += "--successProcessedFolder flag must be provided\n"
	}
	if failProcessedFolder == "" {
		flagMessge += "--failProcessedFolder flag must be provided\n"
	}
	if warehouseArticleEndpoint == "" {
		flagMessge += "--warehouseArticleEndpoint flag must be provided\n"
	}
	if warehouseProductEndpoint == "" {
		flagMessge += "--warehouseProductEndpoint flag must be provided\n"
	}

	if flagMessge != "" {
		fmt.Println(flagMessge)
		logrus.Exit(1)
	}

	if incomingDataFolder == successProcessedFolder || incomingDataFolder == failProcessedFolder || successProcessedFolder == failProcessedFolder {
		flagMessge = "The --incomingDataFolder, --successProcessedFolder and  --failProcessedFolder must have different values and point to differente folders"
	}
	if flagMessge != "" {
		logrus.Error(flagMessge)
		logrus.Exit(1)
	}

	l, err := logrus.ParseLevel(logLevel)
	if err != nil {
		panic("Invalid loglevel")
	}
	logrus.SetLevel(l)

	globals.WarehouseArticleEndpoint = warehouseArticleEndpoint
	globals.WarehouseProductEndpoint = warehouseProductEndpoint

	logrus.Infof("logLevel = %s", logLevel)
	logrus.Infof("incomingDataFolder = %s", incomingDataFolder)
	logrus.Infof("successProcessedFolder = %s", successProcessedFolder)
	logrus.Infof("failProcessedFolder = %s", failProcessedFolder)
	logrus.Infof("warehouseArticleEndpoint = %s", warehouseArticleEndpoint)
	logrus.Infof("warehouseProductEndpoint = %s", warehouseProductEndpoint)

	//setup gin routes
	logrus.Infof("Initialization completed")

}

func main() {
	done := make(chan string)

	// Start a pipeline for Articles (Inventory)
	articleDomain := "article"
	go watchers.StartPipeline(fmt.Sprintf("%s/%s", incomingDataFolder, articleDomain), fmt.Sprintf("%s/%s", successProcessedFolder, articleDomain), fmt.Sprintf("%s/%s", failProcessedFolder, articleDomain), handlers.HandleArticleIncomingDataFile)
	logrus.Info("Started data ingestion watcher for Articles")

	// Start a pipeline for Products
	productDomain := "product"
	go watchers.StartPipeline(fmt.Sprintf("%s/%s", incomingDataFolder, productDomain), fmt.Sprintf("%s/%s", successProcessedFolder, productDomain), fmt.Sprintf("%s/%s", failProcessedFolder, productDomain), handlers.HandleProductIncomingDataFile)
	logrus.Info("Started data ingestion watcher for Products")

	<-done
}