Skip to content
Browse files

updates!

  • Loading branch information...
1 parent 5088377 commit 9d64e9e3d31c7aa0a4afa0f093a59f4762951b1c @cnlohr committed Dec 31, 2013
View
10 README.txt
@@ -51,8 +51,14 @@ clients and forget about it, that's probably for the best.
----What the dumbcraft does (and doesn't do)----
-Dumbcraft is split into a C file and a static header file. This architecture
-can (and likely will) change soon, but I wanted to get this tool out the door!
+Dumbcraft is split into a C file for the core, and a user C file that contains
+various action-related functions that you must support, i.e.:
+ * void InitDumbgame()
+ * void DoCustomPreloadStep( uint8_t playerid )
+ * void PlayerTickUpdate( int playerid )
+ * void PlayerClick( uint8_t playerid, uint8_t x, uint8_t y, uint8_t z )
+ * void PlayerUpdate( uint8_t playerid )
+ * uint8_t ClientHandleChat( char * chat, uint8_t chatlen )
The .C file contains the core dumbcraft toolset. Because it doesn't support
any mode of communications with the outside world, all communications must be
View
10,551 avr_hardware/kicad/avrcraft-poec.brd
10,551 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
3,053 avr_hardware/kicad/avrcraft-poec.dsn
3,053 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
135 avr_hardware/kicad/avrcraft-poec.pro
@@ -0,0 +1,135 @@
+update=Tue 12 Nov 2013 03:34:38 AM EST
+last_client=eeschema
+[pcbnew]
+version=1
+PadDrlX=0
+PadDimH=787
+PadDimV=1102
+BoardThickness=630
+TxtPcbV=800
+TxtPcbH=600
+TxtModV=600
+TxtModH=600
+TxtModW=120
+VEgarde=100
+DrawLar=150
+EdgeLar=150
+TxtLar=120
+MSegLar=150
+LastNetListRead=avrcraft-poec.net
+[pcbnew/libraries]
+LibDir=../../../../electrical/kicad
+LibName1=sockets
+LibName2=connect
+LibName3=discret
+LibName4=pin_array
+LibName5=divers
+LibName6=libcms
+LibName7=display
+LibName8=valves
+LibName9=led
+LibName10=dip_sockets
+LibName11=1SMTPIN
+LibName12=BELFuse-S553
+LibName13=BESOP-4
+LibName14=BOURNS-PM5022
+LibName15=BOURNS-SRR1280
+LibName16=MICROSD_1050270001
+LibName17=MSOP_12
+LibName18=P?
+LibName19=PanasonicD8Cap
+LibName20=PHOENIX1771059
+LibName21=PHOENIX1985292
+LibName22=RIBBON6SMT
+LibName23=SM1005
+LibName24=SMALL_SOT23-6
+LibName25=SMT_ETHERNET
+LibName26=SO8E-WITHPAD
+LibName27=SO14-ATTINY
+LibName28=SO16MULTI
+LibName29=SOT-26
+LibName30=U5
+LibName31=USB-MiniB
+LibName32=XTAL4P
+LibName33=DO-214AA
+[eeschema]
+version=1
+LibDir=
+NetFmt=1
+HPGLSpd=20
+HPGLDm=15
+HPGLNum=1
+offX_A4=0
+offY_A4=0
+offX_A3=0
+offY_A3=0
+offX_A2=0
+offY_A2=0
+offX_A1=0
+offY_A1=0
+offX_A0=0
+offY_A0=0
+offX_A=0
+offY_A=0
+offX_B=0
+offY_B=0
+offX_C=0
+offY_C=0
+offX_D=0
+offY_D=0
+offX_E=0
+offY_E=0
+RptD_X=0
+RptD_Y=100
+RptLab=1
+LabSize=60
+[eeschema/libraries]
+LibName1=power
+LibName2=device
+LibName3=transistors
+LibName4=conn
+LibName5=linear
+LibName6=regul
+LibName7=74xx
+LibName8=cmos4000
+LibName9=adc-dac
+LibName10=memory
+LibName11=xilinx
+LibName12=special
+LibName13=microcontrollers
+LibName14=dsp
+LibName15=microchip
+LibName16=analog_switches
+LibName17=motorola
+LibName18=texas
+LibName19=intel
+LibName20=audio
+LibName21=interface
+LibName22=digital-audio
+LibName23=philips
+LibName24=display
+LibName25=cypress
+LibName26=siliconi
+LibName27=opto
+LibName28=atmel
+LibName29=contrib
+LibName30=valves
+LibName31=/home/cnlohr/electrical/kicad/6multi
+LibName32=/home/cnlohr/electrical/kicad/a4447sljtr
+LibName33=/home/cnlohr/electrical/kicad/ap1117
+LibName34=/home/cnlohr/electrical/kicad/atmega48_88_168_328_tqfp32
+LibName35=/home/cnlohr/electrical/kicad/atmegaxu2
+LibName36=/home/cnlohr/electrical/kicad/atmel_kk
+LibName37=/home/cnlohr/electrical/kicad/attinyx4
+LibName38=/home/cnlohr/electrical/kicad/avr6pin
+LibName39=/home/cnlohr/electrical/kicad/BELFuse_Ethernet
+LibName40=/home/cnlohr/electrical/kicad/bridge-MB2S-TP
+LibName41=/home/cnlohr/electrical/kicad/crystal-4p
+LibName42=/home/cnlohr/electrical/kicad/dmp2240udm
+LibName43=/home/cnlohr/electrical/kicad/enc424j600
+LibName44=/home/cnlohr/electrical/kicad/lsm303dlhc
+LibName45=/home/cnlohr/electrical/kicad/ltc2471cms
+LibName46=/home/cnlohr/electrical/kicad/mcp1824_ct
+LibName47=/home/cnlohr/electrical/kicad/microsd_1050270001
+LibName48=/home/cnlohr/electrical/kicad/opa832
+LibName49=/home/cnlohr/electrical/kicad/zener-sot23-3
View
1,787 avr_hardware/kicad/avrcraft-poec.sch
@@ -0,0 +1,1787 @@
+EESchema Schematic File Version 2 date Wed 27 Nov 2013 03:22:25 PM EST
+LIBS:power
+LIBS:device
+LIBS:transistors
+LIBS:conn
+LIBS:linear
+LIBS:regul
+LIBS:74xx
+LIBS:cmos4000
+LIBS:adc-dac
+LIBS:memory
+LIBS:xilinx
+LIBS:special
+LIBS:microcontrollers
+LIBS:dsp
+LIBS:microchip
+LIBS:analog_switches
+LIBS:motorola
+LIBS:texas
+LIBS:intel
+LIBS:audio
+LIBS:interface
+LIBS:digital-audio
+LIBS:philips
+LIBS:display
+LIBS:cypress
+LIBS:siliconi
+LIBS:opto
+LIBS:atmel
+LIBS:contrib
+LIBS:valves
+LIBS:6multi
+LIBS:a4447sljtr
+LIBS:ap1117
+LIBS:atmega48_88_168_328_tqfp32
+LIBS:atmegaxu2
+LIBS:atmel_kk
+LIBS:attinyx4
+LIBS:avr6pin
+LIBS:BELFuse_Ethernet
+LIBS:bridge-MB2S-TP
+LIBS:crystal-4p
+LIBS:dmp2240udm
+LIBS:enc424j600
+LIBS:lsm303dlhc
+LIBS:ltc2471cms
+LIBS:mcp1824_ct
+LIBS:microsd_1050270001
+LIBS:opa832
+LIBS:zener-sot23-3
+LIBS:avrcraft-poec-cache
+EELAYER 25 0
+EELAYER END
+$Descr A4 11700 8267
+encoding utf-8
+Sheet 1 1
+Title ""
+Date "27 nov 2013"
+Rev ""
+Comp ""
+Comment1 ""
+Comment2 ""
+Comment3 ""
+Comment4 ""
+$EndDescr
+Connection ~ 5700 6750
+Wire Wire Line
+ 5700 6650 5700 7250
+Connection ~ 9100 6500
+Wire Wire Line
+ 9100 6350 9100 6500
+Wire Wire Line
+ 4050 4000 3800 4000
+Wire Wire Line
+ 3800 4000 3800 3800
+Connection ~ 3000 3800
+Wire Wire Line
+ 3000 3800 3000 3900
+Wire Wire Line
+ 3000 3900 3600 3900
+Wire Wire Line
+ 3600 3900 3600 3800
+Wire Wire Line
+ 1900 550 3300 550
+Wire Wire Line
+ 1900 550 1900 900
+Wire Wire Line
+ 1900 1000 1900 1450
+Wire Wire Line
+ 1900 1000 1800 1000
+Wire Wire Line
+ 9200 6500 9000 6500
+Wire Wire Line
+ 9000 6500 9000 6600
+Wire Wire Line
+ 9700 6500 9700 6650
+Wire Wire Line
+ 9700 6650 10300 6650
+Connection ~ 1900 2900
+Wire Wire Line
+ 700 900 550 900
+Wire Wire Line
+ 550 900 550 2700
+Wire Wire Line
+ 550 2700 1200 2700
+Wire Wire Line
+ 1200 2700 1200 2900
+Wire Wire Line
+ 1200 2900 2000 2900
+Wire Wire Line
+ 1900 900 1800 900
+Connection ~ 1450 1750
+Wire Wire Line
+ 5250 1750 5250 2000
+Wire Wire Line
+ 5250 1750 1450 1750
+Wire Wire Line
+ 1900 1450 1550 1450
+Connection ~ 1550 1900
+Wire Wire Line
+ 1550 1450 1550 1900
+Wire Wire Line
+ 700 1100 700 1450
+Wire Wire Line
+ 700 1450 1450 1450
+Wire Wire Line
+ 1450 1450 1450 2550
+Connection ~ 1450 2550
+Connection ~ 1150 1900
+Wire Wire Line
+ 900 1900 1750 1900
+Wire Wire Line
+ 1700 3200 1700 2600
+Connection ~ 1700 2700
+Wire Wire Line
+ 2000 2700 1700 2700
+Wire Wire Line
+ 9650 4400 9800 4400
+Wire Wire Line
+ 9800 4400 9800 3900
+Wire Wire Line
+ 9800 3900 10750 3900
+Wire Wire Line
+ 8850 4000 8600 4000
+Wire Wire Line
+ 8600 4000 8600 4100
+Wire Wire Line
+ 8500 4100 8500 4700
+Wire Wire Line
+ 8500 4100 8600 4100
+Wire Wire Line
+ 8550 4400 8550 4000
+Wire Wire Line
+ 8850 2800 9000 2800
+Wire Wire Line
+ 9000 2800 9000 3200
+Wire Wire Line
+ 9000 3200 8750 3200
+Wire Wire Line
+ 8750 3200 8750 3650
+Wire Wire Line
+ 8750 3650 8850 3650
+Wire Wire Line
+ 9150 1900 9150 2350
+Connection ~ 8300 3050
+Wire Wire Line
+ 8300 3050 8450 3050
+Wire Wire Line
+ 9150 1900 8000 1900
+Wire Wire Line
+ 8000 1900 8000 2200
+Wire Wire Line
+ 8900 2500 8900 2200
+Wire Wire Line
+ 8000 2650 8000 2600
+Connection ~ 7950 6000
+Connection ~ 8250 6000
+Wire Wire Line
+ 8250 6000 7950 6000
+Connection ~ 8750 6000
+Wire Wire Line
+ 8750 6050 8750 6000
+Wire Wire Line
+ 10700 6650 10700 6250
+Wire Wire Line
+ 6050 1650 4900 1650
+Wire Wire Line
+ 7750 6450 8750 6450
+Wire Wire Line
+ 4050 1300 4050 1350
+Connection ~ 1700 3200
+Connection ~ 6200 6350
+Wire Wire Line
+ 6200 6350 6200 6850
+Wire Wire Line
+ 6200 6850 6350 6850
+Connection ~ 3800 1800
+Wire Wire Line
+ 3800 1900 3800 1800
+Wire Wire Line
+ 6100 5150 6200 5150
+Wire Wire Line
+ 6400 1250 6300 1250
+Wire Wire Line
+ 6300 1250 6300 1150
+Wire Wire Line
+ 5250 1250 5000 1250
+Wire Wire Line
+ 5000 1250 5000 1300
+Wire Wire Line
+ 5250 2000 5200 2000
+Wire Wire Line
+ 5200 2000 5200 2700
+Wire Wire Line
+ 5200 2700 4900 2700
+Wire Wire Line
+ 1900 2900 1900 3000
+Wire Wire Line
+ 1900 3000 2000 3000
+Wire Wire Line
+ 7200 5750 7200 6350
+Wire Wire Line
+ 7200 5750 6000 5750
+Connection ~ 6350 6350
+Wire Wire Line
+ 6150 6350 6750 6350
+Connection ~ 7050 6950
+Wire Wire Line
+ 6750 6850 6750 6950
+Connection ~ 5050 6750
+Wire Wire Line
+ 5700 6750 4900 6750
+Wire Wire Line
+ 5050 6050 5050 5750
+Wire Wire Line
+ 5050 5750 5600 5750
+Wire Wire Line
+ 6150 6050 6150 5950
+Wire Wire Line
+ 6150 5950 7750 5950
+Wire Wire Line
+ 7750 5950 7750 6450
+Wire Wire Line
+ 7600 6200 7600 6000
+Wire Wire Line
+ 7050 6950 7050 6250
+Wire Wire Line
+ 7050 6250 6150 6250
+Wire Wire Line
+ 7200 6350 7150 6350
+Wire Wire Line
+ 5050 6750 5050 6350
+Connection ~ 10250 4800
+Wire Wire Line
+ 10150 5300 10250 5300
+Wire Wire Line
+ 10250 5300 10250 4800
+Wire Wire Line
+ 10550 5300 10350 5300
+Wire Wire Line
+ 10550 3350 10550 4500
+Wire Wire Line
+ 10550 3350 10650 3350
+Connection ~ 10650 3650
+Wire Wire Line
+ 10650 3400 10650 3300
+Wire Wire Line
+ 10650 3400 10750 3400
+Connection ~ 10750 3100
+Wire Wire Line
+ 10750 3200 10750 3000
+Wire Wire Line
+ 10450 3050 10450 3000
+Wire Wire Line
+ 10650 3300 10750 3300
+Connection ~ 8750 6050
+Wire Wire Line
+ 8750 6050 9200 6050
+Connection ~ 8900 5900
+Wire Wire Line
+ 9200 5900 8900 5900
+Connection ~ 10600 5600
+Wire Wire Line
+ 10100 5600 10800 5600
+Wire Wire Line
+ 10100 5600 10100 5900
+Wire Wire Line
+ 11000 4650 11000 6100
+Wire Wire Line
+ 11000 4650 10400 4650
+Connection ~ 10150 4800
+Wire Wire Line
+ 10350 5300 10350 4200
+Wire Wire Line
+ 10350 4200 9650 4200
+Connection ~ 8250 4700
+Wire Wire Line
+ 8500 4700 8100 4700
+Wire Wire Line
+ 8550 4400 8850 4400
+Wire Wire Line
+ 8550 4000 8200 4000
+Connection ~ 3700 5050
+Wire Wire Line
+ 3200 5250 3450 5250
+Wire Wire Line
+ 3450 5250 3450 5050
+Wire Wire Line
+ 3450 5050 4050 5050
+Wire Wire Line
+ 9650 3250 10500 3250
+Connection ~ 7950 5650
+Wire Wire Line
+ 8100 5650 7800 5650
+Connection ~ 7950 5250
+Wire Wire Line
+ 8100 5250 7800 5250
+Connection ~ 8100 4400
+Wire Wire Line
+ 8100 4700 8100 3100
+Connection ~ 8650 4200
+Wire Wire Line
+ 8650 4600 8650 4200
+Connection ~ 8250 4200
+Wire Wire Line
+ 7650 3600 8000 3600
+Wire Wire Line
+ 8000 3600 8000 3700
+Wire Wire Line
+ 7650 3000 8200 3000
+Wire Wire Line
+ 8200 3000 8200 4000
+Wire Wire Line
+ 7400 1650 7400 2750
+Connection ~ 7750 2750
+Connection ~ 7750 3600
+Wire Wire Line
+ 7650 3900 7750 3900
+Wire Wire Line
+ 7750 3900 7750 2700
+Wire Wire Line
+ 7750 3300 7650 3300
+Connection ~ 7800 3700
+Wire Wire Line
+ 7800 3200 7650 3200
+Wire Wire Line
+ 7650 3800 7800 3800
+Wire Wire Line
+ 7050 4500 7400 4500
+Wire Wire Line
+ 3900 4950 3900 5150
+Wire Wire Line
+ 3900 5150 4050 5150
+Wire Wire Line
+ 5450 3900 5450 4050
+Wire Wire Line
+ 5450 4050 5600 4050
+Connection ~ 6950 5550
+Wire Wire Line
+ 6950 5600 6950 5550
+Wire Wire Line
+ 7100 5000 7100 5050
+Wire Wire Line
+ 7100 4600 6950 4600
+Wire Wire Line
+ 6950 4600 6950 4500
+Wire Wire Line
+ 6700 4650 6500 4650
+Wire Wire Line
+ 5650 5450 5650 4500
+Wire Wire Line
+ 5650 4500 6050 4500
+Connection ~ 5600 2300
+Wire Wire Line
+ 5600 2400 5600 2300
+Wire Wire Line
+ 5450 3700 5250 3700
+Wire Wire Line
+ 5450 3200 4900 3200
+Wire Wire Line
+ 5450 3000 4900 3000
+Wire Wire Line
+ 3200 1900 3200 1200
+Wire Wire Line
+ 3200 1200 2700 1200
+Wire Wire Line
+ 2700 1200 2700 1050
+Connection ~ 2700 650
+Wire Wire Line
+ 2100 650 3600 650
+Wire Wire Line
+ 3500 1900 3500 1650
+Connection ~ 3600 1800
+Wire Wire Line
+ 3400 1900 3400 1800
+Wire Wire Line
+ 3400 1800 3600 1800
+Wire Wire Line
+ 3100 4050 3200 4050
+Wire Wire Line
+ 3500 4500 3400 4500
+Wire Wire Line
+ 3400 4500 3400 3800
+Wire Wire Line
+ 1400 4200 1400 3900
+Wire Wire Line
+ 1400 4200 1250 4200
+Wire Wire Line
+ 1050 4200 1100 4200
+Wire Wire Line
+ 1100 4200 1100 3700
+Wire Wire Line
+ 1100 3700 1600 3700
+Wire Wire Line
+ 1600 3700 1600 3200
+Wire Wire Line
+ 1600 3200 2000 3200
+Connection ~ 1400 3000
+Wire Wire Line
+ 1050 2950 1050 3100
+Wire Wire Line
+ 1250 3100 1250 2950
+Wire Wire Line
+ 1250 2950 1400 2950
+Wire Wire Line
+ 1400 2950 1400 3100
+Wire Wire Line
+ 2000 3100 1500 3100
+Wire Wire Line
+ 1500 3100 1500 3200
+Wire Wire Line
+ 1500 3200 1200 3200
+Wire Wire Line
+ 1200 3200 1200 3100
+Wire Wire Line
+ 1200 3100 1150 3100
+Wire Wire Line
+ 1150 4200 1200 4200
+Wire Wire Line
+ 1200 4200 1200 3800
+Wire Wire Line
+ 1200 3800 3100 3800
+Wire Wire Line
+ 4900 2800 5000 2800
+Wire Wire Line
+ 5000 2800 5000 3900
+Wire Wire Line
+ 3500 3800 3500 4100
+Wire Wire Line
+ 3600 4050 3600 4000
+Wire Wire Line
+ 3600 4000 3500 4000
+Connection ~ 3500 4000
+Wire Wire Line
+ 3700 1600 3700 1550
+Wire Wire Line
+ 3700 1550 3600 1550
+Wire Wire Line
+ 3500 1650 3300 1650
+Wire Wire Line
+ 4000 4650 4000 3900
+Wire Wire Line
+ 4000 4650 2750 4650
+Wire Wire Line
+ 2750 4650 2750 3900
+Wire Wire Line
+ 2750 3900 1400 3900
+Wire Wire Line
+ 3600 650 3600 1900
+Connection ~ 3600 1550
+Wire Wire Line
+ 3100 1900 3100 1500
+Wire Wire Line
+ 3100 1500 2100 1500
+Wire Wire Line
+ 2100 1500 2100 1050
+Connection ~ 2100 1200
+Wire Wire Line
+ 4900 2900 5450 2900
+Wire Wire Line
+ 4900 3100 5450 3100
+Wire Wire Line
+ 5450 3800 5400 3800
+Wire Wire Line
+ 5400 3800 5400 4100
+Wire Wire Line
+ 5400 4100 5250 4100
+Wire Wire Line
+ 5250 3700 5250 2300
+Wire Wire Line
+ 5250 2300 6050 2300
+Wire Wire Line
+ 6250 4500 6250 4650
+Wire Wire Line
+ 6250 4650 6450 4650
+Wire Wire Line
+ 6450 4650 6450 4950
+Connection ~ 6450 4850
+Wire Wire Line
+ 5850 4950 5850 4650
+Wire Wire Line
+ 5850 4650 6150 4650
+Wire Wire Line
+ 6150 4650 6150 4500
+Connection ~ 5850 4850
+Wire Wire Line
+ 5650 5350 6450 5350
+Connection ~ 5850 5350
+Connection ~ 5650 5350
+Wire Wire Line
+ 6500 4650 6500 4550
+Wire Wire Line
+ 6500 4550 6350 4550
+Wire Wire Line
+ 6350 4550 6350 4500
+Connection ~ 6700 4650
+Wire Wire Line
+ 6850 4500 6850 4600
+Wire Wire Line
+ 6850 5050 6850 5000
+Wire Wire Line
+ 6850 5550 7100 5550
+Wire Wire Line
+ 5250 4950 5300 4950
+Wire Wire Line
+ 5300 4950 5300 4850
+Connection ~ 3900 4950
+Wire Wire Line
+ 7400 5000 7400 5150
+Wire Wire Line
+ 7800 3700 7650 3700
+Connection ~ 7800 3800
+Wire Wire Line
+ 7800 4050 7800 2900
+Wire Wire Line
+ 7800 2900 7650 2900
+Connection ~ 7800 3200
+Connection ~ 7750 3300
+Wire Wire Line
+ 4900 1650 4900 2500
+Wire Wire Line
+ 8100 3100 7650 3100
+Wire Wire Line
+ 8850 4200 8000 4200
+Connection ~ 8400 4200
+Wire Wire Line
+ 8400 3700 8200 3700
+Connection ~ 8200 3700
+Wire Wire Line
+ 7950 5650 7950 5700
+Wire Wire Line
+ 3200 4850 3600 4850
+Wire Wire Line
+ 3600 4850 3600 4950
+Wire Wire Line
+ 3600 4950 4050 4950
+Connection ~ 3700 4950
+Wire Wire Line
+ 6950 2250 6800 2250
+Connection ~ 6950 2250
+Wire Wire Line
+ 6800 2250 6800 1650
+Wire Wire Line
+ 6950 2300 6950 2200
+Wire Wire Line
+ 10550 4800 9900 4800
+Wire Wire Line
+ 9900 4800 9900 3450
+Wire Wire Line
+ 9900 3450 9650 3450
+Connection ~ 10350 5300
+Wire Wire Line
+ 11000 6100 10100 6100
+Wire Wire Line
+ 10100 6100 10100 6050
+Connection ~ 10600 6100
+Wire Wire Line
+ 9250 5150 8900 5150
+Wire Wire Line
+ 9250 5300 8750 5300
+Wire Wire Line
+ 8750 5300 8750 6150
+Wire Wire Line
+ 10550 4500 10800 4500
+Wire Wire Line
+ 10800 4500 10800 5600
+Wire Wire Line
+ 10450 3000 10750 3000
+Wire Wire Line
+ 10750 3800 10100 3800
+Wire Wire Line
+ 10100 3800 10100 3650
+Wire Wire Line
+ 10100 3650 9650 3650
+Wire Wire Line
+ 10500 3250 10500 3500
+Wire Wire Line
+ 10500 3500 10750 3500
+Wire Wire Line
+ 10750 3700 10650 3700
+Wire Wire Line
+ 10650 3700 10650 3600
+Wire Wire Line
+ 10650 3600 10750 3600
+Wire Wire Line
+ 10400 4650 10400 3350
+Connection ~ 10650 3350
+Wire Wire Line
+ 10650 3650 10400 3650
+Connection ~ 10400 3650
+Wire Wire Line
+ 8250 6000 8250 6050
+Wire Wire Line
+ 10350 5150 10150 5150
+Connection ~ 10350 5150
+Wire Wire Line
+ 4900 6250 5050 6250
+Connection ~ 7200 6200
+Wire Wire Line
+ 8150 6850 8150 6950
+Connection ~ 7150 6950
+Wire Wire Line
+ 5050 6400 5000 6400
+Connection ~ 5050 6400
+Wire Wire Line
+ 5000 6400 5000 6150
+Wire Wire Line
+ 5000 6150 5050 6150
+Wire Wire Line
+ 6350 7350 5950 7350
+Wire Wire Line
+ 5950 7350 5950 7050
+Wire Wire Line
+ 5950 7050 5700 7050
+Connection ~ 5700 7050
+Wire Wire Line
+ 5650 5650 4350 5650
+Wire Wire Line
+ 4350 5650 4350 6950
+Wire Wire Line
+ 4350 6950 5700 6950
+Connection ~ 5700 6950
+Wire Wire Line
+ 6150 6150 7200 6150
+Connection ~ 7200 6150
+Wire Wire Line
+ 4000 3900 5000 3900
+Wire Wire Line
+ 5050 2600 5050 1850
+Wire Wire Line
+ 5050 2600 4900 2600
+Wire Wire Line
+ 4050 1550 4050 1800
+Wire Wire Line
+ 4050 1800 3700 1800
+Wire Wire Line
+ 3700 1800 3700 1900
+Wire Wire Line
+ 3600 1350 2350 1350
+Connection ~ 3600 1350
+Connection ~ 2450 1350
+Wire Wire Line
+ 5100 900 5100 1000
+Wire Wire Line
+ 5100 1000 5250 1000
+Connection ~ 6150 5350
+Wire Wire Line
+ 6150 5150 6150 5350
+Connection ~ 6150 5150
+Wire Wire Line
+ 1400 2650 1400 2800
+Wire Wire Line
+ 1400 2800 2000 2800
+Wire Wire Line
+ 7950 6000 7950 6050
+Connection ~ 8250 6450
+Wire Wire Line
+ 6350 6750 6550 6750
+Wire Wire Line
+ 6550 6750 6550 6950
+Wire Wire Line
+ 6550 6950 8150 6950
+Connection ~ 6750 6950
+Wire Wire Line
+ 4450 1300 4450 1350
+Wire Wire Line
+ 3200 4050 3200 3800
+Wire Wire Line
+ 6950 1600 6950 1700
+Wire Wire Line
+ 5050 2300 4900 2300
+Connection ~ 4900 2300
+Connection ~ 5050 2300
+Wire Wire Line
+ 8900 5150 8900 5900
+Wire Wire Line
+ 8900 5700 10250 5700
+Connection ~ 8900 5700
+Wire Wire Line
+ 10250 5700 10250 6250
+Wire Wire Line
+ 10250 6250 10700 6250
+Wire Wire Line
+ 7600 6000 8750 6000
+Connection ~ 7950 6450
+Wire Wire Line
+ 7400 2750 7750 2750
+Wire Wire Line
+ 7650 3400 8300 3400
+Wire Wire Line
+ 8300 3400 8300 2200
+Wire Wire Line
+ 8300 2200 8400 2200
+Wire Wire Line
+ 7650 3500 8400 3500
+Wire Wire Line
+ 8400 3500 8400 2500
+Wire Wire Line
+ 9150 2350 8900 2350
+Connection ~ 8900 2350
+Wire Wire Line
+ 8450 2800 8400 2800
+Connection ~ 8400 2800
+Wire Wire Line
+ 8850 3450 8500 3450
+Wire Wire Line
+ 8500 3450 8500 3300
+Wire Wire Line
+ 8500 3300 7850 3300
+Wire Wire Line
+ 7850 3300 7850 2150
+Wire Wire Line
+ 7850 2150 8000 2150
+Connection ~ 8000 2150
+Wire Wire Line
+ 8850 3050 8850 3250
+Connection ~ 8650 3450
+Wire Wire Line
+ 10750 4000 9650 4000
+Wire Wire Line
+ 2000 2600 1800 2600
+Wire Wire Line
+ 1800 2600 1800 2550
+Wire Wire Line
+ 1800 2550 900 2550
+Wire Wire Line
+ 900 2550 900 2400
+Wire Wire Line
+ 2000 2500 1150 2500
+Wire Wire Line
+ 1150 2500 1150 2400
+Wire Wire Line
+ 1600 2250 1700 2250
+Wire Wire Line
+ 1600 2250 1600 2500
+Connection ~ 1600 2500
+Wire Wire Line
+ 700 1000 600 1000
+Wire Wire Line
+ 600 1000 600 1550
+Wire Wire Line
+ 600 1550 1700 1550
+Wire Wire Line
+ 1700 1550 1700 2250
+Wire Wire Line
+ 1950 1650 1950 1100
+Wire Wire Line
+ 1950 1100 1800 1100
+Wire Wire Line
+ 5050 1850 1950 1850
+Wire Wire Line
+ 1950 1850 1950 2050
+Wire Wire Line
+ 1950 2050 1700 2050
+Connection ~ 1700 2050
+Wire Wire Line
+ 3300 550 3300 1900
+Connection ~ 3300 1650
+Wire Wire Line
+ 9800 6950 9800 6650
+Connection ~ 9800 6650
+Wire Wire Line
+ 8850 6950 8750 6950
+Wire Wire Line
+ 8750 6950 8750 6450
+Wire Wire Line
+ 3300 3800 3300 4200
+Wire Wire Line
+ 3300 4200 1850 4200
+Wire Wire Line
+ 1850 4200 1850 3100
+Connection ~ 1850 3100
+Wire Wire Line
+ 4000 3700 4000 3850
+Wire Wire Line
+ 4000 3850 3700 3850
+Wire Wire Line
+ 3700 3850 3700 3800
+Wire Wire Line
+ 8550 6450 8550 6350
+Wire Wire Line
+ 8550 6350 8600 6350
+Connection ~ 8550 6450
+Wire Wire Line
+ 6400 5850 6200 5850
+Wire Wire Line
+ 6200 5850 6200 5950
+Connection ~ 6200 5950
+$Comp
+L CONN_1 P10
+U 1 1 5296534D
+P 5850 6650
+F 0 "P10" H 5930 6650 40 0000 L CNN
+F 1 "GND" H 5850 6705 30 0001 C CNN
+F 2 ".1SMTPIN" H 5850 6650 60 0000 C CNN
+ 1 5850 6650
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P9
+U 1 1 52965311
+P 6550 5850
+F 0 "P9" H 6630 5850 40 0000 L CNN
+F 1 "48V" H 6550 5905 30 0001 C CNN
+F 2 ".1SMTPIN" H 6550 5850 60 0000 C CNN
+ 1 6550 5850
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P3
+U 1 1 5283E1E9
+P 4200 4000
+F 0 "P3" H 4280 4000 40 0000 L CNN
+F 1 "ADC1" H 4200 4055 30 0001 C CNN
+F 2 ".1SMTPIN" H 4200 4000 60 0000 C CNN
+ 1 4200 4000
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P2
+U 1 1 5283E1D9
+P 4150 3700
+F 0 "P2" H 4230 3700 40 0000 L CNN
+F 1 "ADC0" H 4150 3755 30 0001 C CNN
+F 2 ".1SMTPIN" H 4150 3700 60 0000 C CNN
+ 1 4150 3700
+ 1 0 0 -1
+$EndComp
+Text Notes 9800 6350 0 60 ~ 0
+NOTE: D7 may be replaced by\n0 Ohm If >52V operation is\nnot required.
+$Comp
+L R R15
+U 1 1 5281DD2F
+P 9450 6500
+F 0 "R15" V 9550 6600 50 0000 C CNN
+F 1 "22k" V 9450 6500 50 0000 C CNN
+F 2 "SM0603" V 9350 6450 60 0000 C CNN
+ 1 9450 6500
+ 0 1 1 0
+$EndComp
+$Comp
+L SCR U5
+U 1 1 5281DD16
+P 9400 6950
+F 0 "U5" H 9550 7200 70 0000 C CNN
+F 1 "S4SRP" V 9500 6550 70 0000 C CNN
+F 2 "DO-214AA" V 9500 7600 60 0000 C CNN
+ 1 9400 6950
+ 0 1 1 0
+$EndComp
+$Comp
+L GND #PWR01
+U 1 1 52054D0F
+P 1950 1650
+F 0 "#PWR01" H 1950 1650 30 0001 C CNN
+F 1 "GND" H 1950 1580 30 0001 C CNN
+ 1 1950 1650
+ 1 0 0 -1
+$EndComp
+$Comp
+L AVRISP6 J2
+U 1 1 52054CC3
+P 1250 1000
+F 0 "J2" H 1050 1250 60 0000 C CNN
+F 1 "AVRISP6" H 1400 700 60 0000 C CNN
+F 2 "RIBBON6SMT" H 1250 1000 60 0001 C CNN
+ 1 1250 1000
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R18
+U 1 1 51D472DE
+P 1150 2150
+F 0 "R18" V 1230 2150 50 0000 C CNN
+F 1 "4k7" V 1150 2150 50 0000 C CNN
+F 2 "SM0603" V 1300 2150 60 0000 C CNN
+ 1 1150 2150
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R17
+U 1 1 51D472D9
+P 900 2150
+F 0 "R17" V 980 2150 50 0000 C CNN
+F 1 "4k7" V 900 2150 50 0000 C CNN
+F 2 "SM0603" V 800 2150 60 0000 C CNN
+ 1 900 2150
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR02
+U 1 1 51D472BC
+P 1750 1900
+F 0 "#PWR02" H 1750 1860 30 0001 C CNN
+F 1 "+3.3V" H 1750 2010 30 0000 C CNN
+ 1 1750 1900
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C19
+U 1 1 510EC767
+P 8650 3050
+F 0 "C19" H 8700 3150 50 0000 L CNN
+F 1 "6.8n" H 8700 2950 50 0000 L CNN
+F 2 "SM0603" H 8650 3050 60 0000 C CNN
+ 1 8650 3050
+ 0 1 1 0
+$EndComp
+$Comp
+L C C18
+U 1 1 510EC762
+P 8650 2800
+F 0 "C18" H 8700 2900 50 0000 L CNN
+F 1 "6.8n" H 8700 2700 50 0000 L CNN
+F 2 "SM0603" H 8650 2800 60 0000 C CNN
+ 1 8650 2800
+ 0 1 -1 0
+$EndComp
+$Comp
+L GND #PWR03
+U 1 1 510EC704
+P 8000 2650
+F 0 "#PWR03" H 8000 2650 30 0001 C CNN
+F 1 "GND" H 8000 2580 30 0001 C CNN
+ 1 8000 2650
+ 1 0 0 -1
+$EndComp
+Text Label 9950 6650 0 60 ~ 0
+POE+C
+$Comp
+L ZENER D7
+U 1 1 510EC158
+P 10500 6650
+F 0 "D7" H 10500 6750 50 0000 C CNN
+F 1 "ZENER-5.6V/2W" H 10500 6550 40 0000 C CNN
+F 2 "DO214" H 10500 6400 60 0000 C CNN
+F 4 "3SMAJ5919B-TP" H 10500 6650 60 0000 C CNN "Field4"
+ 1 10500 6650
+ 1 0 0 -1
+$EndComp
+Text Notes 6200 1600 0 60 ~ 0
+Connect if \nyou want\ninterrupt\nsupport
+$Comp
+L +5V #PWR04
+U 1 1 510EAED6
+P 6950 1600
+F 0 "#PWR04" H 6950 1690 20 0001 C CNN
+F 1 "+5V" H 6950 1690 30 0000 C CNN
+ 1 6950 1600
+ 1 0 0 -1
+$EndComp
+Text Label 7750 6450 0 60 ~ 0
+POE+A
+$Comp
+L C C17
+U 1 1 5109F492
+P 4050 1100
+F 0 "C17" H 4100 1200 50 0000 L CNN
+F 1 "1u" H 4100 1000 50 0000 L CNN
+F 2 "SM0603" H 3850 1200 60 0000 C CNN
+ 1 4050 1100
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR05
+U 1 1 5109F491
+P 4050 900
+F 0 "#PWR05" H 4050 990 20 0001 C CNN
+F 1 "+5V" H 4050 990 30 0000 C CNN
+ 1 4050 900
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR06
+U 1 1 5109F490
+P 4050 1350
+F 0 "#PWR06" H 4050 1350 30 0001 C CNN
+F 1 "GND" H 4050 1280 30 0001 C CNN
+ 1 4050 1350
+ 1 0 0 -1
+$EndComp
+Text Notes 5050 7650 0 60 ~ 0
+NOTE: Diode D5 is a little bigger than 0805
+Text Notes 600 5900 0 120 ~ 0
+NOTE: 5v Rail should be roughly 4.5V
+$Comp
+L GND #PWR07
+U 1 1 51031CF0
+P 4450 1350
+F 0 "#PWR07" H 4450 1350 30 0001 C CNN
+F 1 "GND" H 4450 1280 30 0001 C CNN
+ 1 4450 1350
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR08
+U 1 1 51031CE7
+P 4450 900
+F 0 "#PWR08" H 4450 990 20 0001 C CNN
+F 1 "+5V" H 4450 990 30 0000 C CNN
+ 1 4450 900
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C16
+U 1 1 51031CD8
+P 4450 1100
+F 0 "C16" H 4500 1200 50 0000 L CNN
+F 1 ".1u" H 4500 1000 50 0000 L CNN
+F 2 "SM0603" H 4850 1200 60 0000 C CNN
+ 1 4450 1100
+ 1 0 0 -1
+$EndComp
+Text Label 7600 5950 0 60 ~ 0
+POE+B
+$Comp
+L CAPAPOL C15
+U 1 1 510312D0
+P 7950 6250
+F 0 "C15" H 8000 6350 50 0000 L CNN
+F 1 "100u" H 8000 6150 50 0000 L CNN
+F 2 "PanasonicD8Cap" H 7950 6400 60 0000 C CNN
+F 4 "PCE5024CT-ND" H 7950 6000 60 0000 C CNN "Field4"
+ 1 7950 6250
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P8
+U 1 1 5102E84D
+P 1550 2650
+F 0 "P8" H 1630 2650 40 0000 L CNN
+F 1 "PB0" H 1550 2705 30 0001 C CNN
+F 2 ".1SMTPIN" H 1550 2650 60 0000 C CNN
+ 1 1550 2650
+ 1 0 0 -1
+$EndComp
+$Comp
+L XTAL4P X2
+U 1 1 5102E754
+P 6150 4850
+F 0 "X2" H 6150 5000 60 0000 C CNN
+F 1 "25MHz" H 6150 4700 60 0000 C CNN
+F 2 "XTAL4P" H 6150 4850 60 0000 C CNN
+ 1 6150 4850
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR09
+U 1 1 5102E4BB
+P 5100 900
+F 0 "#PWR09" H 5100 990 20 0001 C CNN
+F 1 "+5V" H 5100 990 30 0000 C CNN
+ 1 5100 900
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P6
+U 1 1 5102E4B1
+P 5400 1000
+F 0 "P6" H 5480 1000 40 0000 L CNN
+F 1 "5V" H 5400 1055 30 0001 C CNN
+F 2 ".1SMTPIN" H 5400 1000 60 0000 C CNN
+ 1 5400 1000
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR010
+U 1 1 5102E4A4
+P 6300 1150
+F 0 "#PWR010" H 6300 1110 30 0001 C CNN
+F 1 "+3.3V" H 6300 1260 30 0000 C CNN
+ 1 6300 1150
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P7
+U 1 1 5102E499
+P 6550 1250
+F 0 "P7" H 6630 1250 40 0000 L CNN
+F 1 "3V3" H 6550 1305 30 0001 C CNN
+F 2 ".1SMTPIN" H 6550 1250 60 0000 C CNN
+ 1 6550 1250
+ 1 0 0 -1
+$EndComp
+$Comp
+L XTAL4P X1
+U 1 1 5102E46E
+P 2400 1050
+F 0 "X1" H 2400 1200 60 0000 C CNN
+F 1 "XTAL4P" H 2400 900 60 0000 C CNN
+F 2 "XTAL4P" H 2400 800 60 0000 C CNN
+ 1 2400 1050
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P5
+U 1 1 5102E26F
+P 4200 1550
+F 0 "P5" H 4280 1550 40 0000 L CNN
+F 1 "PD34" H 4200 1605 30 0001 C CNN
+F 2 ".1SMTPIN" H 4200 1550 60 0000 C CNN
+ 1 4200 1550
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR011
+U 1 1 5102E175
+P 5000 1300
+F 0 "#PWR011" H 5000 1300 30 0001 C CNN
+F 1 "GND" H 5000 1230 30 0001 C CNN
+ 1 5000 1300
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_1 P4
+U 1 1 5102E167
+P 5400 1250
+F 0 "P4" H 5480 1250 40 0000 L CNN
+F 1 "GND" H 5400 1305 30 0001 C CNN
+F 2 ".1SMTPIN" H 5400 1250 60 0000 C CNN
+ 1 5400 1250
+ 1 0 0 -1
+$EndComp
+Text Label 7200 5750 0 60 ~ 0
+HighCOut
+$Comp
+L +5V #PWR012
+U 1 1 5101B419
+P 8150 6850
+F 0 "#PWR012" H 8150 6940 20 0001 C CNN
+F 1 "+5V" H 8150 6940 30 0000 C CNN
+ 1 8150 6850
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR013
+U 1 1 5101B3F2
+P 5700 7250
+F 0 "#PWR013" H 5700 7250 30 0001 C CNN
+F 1 "GND" H 5700 7180 30 0001 C CNN
+ 1 5700 7250
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C13
+U 1 1 5101B31A
+P 5800 5750
+F 0 "C13" H 5850 5850 50 0000 L CNN
+F 1 "0.01u" H 5850 5650 50 0000 L CNN
+F 2 "SM0603" H 5800 5750 60 0000 C CNN
+ 1 5800 5750
+ 0 1 1 0
+$EndComp
+$Comp
+L R R12
+U 1 1 5101B306
+P 4900 6500
+F 0 "R12" V 4980 6500 50 0000 C CNN
+F 1 "47k" V 4900 6500 50 0000 C CNN
+F 2 "SM0603" H 4900 6500 60 0000 C CNN
+ 1 4900 6500
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R13
+U 1 1 5101B2F6
+P 6350 7100
+F 0 "R13" V 6430 7100 50 0000 C CNN
+F 1 "1k" V 6350 7100 50 0000 C CNN
+F 2 "SM0603" H 6350 7100 60 0000 C CNN
+ 1 6350 7100
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R14
+U 1 1 5101B2F2
+P 6750 6600
+F 0 "R14" V 6850 6700 50 0000 C CNN
+F 1 "4.7k" V 6750 6600 50 0000 C CNN
+F 2 "SM0603" H 6750 6300 60 0000 C CNN
+ 1 6750 6600
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C14
+U 1 1 5101B2E1
+P 6350 6550
+F 0 "C14" H 6400 6650 50 0000 L CNN
+F 1 ".22u" H 6400 6450 50 0000 L CNN
+F 2 "SM0603" H 6400 6800 60 0000 C CNN
+ 1 6350 6550
+ 1 0 0 -1
+$EndComp
+$Comp
+L INDUCTOR L1
+U 1 1 5101B29F
+P 7150 6650
+F 0 "L1" V 7100 6650 40 0000 C CNN
+F 1 "68uH" V 7250 6650 40 0000 C CNN
+F 2 "BOURNS-SRR1280" H 7700 6600 60 0000 C CNN
+ 1 7150 6650
+ 1 0 0 1
+$EndComp
+$Comp
+L DIODESCH D5
+U 1 1 5101B283
+P 7400 6200
+F 0 "D5" H 7400 6300 40 0000 C CNN
+F 1 "DIODESCH" H 7400 6100 40 0000 C CNN
+F 2 "DO214" H 7400 6200 60 0001 C CNN
+F 4 "MBRX120LF-TPMSCT-ND" H 7400 6200 60 0001 C CNN "OLD PART"
+F 5 "B360A-FDICT-ND" H 7650 6000 60 0000 C CNN "NEW PART"
+ 1 7400 6200
+ -1 0 0 1
+$EndComp
+$Comp
+L A4447SLJTR U4
+U 1 1 5101A65E
+P 5600 6400
+F 0 "U4" H 5350 6900 60 0000 C CNN
+F 1 "A4447SLJTR" H 5600 6350 60 0000 C CNN
+F 2 "SO8E-WITHPAD" H 5600 6400 60 0000 C CNN
+ 1 5600 6400
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C12
+U 1 1 5101558F
+P 8250 6250
+F 0 "C12" H 8300 6350 50 0000 L CNN
+F 1 ".22u" H 8300 6150 50 0000 L CNN
+F 2 "SM0603" H 8250 6250 60 0001 C CNN
+ 1 8250 6250
+ 1 0 0 -1
+$EndComp
+Text Label 10200 4800 0 60 ~ 0
+POED
+Text Label 10350 5250 0 60 ~ 0
+POEC
+Text Label 10350 6100 0 60 ~ 0
+POEB
+Text Label 10300 5600 0 60 ~ 0
+POEA
+Text Label 8750 5600 0 60 ~ 0
+POE-
+Text Label 8900 5400 0 60 ~ 0
+POE+
+$Comp
+L GND #PWR014
+U 1 1 510061F7
+P 8750 6150
+F 0 "#PWR014" H 8750 6150 30 0001 C CNN
+F 1 "GND" H 8750 6080 30 0001 C CNN
+ 1 8750 6150
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR015
+U 1 1 51005EDF
+P 10450 3050
+F 0 "#PWR015" H 10450 3050 30 0001 C CNN
+F 1 "GND" H 10450 2980 30 0001 C CNN
+ 1 10450 3050
+ 1 0 0 -1
+$EndComp
+$Comp
+L CONN_10 P1
+U 1 1 51005E59
+P 11100 3550
+F 0 "P1" V 11050 3550 60 0000 C CNN
+F 1 "ETHERNET" V 11150 3550 60 0000 C CNN
+F 2 "SMT_ETHERNET" H 10850 4200 60 0000 C CNN
+ 1 11100 3550
+ 1 0 0 1
+$EndComp
+$Comp
+L R R11
+U 1 1 51005940
+P 10600 5850
+F 0 "R11" V 10680 5850 50 0000 C CNN
+F 1 "22k" V 10600 5850 50 0000 C CNN
+F 2 "SM0603" H 10600 5850 60 0000 C CNN
+ 1 10600 5850
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R9
+U 1 1 5100593D
+P 10550 5050
+F 0 "R9" V 10630 5050 50 0000 C CNN
+F 1 "22k" V 10550 5050 50 0000 C CNN
+F 2 "SM0603" H 10550 5050 60 0000 C CNN
+ 1 10550 5050
+ 1 0 0 -1
+$EndComp
+$Comp
+L BRIDGE-MB2S-TP D3
+U 1 1 5100592E
+P 9650 5950
+F 0 "D3" H 9400 5850 60 0000 C CNN
+F 1 "MB2S-TP" H 9700 6250 60 0000 C CNN
+F 2 "BESOP-4" H 9600 5800 60 0000 C CNN
+ 1 9650 5950
+ -1 0 0 1
+$EndComp
+$Comp
+L BRIDGE-MB2S-TP D4
+U 1 1 51005927
+P 9700 5200
+F 0 "D4" H 9450 5100 60 0000 C CNN
+F 1 "MB2S-TP" H 9750 5500 60 0000 C CNN
+F 2 "BESOP-4" H 9650 5050 60 0000 C CNN
+ 1 9700 5200
+ -1 0 0 1
+$EndComp
+$Comp
+L R R4
+U 1 1 50FDE21B
+P 6950 1950
+F 0 "R4" V 7030 1950 50 0000 C CNN
+F 1 "1k" V 6950 1950 50 0000 C CNN
+F 2 "SM0603" H 6950 1950 60 0001 C CNN
+ 1 6950 1950
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C9
+U 1 1 50FF036C
+P 3200 5050
+F 0 "C9" H 3250 5150 50 0000 L CNN
+F 1 "100u" H 3250 4950 50 0000 L CNN
+F 2 "SM1206" H 3200 5050 60 0001 C CNN
+F 4 "6.3v" H 3050 4950 60 0000 C CNN "Voltage"
+ 1 3200 5050
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C8
+U 1 1 50FE1E06
+P 8100 5450
+F 0 "C8" H 8150 5550 50 0000 L CNN
+F 1 "10u" H 8150 5350 50 0000 L CNN
+F 2 "SM0805" H 8100 5450 60 0001 C CNN
+ 1 8100 5450
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C7
+U 1 1 50FE1E04
+P 7800 5450
+F 0 "C7" H 7850 5550 50 0000 L CNN
+F 1 ".1u" H 7850 5350 50 0000 L CNN
+F 2 "SM0603" H 7800 5450 60 0001 C CNN
+ 1 7800 5450
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR016
+U 1 1 50FE1DE9
+P 7950 5250
+F 0 "#PWR016" H 7950 5210 30 0001 C CNN
+F 1 "+3.3V" H 7950 5360 30 0000 C CNN
+ 1 7950 5250
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR017
+U 1 1 50FE1DDF
+P 7950 5700
+F 0 "#PWR017" H 7950 5700 30 0001 C CNN
+F 1 "GND" H 7950 5630 30 0001 C CNN
+ 1 7950 5700
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR018
+U 1 1 50FE1DDB
+P 8650 5000
+F 0 "#PWR018" H 8650 5000 30 0001 C CNN
+F 1 "GND" H 8650 4930 30 0001 C CNN
+ 1 8650 5000
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R7
+U 1 1 50FE1D53
+P 8400 3950
+F 0 "R7" V 8480 3950 50 0000 C CNN
+F 1 "49.9" V 8400 3950 50 0000 C CNN
+F 2 "SM0603" H 8400 3950 60 0001 C CNN
+ 1 8400 3950
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R8
+U 1 1 50FE1D51
+P 8250 4450
+F 0 "R8" V 8330 4450 50 0000 C CNN
+F 1 "49.9" V 8250 4450 50 0000 C CNN
+F 2 "SM0603" H 8250 4450 60 0001 C CNN
+ 1 8250 4450
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R10
+U 1 1 50FE1D4B
+P 8000 3950
+F 0 "R10" V 8080 3950 50 0000 C CNN
+F 1 "10" V 8000 3950 50 0000 C CNN
+F 2 "SM0805" H 8000 3950 60 0001 C CNN
+ 1 8000 3950
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C6
+U 1 1 50FE1D43
+P 8650 4800
+F 0 "C6" H 8700 4900 50 0000 L CNN
+F 1 ".01u" H 8700 4700 50 0000 L CNN
+F 2 "SM0603" H 8650 4800 60 0001 C CNN
+ 1 8650 4800
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R6
+U 1 1 50FE1B0C
+P 8650 2500
+F 0 "R6" V 8730 2500 50 0000 C CNN
+F 1 "49.9" V 8650 2500 50 0000 C CNN
+F 2 "SM0603" H 8650 2500 60 0001 C CNN
+ 1 8650 2500
+ 0 1 1 0
+$EndComp
+$Comp
+L R R5
+U 1 1 50FE1B09
+P 8650 2200
+F 0 "R5" V 8730 2200 50 0000 C CNN
+F 1 "49.9" V 8650 2200 50 0000 C CNN
+F 2 "SM0603" H 8650 2200 60 0001 C CNN
+ 1 8650 2200
+ 0 1 1 0
+$EndComp
+$Comp
+L C C5
+U 1 1 50FE18F9
+P 8000 2400
+F 0 "C5" H 8050 2500 50 0000 L CNN
+F 1 ".01u" H 8050 2300 50 0000 L CNN
+F 2 "SM0603" H 8000 2400 60 0001 C CNN
+ 1 8000 2400
+ 1 0 0 -1
+$EndComp
+$Comp
+L S553-5999-52 T1
+U 1 1 50FE09F4
+P 9250 3850
+F 0 "T1" H 9100 4550 70 0000 C CNN
+F 1 "S558-5999-T7-F" H 9250 3100 70 0000 C CNN
+F 2 "BELFuse-S553" H 9250 3850 60 0001 C CNN
+ 1 9250 3850
+ -1 0 0 1
+$EndComp
+$Comp
+L +3.3V #PWR019
+U 1 1 50FDE179
+P 7750 2700
+F 0 "#PWR019" H 7750 2660 30 0001 C CNN
+F 1 "+3.3V" H 7750 2810 30 0000 C CNN
+ 1 7750 2700
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR020
+U 1 1 50FDE152
+P 7800 4050
+F 0 "#PWR020" H 7800 4050 30 0001 C CNN
+F 1 "GND" H 7800 3980 30 0001 C CNN
+ 1 7800 4050
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR021
+U 1 1 50FDE072
+P 7400 5150
+F 0 "#PWR021" H 7400 5150 30 0001 C CNN
+F 1 "GND" H 7400 5080 30 0001 C CNN
+ 1 7400 5150
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R3
+U 1 1 50FDE06A
+P 7400 4750
+F 0 "R3" V 7480 4750 50 0000 C CNN
+F 1 "12.4k" V 7400 4750 50 0000 C CNN
+F 2 "SM0603" H 7400 4750 60 0001 C CNN
+ 1 7400 4750
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR022
+U 1 1 50FDE020
+P 3700 4950
+F 0 "#PWR022" H 3700 5040 20 0001 C CNN
+F 1 "+5V" H 3700 5040 30 0000 C CNN
+ 1 3700 4950
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR023
+U 1 1 50FDE01D
+P 3700 5050
+F 0 "#PWR023" H 3700 5050 30 0001 C CNN
+F 1 "GND" H 3700 4980 30 0001 C CNN
+ 1 3700 5050
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR024
+U 1 1 50FDE008
+P 5600 4050
+F 0 "#PWR024" H 5600 4010 30 0001 C CNN
+F 1 "+3.3V" H 5600 4160 30 0000 C CNN
+ 1 5600 4050
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR025
+U 1 1 50FDE003
+P 5300 4850
+F 0 "#PWR025" H 5300 4810 30 0001 C CNN
+F 1 "+3.3V" H 5300 4960 30 0000 C CNN
+ 1 5300 4850
+ 1 0 0 -1
+$EndComp
+$Comp
+L +3.3V #PWR026
+U 1 1 50FDDFFD
+P 6700 4650
+F 0 "#PWR026" H 6700 4610 30 0001 C CNN
+F 1 "+3.3V" H 6700 4760 30 0000 C CNN
+ 1 6700 4650
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR027
+U 1 1 50FDDFE7
+P 6950 5600
+F 0 "#PWR027" H 6950 5600 30 0001 C CNN
+F 1 "GND" H 6950 5530 30 0001 C CNN
+ 1 6950 5600
+ 1 0 0 -1
+$EndComp
+$Comp
+L LED D2
+U 1 1 50FDDFB7
+P 7100 4800
+F 0 "D2" H 7250 4850 50 0000 C CNN
+F 1 "GRN" H 7100 4700 50 0000 C CNN
+F 2 "SM0805" H 7100 4800 60 0001 C CNN
+ 1 7100 4800
+ 0 1 1 0
+$EndComp
+$Comp
+L LED D1
+U 1 1 50FDDFB2
+P 6850 4800
+F 0 "D1" H 7000 4850 50 0000 C CNN
+F 1 "RED" H 6850 4700 50 0000 C CNN
+F 2 "SM0805" H 6850 4800 60 0001 C CNN
+ 1 6850 4800
+ 0 1 1 0
+$EndComp
+$Comp
+L R R2
+U 1 1 50FDDFA4
+P 7100 5300
+F 0 "R2" V 7180 5300 50 0000 C CNN
+F 1 "680" V 7100 5300 50 0000 C CNN
+F 2 "SM0603" H 7100 5300 60 0001 C CNN
+ 1 7100 5300
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R1
+U 1 1 50FDDFA0
+P 6850 5300
+F 0 "R1" V 6930 5300 50 0000 C CNN
+F 1 "680" V 6850 5300 50 0000 C CNN
+F 2 "SM0603" H 6850 5300 60 0001 C CNN
+ 1 6850 5300
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR028
+U 1 1 50FDDF6F
+P 5650 5450
+F 0 "#PWR028" H 5650 5450 30 0001 C CNN
+F 1 "GND" H 5650 5380 30 0001 C CNN
+ 1 5650 5450
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C11
+U 1 1 50FDDF10
+P 6450 5150
+F 0 "C11" H 6500 5250 50 0000 L CNN
+F 1 "12p" H 6500 5050 50 0000 L CNN
+F 2 "SM0603" H 6450 5150 60 0001 C CNN
+ 1 6450 5150
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C10
+U 1 1 50FDDF0D
+P 5850 5150
+F 0 "C10" H 5900 5250 50 0000 L CNN
+F 1 "12p" H 5900 5050 50 0000 L CNN
+F 2 "SM0603" H 5850 5150 60 0001 C CNN
+ 1 5850 5150
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR029
+U 1 1 50FDDEFB
+P 5600 2400
+F 0 "#PWR029" H 5600 2400 30 0001 C CNN
+F 1 "GND" H 5600 2330 30 0001 C CNN
+ 1 5600 2400
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C4
+U 1 1 50FDDED5
+P 5250 3900
+F 0 "C4" H 5300 4000 50 0000 L CNN
+F 1 "10u" H 5300 3800 50 0000 L CNN
+F 2 "SM0805" H 5250 3900 60 0001 C CNN
+ 1 5250 3900
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C3
+U 1 1 50FDDE1C
+P 2700 850
+F 0 "C3" H 2750 950 50 0000 L CNN
+F 1 "12p" H 2750 750 50 0000 L CNN
+F 2 "SM0603" H 2700 850 60 0001 C CNN
+ 1 2700 850
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C2
+U 1 1 50FDDE19
+P 2100 850
+F 0 "C2" H 2150 950 50 0000 L CNN
+F 1 "12p" H 2150 750 50 0000 L CNN
+F 2 "SM0603" H 2100 850 60 0001 C CNN
+ 1 2100 850
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR030
+U 1 1 50FDDD8F
+P 3700 1600
+F 0 "#PWR030" H 3700 1600 30 0001 C CNN
+F 1 "GND" H 3700 1530 30 0001 C CNN
+ 1 3700 1600
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR031
+U 1 1 50FDDD86
+P 3500 1650
+F 0 "#PWR031" H 3500 1740 20 0001 C CNN
+F 1 "+5V" H 3500 1740 30 0000 C CNN
+ 1 3500 1650
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR032
+U 1 1 50FDDD79
+P 3100 4050
+F 0 "#PWR032" H 3100 4140 20 0001 C CNN
+F 1 "+5V" H 3100 4140 30 0000 C CNN
+ 1 3100 4050
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR033
+U 1 1 50FDDD69
+P 3600 4050
+F 0 "#PWR033" H 3600 4050 30 0001 C CNN
+F 1 "GND" H 3600 3980 30 0001 C CNN
+ 1 3600 4050
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C1
+U 1 1 50FDDD3A
+P 3500 4300
+F 0 "C1" H 3550 4400 50 0000 L CNN
+F 1 ".1u" H 3550 4200 50 0000 L CNN
+F 2 "SM0603" H 3500 4300 60 0001 C CNN
+ 1 3500 4300
+ 1 0 0 -1
+$EndComp
+$Comp
+L +5V #PWR034
+U 1 1 50FDDB58
+P 1050 2950
+F 0 "#PWR034" H 1050 3040 20 0001 C CNN
+F 1 "+5V" H 1050 3040 30 0000 C CNN
+ 1 1050 2950
+ 1 0 0 -1
+$EndComp
+$Comp
+L GND #PWR035
+U 1 1 50FDDB44
+P 1400 3100
+F 0 "#PWR035" H 1400 3100 30 0001 C CNN
+F 1 "GND" H 1400 3030 30 0001 C CNN
+ 1 1400 3100
+ 1 0 0 -1
+$EndComp
+$Comp
+L AVRISP6 J1
+U 1 1 50FDDACD
+P 1150 3650
+F 0 "J1" H 950 3900 60 0000 C CNN
+F 1 "AVRISP6" H 1300 3350 60 0000 C CNN
+F 2 "RIBBON6SMT" H 1150 3650 60 0001 C CNN
+ 1 1150 3650
+ 0 -1 -1 0
+$EndComp
+$Comp
+L ATMEGA328-A_CHIPACCURATE U1
+U 1 1 50FDD883
+P 3500 2800
+F 0 "U1" V 2800 4050 50 0000 L BNN
+F 1 "ATMEGA328" V 2700 3250 50 0000 L BNN
+F 2 "TQFP32" H 2950 1450 50 0001 C CNN
+ 1 3500 2800
+ 0 1 1 0
+$EndComp
+$Comp
+L MCP1824 U2
+U 1 1 50FDD878
+P 4650 5050
+F 0 "U2" H 4400 5350 60 0000 C CNN
+F 1 "MCP1824v3.3" H 4750 4750 60 0000 C CNN
+F 2 "SOT23-5" H 4650 5050 60 0001 C CNN
+ 1 4650 5050
+ 1 0 0 -1
+$EndComp
+$Comp
+L ENC424J600 U3
+U 1 1 50FDC84D
+P 6550 3400
+F 0 "U3" H 5850 4250 60 0000 C CNN
+F 1 "ENC424J600" H 7450 2500 60 0000 C CNN
+F 2 "TQFP44" H 6550 3400 60 0001 C CNN
+ 1 6550 3400
+ 1 0 0 -1
+$EndComp
+$EndSCHEMATC
View
6 demo_mineandhttp/Makefile
@@ -24,9 +24,9 @@ PROCESSOR=atmega328
PROGRAMCODE=m328
#CPUFREQ=28636363UL
CPUFREQ=20000000UL
-COMMON_FLAGS= -mmcu=$(PROCESSOR) -I. -I.. -I../http -I../microsd -I../libs -I../ipcore -I../dumbcraft
-CFLAGS = -std=gnu99 -Os $(COMMON_FLAGS) -DF_CPU=$(CPUFREQ) -DNO_HTTP #-DMUTE_PRINTF #-DNO_HTTP #-Wall
-CFLAGS:=$(CFLAGS) -flto -fwhole-program
+COMMON_FLAGS= -mmcu=$(PROCESSOR) -I. -I.. -I../http -I../microsd -I../libs -I../ipcore -I../dumbcraft -I../mfs
+CFLAGS = -std=gnu99 -O1 $(COMMON_FLAGS) -DF_CPU=$(CPUFREQ) #-DNO_HTTP #-DMUTE_PRINTF #-DNO_HTTP #-Wall
+CFLAGS:=$(CFLAGS) #-flto -fwhole-program
AS = avr-gcc
ASFLAGS = $(COMMON_FLAGS) -c
EXTRA_LD_FLAGS=-Wl,--relax -Wa,-a,-ad -mcall-prologues
View
2 demo_mineandhttp/eth_config.h
@@ -43,7 +43,7 @@
//It's the same size, faster, but not thread safe. Used in conjunction with ASM_SPI
//NOTE: This does not work on the ATMega168 for some reason, even at lower speeds?
//NOTE: This will not work at 28 MHz
-//#define ASM_REALLY_FAST_SPI
+#define ASM_REALLY_FAST_SPI
//Minimum MTU every host must be able to handle;
#define MAX_FRAMELEN 578
View
10 demo_mineandhttp/test.c
@@ -368,11 +368,10 @@ int main( void )
//unsigned short phys[32];
-#ifndef NO_HTTP
+#ifndef HTTP_USE_MEMORY_FS
if( initSD() )
{
sendstr( "Fatal error. Cannot open SD card.\n" );
- //return -1;
}
openFAT();
@@ -402,7 +401,7 @@ int main( void )
UpdateServer();
#ifndef NO_HTTP
- HTTPTick();
+ HTTPTick(0);
#endif
if( TIFR2 & _BV(TOV2) )
@@ -419,6 +418,11 @@ int main( void )
delayctr = 0;
TickServer();
}
+
+#ifndef NO_HTTP
+ HTTPTick(1);
+#endif
+
}
}
View
9 demo_x86_dumbcraft/Makefile
@@ -1,9 +1,12 @@
all : dumbcraft
-CFLAGS:=-I. -I../dumbcraft -I../libs -DDEBUG_DUMBCRAFT
+CC:=gcc
+COMMONFLAGS:= -Os -m32 -flto -g
+CFLAGS:=-I. -I../dumbcraft -I../libs $(COMMONFLAGS) #-DDEBUG_DUMBCRAFT
+LDFLAGS:=-fwhole-program $(COMMONFLAGS) -Wl,-Map,prog.map -s
dumbcraft : main.o ../dumbcraft/dumbcraft.o ../libs/util10.o ../libs/os_generic.o dumbgame.o
- gcc -o $@ $^ -lpthread
+ $(CC) $(LDFLAGS) -o $@ $^
clean :
- rm -rf *.o *~ dumbcraft ../dumbcraft/*.o ../lib/*.o
+ rm -rf *.o *~ dumbcraft ../dumbcraft/*.o ../libs/*.o
View
18 demo_x86_dumbcraft/dumbgame.c
@@ -160,17 +160,17 @@ void PlayerClick( uint8_t playerid, uint8_t x, uint8_t y, uint8_t z )
if( didflip )
{
- //SwitchToBroadcast();
- //TODO XXX This should be broadcast.
+ StartupBroadcast();
StartSend();
- Sbyte( 0x3d ); //effect
- Sint( didflip + 999 );
- Sint( x );
- Sbyte( y );
- Sint( z );
- Sint( 0 );
- Sbyte( 0 );
+ Sbyte( 0x29 ); //effect
+ Sstring( "random.click", -1 );
+ Sint( x<<3 );
+ Sint( y<<3 );
+ Sint( z<<3 );
+ Sfloat( 1<<FIXEDPOINT );
+ Sbyte( 63 );
DoneSend();
+ DoneBroadcast();
}
}
View
13 dumbcraft/dumbcraft.c
@@ -26,6 +26,8 @@
#define memcpy_P memcpy
#endif
+struct Player Players[MAX_PLAYERS];
+
//#define DEBUG_DUMBCRAFT
//We don't want to pass the player ID around with us, this helps us
@@ -354,14 +356,17 @@ void SblockInternal( uint8_t x, uint8_t y, uint8_t z, uint8_t bt, uint8_t meta )
//Spawn player (used to notify other clients about the spawnage)
void SSpawnPlayer( uint8_t pid )
{
+// printf( "!!! %d\n", pid ); //XXX TODO This does not seem to be called correctly.
struct Player * p = &Players[pid];
char stmp[5];
Uint8To16Str( stmp, pid + PLAYER_EID_BASE );
StartSend();
Sbyte( 0x0c ); //new
+ Svarint( pid + PLAYER_EID_BASE );
Sstring( stmp, -1 );
Sstring( p->playername, -1 );
+
Sint( p->x );
Sint( p->y );
Sint( p->z );
@@ -378,7 +383,7 @@ void UpdatePlayerSpeed( uint8_t playerno, uint8_t speed )
Sbyte(0x20); //NEW
Sint( playerno );
Sint( 1 );
- Sstring( "generic.movementSpeed", strlen( "generic.movementSpeed" ) );
+ Sstring( "generic.movementSpeed", -1 );
Sdouble( speed );
Sshort(0);
DoneSend();
@@ -460,6 +465,7 @@ void UpdateServer()
p->need_to_reply_to_ping = 0;
}
+ //XXX TODO Player list doesn't seem to be sending.
if( p->need_to_send_playerlist )
{
unsigned length = sizeof( pingjson1 ) + sizeof( pingjson2 ) + sizeof( pingjson3 ) + sizeof( pingjson4 ) + 24 + strlen( MOTD_NAME );
@@ -632,8 +638,6 @@ void UpdateServer()
char stmp[5];
Uint8To16Str( stmp, player + PLAYER_EID_BASE );
- printf( "Sending login.\n" );
- printf( "%s\n", p->playername );
p->need_to_login = 0;
StartSend();
Sbyte( 0x02 ); //Login success
@@ -875,7 +879,9 @@ void GotData( uint8_t playerno )
p->handshake_state = 3;
break;
default:
+#ifdef DEBUG_DUMBCRAFT
printf( "Confusing packet for mode 2.\n" );
+#endif
break;
}
}
@@ -905,7 +911,6 @@ void GotData( uint8_t playerno )
}
chatlen++;
chat[i8] = 0;
- printf( "Received: %s\n", chat );
break;
case 0x02: //Use Entity
View
4 dumbcraft/dumbcraft.h
@@ -5,7 +5,7 @@
#define PROTO_VERSION 4
#define PROTO_VERSION_STR "4"
-#define LONG_PROTO_VERSION "1.7.2"
+#define LONG_PROTO_VERSION "1.7.4"
#define PLAYER_EID_BASE 0x20
#define MAX_CHATLEN 100
@@ -44,7 +44,7 @@ void UpdatePlayerSpeed( uint8_t playerno, uint8_t speed ); //before shifting is
//Game section
-struct Player
+extern struct Player
{
//Used for broadcast sending
uint16_t outcirctail;
View
3 http/eth_config.h
@@ -96,7 +96,8 @@
//Scratchpad for sending out packets like UDP, ICMP, ARP, etc.
#define TX_SCRATCHPAD_END 1024
-#define RX_BUFFER_SIZE (3264)
+//#define RX_BUFFER_SIZE (3264)
+#define RX_BUFFER_SIZE (5264)
#define RX_BUFFER_END 0x5FFF
//Memory configuration
View
95 http/example.c
@@ -43,7 +43,7 @@ unsigned char MyMAC[6];
uint8_t TCPReceiveSyn( uint16_t portno )
{
- sendhex4( portno );
+ //sendhex4( portno );
if( portno == 80 )
{
uint8_t ret = GetFreeConnection();
@@ -60,7 +60,7 @@ uint8_t TCPReceiveSyn( uint16_t portno )
void TCPConnectionClosing( uint8_t conn )
{
// sendstr( "Lostconn\n" );
- printf( "HTTPCX %d\n", conn );
+// printf( "HTTPCX %d\n", conn );
curhttp = &HTTPConnections[conn];
HTTPClose( );
}
@@ -138,7 +138,7 @@ void HTTPCustomCallback( )
if( h->isdone )
{
- printf( "HTTPCloseY\n" );
+// printf( "HTTPCloseY\n" );
HTTPClose( h->socket );
return;
}
@@ -152,61 +152,72 @@ void HTTPCustomCallback( )
StartTCPWrite( h->socket );
memset( outb, 32, 128 );
- int8tohex( TCPs[i].state, &outb[0] );
- int16tohex( TCPs[i].this_port, &outb[4] );
- int16tohex( TCPs[i].dest_port, &outb[9] );
- int16tohex( TCPs[i].dest_addr>>16, &outb[14] );
- int16tohex( TCPs[i].dest_addr, &outb[18] );
+ if( h->state_deets == HTTP_CONNECTIONS )
+ {
+ int16tohex( icmp_in>>16, &outb[0] );
+ int16tohex( icmp_in, &outb[4] );
+
+ int16tohex( icmp_out>>16, &outb[9] );
+ int16tohex( icmp_out, &outb[13] );
+
+ h->isdone = 1;
+ }
+ else
+ {
+ int8tohex( TCPs[i].state, &outb[0] );
+ int16tohex( TCPs[i].this_port, &outb[4] );
+ int16tohex( TCPs[i].dest_port, &outb[9] );
+ int16tohex( TCPs[i].dest_addr>>16, &outb[14] );
+ int16tohex( TCPs[i].dest_addr, &outb[18] );
- int16tohex( TCPs[i].seq_num>>16, &outb[23] );
- int16tohex( TCPs[i].seq_num, &outb[27] );
+ int16tohex( TCPs[i].seq_num>>16, &outb[23] );
+ int16tohex( TCPs[i].seq_num, &outb[27] );
- int16tohex( TCPs[i].ack_num>>16, &outb[32] );
- int16tohex( TCPs[i].ack_num, &outb[36] );
+ int16tohex( TCPs[i].ack_num>>16, &outb[32] );
+ int16tohex( TCPs[i].ack_num, &outb[36] );
- outb[44] = '/';
+ outb[44] = '/';
- int8tohex( TCPs[i].time_since_sent, &outb[45] );
- int16tohex( TCPs[i].idletime, &outb[48] );
- int8tohex( TCPs[i].retries, &outb[53] );
- int8tohex( TCPs[i].sendtype, &outb[56] );
+ int8tohex( TCPs[i].time_since_sent, &outb[45] );
+ int16tohex( TCPs[i].idletime, &outb[48] );
+ int8tohex( TCPs[i].retries, &outb[53] );
+ int8tohex( TCPs[i].sendtype, &outb[56] );
- outb[59] = '/';
- int16tohex( TCPs[i].sendptr, &outb[60] );
- int16tohex( TCPs[i].sendlength, &outb[65] );
- outb[70] = ':';
+ outb[59] = '/';
+ int16tohex( TCPs[i].sendptr, &outb[60] );
+ int16tohex( TCPs[i].sendlength, &outb[65] );
+ outb[70] = ':';
- int8tohex( HTTPConnections[i].state, &outb[71] );
- int8tohex( HTTPConnections[i].state_deets, &outb[74] );
+ int8tohex( HTTPConnections[i].state, &outb[71] );
+ int8tohex( HTTPConnections[i].state_deets, &outb[74] );
- for( j = 0; j < 10; j++ )
- if( HTTPConnections[i].pathbuffer[j] )
- outb[77+j] = HTTPConnections[i].pathbuffer[j];
+ for( j = 0; j < 10; j++ )
+ if( HTTPConnections[i].pathbuffer[j] )
+ outb[77+j] = HTTPConnections[i].pathbuffer[j];
- outb[89] = '*';
- int8tohex( HTTPConnections[i].is_dynamic, &outb[90] );
- int16tohex( HTTPConnections[i].timeout, &outb[93] );
+ outb[89] = '*';
+ int8tohex( HTTPConnections[i].is_dynamic, &outb[90] );
+ int16tohex( HTTPConnections[i].timeout, &outb[93] );
- int16tohex( HTTPConnections[i].bytesleft>>16, &outb[98] );
- int16tohex( HTTPConnections[i].bytesleft, &outb[102] );
+ int16tohex( HTTPConnections[i].bytesleft>>16, &outb[98] );
+ int16tohex( HTTPConnections[i].bytesleft, &outb[102] );
- int16tohex( HTTPConnections[i].bytessofar>>16, &outb[107] );
- int16tohex( HTTPConnections[i].bytessofar, &outb[111] );
+ int16tohex( HTTPConnections[i].bytessofar>>16, &outb[107] );
+ int16tohex( HTTPConnections[i].bytessofar, &outb[111] );
- int8tohex( HTTPConnections[i].is404, &outb[116] );
- int8tohex( HTTPConnections[i].isdone, &outb[119] );
- int8tohex( HTTPConnections[i].isfirst, &outb[122] );
- int8tohex( HTTPConnections[i].socket, &outb[125] );
+ int8tohex( HTTPConnections[i].is404, &outb[116] );
+ int8tohex( HTTPConnections[i].isdone, &outb[119] );
+ int8tohex( HTTPConnections[i].isfirst, &outb[122] );
+ int8tohex( HTTPConnections[i].socket, &outb[125] );
+
+ h->state_deets++;
+ }
PushStr( outb );
PushStr( "\n" );
EndTCPWrite( h->socket );
- h->state_deets++;
- if( h->state_deets == HTTP_CONNECTIONS )
- {
- h->isdone = 1;
- }
+
return;
}
View
15 http/http.c
@@ -1,6 +1,13 @@
#include "http.h"
#include <tcp.h>
#include <avr_print.h>
+
+#ifndef MUTE_PRINTF
+#include <stdio.h>
+#else
+#define printf( x... )
+#endif
+
#include <string.h>
#include <util10.h>
#include <avr/pgmspace.h>
@@ -94,7 +101,7 @@ void HTTPGotData( uint8_t id, uint16_t len )
len = 0;
break;
case TCP_WAIT_CLOSE:
- printf( "__HTTPCLose1\n" );
+ //printf( "__HTTPCLose1\n" );
HTTPClose( );
break;
default:
@@ -129,7 +136,7 @@ void HTTPTick( uint8_t timed )
case TCP_WAIT_CLOSE:
if( TCPCanSend( curhttp->socket ) )
{
- printf( "HTTPCLose2\n");
+ //printf( "HTTPCLose2\n");
HTTPClose( );
}
break;
@@ -138,7 +145,7 @@ void HTTPTick( uint8_t timed )
{
if( curhttp->timeout++ > HTTP_SERVER_TIMEOUT )
{
- printf( "HTTPClose3\n" );
+ //printf( "HTTPClose3\n" );
HTTPClose( );
}
}
@@ -153,7 +160,7 @@ void HTTPHandleInternalCallback( )
if( curhttp->isdone )
{
- printf( "HTTPClose4\n" );
+ //printf( "HTTPClose4\n" );
HTTPClose( );
return;
}
View
32 ipcore/enc424j600.c
@@ -270,13 +270,15 @@ void enc424j600_finish_callback_now()
{
unsigned short nextpos;
ETCSPORT |= ETCS;
- enc_oneshot( ESSETPKTDEC );
//XXX BUG: NextPacketPointer-2 may be less than in the RX area
if( NextPacketPointer == RX_BUFFER_START )
- nextpos = 0x5FFE;
+ nextpos = 0x5FFE; //XXX MAGIC NUMBER
else
nextpos = NextPacketPointer - 2;
+
enc424j600_write_ctrl_reg16( EERXTAILL, nextpos );
+ enc_oneshot( ESSETPKTDEC );
+
termcallbackearly = 1;
}
@@ -294,21 +296,27 @@ unsigned short enc424j600_recvpack()
//if ERXTAIL == ERXHEAD this is BAD! (it thinks it's full)
//ERXTAIL should be 2 less than ERXHEAD
//Note: you don't read the two bytes immediately following ERXTAIL, they are dummy.
+// if( enc424j600_read_ctrl_reg16( EERXHEADL ) == enc424j600_read_ctrl_reg16( EERXTAILL ) )
+// {
+// //I Tried this, the code in here never got called. I thought this might be the cause of the missing packets.
+// }
-/*
- sendchr( '\n' );
- sendhex4( enc424j600_read_ctrl_reg16( EERXHEADL ) );
- sendchr( ':' );
- sendhex4( enc424j600_read_ctrl_reg16( EERXTAILL ) );
- sendchr( '\n' );
- */
//NextPacketPointer contains the start address of ERXST initially
- if( !enc_read_ctrl_reg8_common( EESTATL ) )
+ uint8_t estat = enc_read_ctrl_reg8_common( EESTATL );
+ if( !estat )
{
return 0;
}
+// Initially, I thought this may be the source of dropped incoming packets.
+// This has nothing to do with dropped packets.
+// Do we have much of a queue?
+// if( estat > 5 )
+// {
+// sendstr( "STAT OVERRIDE\n" );
+// }
+
// sendchr( '.' );
//Configure ERXDATA for reading.
enc424j600_write_ctrl_reg16( EERXRDPTL, NextPacketPointer );
@@ -330,6 +338,10 @@ unsigned short enc424j600_recvpack()
//Dest mac.
enc424j600_receivecallback( receivedbytecount );
+ } else
+ {
+ //I have never observed tis code getting called, even when I saw dropped packets.
+// sendstr( "bad pack\n" );
}
if( !termcallbackearly )
View
11 ipcore/iparpetc.c
@@ -11,6 +11,9 @@
#include <string.h>
#include <avr/pgmspace.h>
+unsigned long icmp_in = 0;
+unsigned long icmp_out = 0;
+
unsigned char macfrom[6];
unsigned char ipsource[4];
unsigned short remoteport;
@@ -316,6 +319,8 @@ static void HandleICMP()
unsigned short payload_from_start, payload_dest_start;
+ icmp_in++;
+
type = POP;
POP; //code
POP16; //Checksum
@@ -377,6 +382,7 @@ static void HandleICMP()
enc424j600_alter_word( 30, ppl );
enc424j600_endsend();
+ icmp_out++;
break;
}
@@ -485,6 +491,7 @@ void enc424j600_receivecallback( uint16_t packetlen )
//Make sure it's ethernet!
if( POP != 0x08 )
{
+ sendstr( "Not ethernet.\n" );
return;
}
@@ -502,6 +509,7 @@ void enc424j600_receivecallback( uint16_t packetlen )
if( POP != 0x45 )
{
// sendstr( "CFH\n" );
+ sendstr( "Not IP.\n" );
return;
}
@@ -540,7 +548,10 @@ void enc424j600_receivecallback( uint16_t packetlen )
}
if( !is_the_packet_for_me )
+ {
+ sendstr( "not for me\n" );
return;
+ }
//XXX TODO Handle IPL > 5 (IHL?)
View
3 ipcore/iparpetc.h
@@ -24,6 +24,9 @@ extern unsigned char ipsource[4];
extern unsigned short remoteport;
extern unsigned short localport;
+extern unsigned long icmp_in;
+extern unsigned long icmp_out;
+
//Utility out
void SwitchToBroadcast();
void send_etherlink_header( unsigned short type );

0 comments on commit 9d64e9e

Please sign in to comment.
Something went wrong with that request. Please try again.