diff --git a/sim/.gitignore b/sim/.gitignore
deleted file mode 100644
index 91eb721..0000000
--- a/sim/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-grbl_sim.exe
-*.dat
diff --git a/sim/HelloWorld.nc b/sim/HelloWorld.nc
deleted file mode 100644
index 637a4f3..0000000
--- a/sim/HelloWorld.nc
+++ /dev/null
@@ -1,323 +0,0 @@
-( Made using CamBam - http://www.cambam.co.uk )
-( Untitled 2/13/2012 2:54:50 PM )
-( T0 : 0.0394 )
-G20 G90 G64 G40
-G0 Z0.125
-( T0 : 0.0394 )
-T0 M6
-( Engrave1 )
-G17
-M3 S1000
-G0 X-3.0 Y-0.0451
-G1 F10.0 Z-0.001
-G1 F60.0 X-2.8845 Y-0.035
-G3 X-2.8723 Y-0.0943 I0.3244 J0.0363
-G3 X-2.8467 Y-0.1492 I0.2072 J0.0631
-G3 X-2.805 Y-0.1917 I0.1471 J0.1027
-G3 X-2.7533 Y-0.2212 I0.1578 J0.2169
-G3 X-2.6114 Y-0.2483 I0.1366 J0.3297
-G3 X-2.4877 Y-0.2275 I0.006 J0.3418
-G3 X-2.4438 Y-0.2048 I-0.0766 J0.2022
-G3 X-2.4082 Y-0.1707 I-0.0792 J0.1182
-G3 X-2.3817 Y-0.0912 I-0.1063 J0.0796
-G3 X-2.4069 Y-0.0155 I-0.1191 J0.0024
-G3 X-2.4449 Y0.0175 I-0.1101 J-0.0883
-G3 X-2.4902 Y0.0394 I-0.1379 J-0.2279
-G3 X-2.572 Y0.0637 I-0.3019 J-0.8663
-G3 X-2.6549 Y0.0842 I-1.0468 J-4.0562
-G2 X-2.7457 Y0.1086 I0.3878 J1.6213
-G2 X-2.8334 Y0.1422 I0.1472 J0.5158
-G2 X-2.8886 Y0.1787 I0.1401 J0.2718
-G2 X-2.9325 Y0.2281 I0.1404 J0.1692
-G2 X-2.9647 Y0.3435 I0.1821 J0.1129
-G2 X-2.9249 Y0.4741 I0.2336 J0.0003
-G2 X-2.8088 Y0.5669 I0.2044 J-0.1368
-G2 X-2.6391 Y0.5984 I0.1639 J-0.4097
-G2 X-2.5469 Y0.5908 I0.0024 J-0.5372
-G2 X-2.458 Y0.565 I-0.0669 J-0.395
-G2 X-2.3369 Y0.4678 I-0.0947 J-0.2421
-G2 X-2.2915 Y0.3221 I-0.2346 J-0.1531
-G1 X-2.4088 Y0.3132
-G3 X-2.4277 Y0.386 I-0.236 J-0.0223
-G3 X-2.4732 Y0.4457 I-0.1488 J-0.0662
-G3 X-2.5498 Y0.4817 I-0.1158 J-0.1469
-G3 X-2.6341 Y0.4905 I-0.08 J-0.3586
-G3 X-2.7184 Y0.4829 I-0.0045 J-0.4232
-G3 X-2.7962 Y0.4495 I0.0315 J-0.1804
-G3 X-2.8331 Y0.4066 I0.0864 J-0.1118
-G3 X-2.8467 Y0.3517 I0.1005 J-0.0539
-G3 X-2.8107 Y0.2697 I0.1052 J-0.0028
-G3 X-2.7679 Y0.2452 I0.1001 J0.125
-G3 X-2.698 Y0.2215 I0.2359 J0.583
-G3 X-2.6265 Y0.2034 I0.3957 J1.414
-G2 X-2.5228 Y0.1782 I-0.5539 J-2.5053
-G2 X-2.4215 Y0.1448 I-0.1803 J-0.7161
-G2 X-2.3553 Y0.1057 I-0.1442 J-0.3193
-G2 X-2.3022 Y0.0501 I-0.1407 J-0.1878
-G2 X-2.2637 Y-0.0811 I-0.19 J-0.127
-G2 X-2.306 Y-0.2205 I-0.2532 J0.0006
-G2 X-2.4278 Y-0.3221 I-0.2339 J0.1566
-G2 X-2.6057 Y-0.3581 I-0.1712 J0.3891
-G2 X-2.7129 Y-0.3503 I-0.0037 J0.6909
-G2 X-2.8164 Y-0.3215 I0.0637 J0.4292
-G2 X-2.9495 Y-0.2117 I0.1147 J0.2747
-G2 X-3.0 Y-0.0451 I0.265 J0.1712
-G0 Z0.125
-G0 X-2.111
-G1 F10.0 Z-0.001
-G1 F60.0 Y0.5826
-G1 X-1.9975
-G1 Y0.2508
-G2 X-1.9077 Y0.3198 I0.2024 J-0.1703
-G2 X-1.7969 Y0.3429 I0.1077 J-0.2394
-G2 X-1.6675 Y0.3132 I0.0063 J-0.2692
-G2 X-1.5893 Y0.2325 I-0.0755 J-0.1515
-G2 X-1.5698 Y0.1586 I-0.2396 J-0.1028
-G2 X-1.5653 Y0.0823 I-0.5851 J-0.0725
-G1 Y-0.3423
-G1 X-1.6789
-G1 Y0.0823
-G3 X-1.6859 Y0.1476 I-0.2729 J0.0036
-G3 X-1.7161 Y0.206 I-0.1238 J-0.027
-G3 X-1.764 Y0.2366 I-0.0845 J-0.0794
-G3 X-1.8202 Y0.2451 I-0.0537 J-0.1649
-G3 X-1.9155 Y0.2186 I-0.0001 J-0.1841
-G3 X-1.9786 Y0.1479 I0.072 J-0.1278
-G3 X-1.9938 Y0.087 I0.221 J-0.0878
-G3 X-1.9975 Y0.0243 I0.4875 J-0.0599
-G1 Y-0.3423
-G1 X-2.111
-G1 Y-0.0451
-G0 Z0.125
-G0 X-1.4292 Y-0.1385
-G1 F10.0 Z-0.001
-G2 F60.0 X-1.4088 Y-0.076 I0.182 J-0.0249
-G2 X-1.3502 Y-0.0104 I0.1662 J-0.0896
-G2 X-1.2681 Y0.0268 I0.1554 J-0.2334
-G2 X-1.1672 Y0.0438 I0.1926 J-0.8334
-G3 X-1.065 Y0.0586 I-0.2128 J1.8303
-G3 X-0.9647 Y0.0829 I-0.1109 J0.6767
-G3 X-0.9641 Y0.1126 I-1.9501 J0.0563
-G3 X-0.97 Y0.1648 I-0.2046 J0.003
-G3 X-0.9962 Y0.2104 I-0.0883 J-0.0204
-G3 X-1.0574 Y0.2412 I-0.0943 J-0.111
-G3 X-1.1256 Y0.2489 I-0.0647 J-0.2692
-G3 X-1.187 Y0.2436 I-0.0032 J-0.3217
-G3 X-1.2442 Y0.2205 I0.0237 J-0.141
-G3 X-1.2805 Y0.1756 I0.0774 J-0.0998
-G3 X-1.3003 Y0.1214 I0.2336 J-0.1162
-G1 X-1.4114 Y0.1366
-G2 X-1.3931 Y0.1969 I0.337 J-0.0694
-G2 X-1.3615 Y0.2514 I0.2096 J-0.0848
-G2 X-1.3162 Y0.2923 I0.1453 J-0.1155
-G2 X-1.2612 Y0.3189 I0.1409 J-0.221
-G2 X-1.1092 Y0.3429 I0.1442 J-0.4206
-G2 X-1.0386 Y0.3388 I0.0029 J-0.5642
-G2 X-0.9697 Y0.3227 I-0.0351 J-0.3052
-G2 X-0.927 Y0.3022 I-0.0865 J-0.2354
-G2 X-0.8909 Y0.2716 I-0.0727 J-0.1224
-G2 X-0.8555 Y0.1946 I-0.1386 J-0.1102
-G2 X-0.8507 Y0.1424 I-0.3836 J-0.0615
-G2 X-0.8499 Y0.0899 I-1.3758 J-0.0494
-G1 Y-0.0615
-G3 X-0.8489 Y-0.1619 I4.6791 J-0.0068
-G3 X-0.8429 Y-0.2622 I0.9512 J0.0067
-G3 X-0.8139 Y-0.3423 I0.2546 J0.0469
-G1 X-0.9325
-G2 X-0.9552 Y-0.2596 I0.2182 J0.1044
-G2 X-1.077 Y-0.3354 I-0.2823 J0.3183
-G2 X-1.2019 Y-0.3574 I-0.1221 J0.3266
-G2 X-1.2917 Y-0.3463 I-0.0042 J0.3355
-G2 X-1.3716 Y-0.3038 I0.0496 J0.1895
-G2 X-1.4309 Y-0.1656 I0.1197 J0.1332
-G2 X-1.4292 Y-0.1385 I0.1837 J0.0022
-G0 Z0.125
-G0 X-1.3093 Y-0.1513
-G1 F10.0 Z-0.001
-G3 F60.0 X-1.3098 Y-0.1625 I0.0949 J-0.0101
-G3 X-1.2757 Y-0.2382 I0.0971 J-0.0018
-G3 X-1.228 Y-0.2624 I0.075 J0.0889
-G3 X-1.1748 Y-0.2685 I0.0506 J0.2058
-G3 X-1.0581 Y-0.2401 I0.0042 J0.2367
-G3 X-0.983 Y-0.1612 I-0.0857 J0.1567
-G3 X-0.9681 Y-0.1054 I-0.1756 J0.0768
-G3 X-0.9647 Y-0.0477 I-0.4434 J0.0549
-G1 Y-0.006
-G2 X-1.0563 Y-0.0325 I-0.2032 J0.5301
-G2 X-1.1502 Y-0.0489 I-0.2867 J1.3668
-G3 X-1.2003 Y-0.0575 I0.1165 J-0.8276
-G3 X-1.2492 Y-0.0716 I0.0505 J-0.2671
-G3 X-1.294 Y-0.1089 I0.0375 J-0.0907
-G3 X-1.3093 Y-0.1513 I0.0797 J-0.0526
-G0 Z0.125
-G0 X-0.6738
-G1 F10.0 Z-0.001
-G1 F60.0 Y0.3277
-G1 X-0.5704
-G1 Y0.2407
-G2 X-0.4877 Y0.317 I0.2085 J-0.1428
-G2 X-0.376 Y0.3429 I0.1052 J-0.2003
-G2 X-0.2246 Y0.2987 I0.0049 J-0.265
-G2 X-0.1256 Y0.1738 I-0.1536 J-0.2235
-G2 X-0.0921 Y-0.0022 I-0.4197 J-0.1709
-G2 X-0.1294 Y-0.1877 I-0.4477 J-0.0066
-G2 X-0.2366 Y-0.3139 I-0.2559 J0.1088
-G2 X-0.3842 Y-0.3574 I-0.1486 J0.2319
-G2 X-0.4865 Y-0.3335 I-0.0033 J0.2159
-G2 X-0.5603 Y-0.2729 I0.1079 J0.2068
-G1 Y-0.5991
-G1 X-0.6738
-G1 Y-0.1513
-G0 Z0.125
-G0 X-0.5586 Y-0.1219
-G1 F10.0 Z-0.001
-G3 F60.0 X-0.5186 Y-0.2022 I0.2066 J0.0526
-G3 X-0.4624 Y-0.2478 I0.1393 J0.1145
-G3 X-0.3918 Y-0.2641 I0.0691 J0.1387
-G3 X-0.3198 Y-0.2472 I0.0014 J0.1565
-G3 X-0.2625 Y-0.2003 I-0.0865 J0.1642
-G3 X-0.2186 Y-0.1056 I-0.1741 J0.1382
-G3 X-0.2082 Y-0.0016 I-0.463 J0.0985
-G3 X-0.2185 Y0.0988 I-0.445 J0.0051
-G3 X-0.2612 Y0.1902 I-0.2152 J-0.0448
-G3 X-0.3165 Y0.2368 I-0.1435 J-0.1141
-G3 X-0.3868 Y0.2539 I-0.0691 J-0.1308
-G3 X-0.459 Y0.2348 I-0.0004 J-0.1446
-G3 X-0.5155 Y0.1858 I0.1042 J-0.1769
-G3 X-0.5599 Y0.0921 I0.1824 J-0.1439
-G3 X-0.571 Y-0.0111 I0.4286 J-0.0981
-G3 X-0.561 Y-0.1111 I0.4541 J-0.0052
-G3 X-0.5586 Y-0.1219 I0.209 J0.0418
-G0 Z0.125
-G0 X0.0092 Y-0.0653
-G1 F10.0 Z-0.001
-G2 F60.0 X0.0069 Y-0.013 I0.4635 J0.0463
-G2 X0.0253 Y0.1266 I0.49 J0.0063
-G2 X0.094 Y0.2495 I0.2937 J-0.0834
-G2 X0.1968 Y0.3207 I0.209 J-0.1921
-G2 X0.3199 Y0.3429 I0.1188 J-0.3064
-G2 X0.4396 Y0.321 I0.004 J-0.3162
-G2 X0.5394 Y0.2514 I-0.1055 J-0.2578
-G2 X0.6066 Y0.1308 I-0.2207 J-0.202
-G2 X0.6246 Y-0.006 I-0.4641 J-0.1307
-G2 X0.624 Y-0.0363 I-1.1335 J0.0085
-G1 X0.1243
-G3 X0.1404 Y-0.1264 I0.3467 J0.0157
-G3 X0.1867 Y-0.2054 I0.1984 J0.0632
-G3 X0.3268 Y-0.2641 I0.1356 J0.1272
-G3 X0.4334 Y-0.2312 I0.0048 J0.1741
-G3 X0.4761 Y-0.184 I-0.1056 J0.1381
-G3 X0.5034 Y-0.1265 I-0.2498 J0.1544
-G1 X0.6208 Y-0.141
-G2 X0.583 Y-0.2296 I-0.3145 J0.082
-G2 X0.518 Y-0.3007 I-0.2247 J0.1403
-G2 X0.4267 Y-0.3449 I-0.1599 J0.2137
-G2 X0.3262 Y-0.3574 I-0.0969 J0.3673
-G2 X0.1999 Y-0.337 I-0.005 J0.3687
-G2 X0.0927 Y-0.2672 I0.094 J0.2616
-G2 X0.0252 Y-0.1484 I0.2166 J0.2017
-G2 X0.0092 Y-0.0653 I0.4475 J0.1294
-G0 Z0.125
-G0 X0.1306 Y0.0571
-G1 F10.0 Z-0.001
-G1 F60.0 X0.5047
-G3 X0.4926 Y0.1236 I-0.3356 J-0.0268
-G3 X0.4618 Y0.1839 I-0.1636 J-0.0456
-G3 X0.3211 Y0.2495 I-0.1362 J-0.1084
-G3 X0.1893 Y0.1971 I-0.0043 J-0.1815
-G3 X0.1467 Y0.1326 I0.1313 J-0.1328
-G3 X0.1306 Y0.0571 I0.2303 J-0.0887
-G0 Z0.125
-G0 X0.7412 Y0.0837
-G1 F10.0 Z-0.001
-G2 F60.0 X0.7407 Y0.1082 I0.5215 J0.0227
-G2 X0.7673 Y0.3004 I0.6459 J0.0084
-G2 X0.8643 Y0.4684 I0.405 J-0.1218
-G2 X1.0099 Y0.568 I0.2954 J-0.2758
-G2 X1.1836 Y0.599 I0.1677 J-0.4369
-G2 X1.4145 Y0.5378 I0.0061 J-0.4431
-G2 X1.5709 Y0.3669 I-0.2021 J-0.3421
-G2 X1.6126 Y0.246 I-0.4508 J-0.2228
-G2 X1.6252 Y0.1189 I-0.6041 J-0.1243
-G2 X1.6119 Y-0.0104 I-0.6073 J-0.0028
-G2 X1.5684 Y-0.1328 I-0.4911 J0.1054
-G2 X1.4075 Y-0.3013 I-0.3494 J0.1726
-G2 X1.1829 Y-0.3581 I-0.2218 J0.4049
-G2 X1.0618 Y-0.343 I-0.0025 J0.4735
-G2 X0.9495 Y-0.295 I0.1059 J0.4032
-G2 X0.7937 Y-0.1227 I0.2106 J0.3471
-G2 X0.7412 Y0.0837 I0.469 J0.2292
-G0 Z0.125
-G0 X0.867 Y0.0872
-G1 F10.0 Z-0.001
-G3 F60.0 X0.8863 Y-0.0342 I0.4738 J0.0131
-G3 X0.9564 Y-0.1574 I0.3033 J0.091
-G3 X1.1823 Y-0.2533 I0.2187 J0.2012
-G3 X1.3066 Y-0.2297 I0.004 J0.318
-G3 X1.4094 Y-0.1562 I-0.1146 J0.269
-G3 X1.4803 Y-0.0268 I-0.2365 J0.2136
-G3 X1.499 Y0.1195 I-0.5092 J0.1396
-G3 X1.4904 Y0.22 I-0.5565 J0.0028
-G3 X1.4605 Y0.3164 I-0.4006 J-0.0713
-G3 X1.3489 Y0.447 I-0.2653 J-0.1138
-G3 X1.1842 Y0.4937 I-0.1607 J-0.2531
-G3 X0.9602 Y0.4041 I-0.0045 J-0.3134
-G3 X0.9124 Y0.3396 I0.1696 J-0.1757
-G3 X0.8761 Y0.2256 I0.3481 J-0.1739
-G3 X0.8669 Y0.1063 I0.7033 J-0.1142
-G3 X0.867 Y0.0872 I0.474 J-0.0059
-G0 Z0.125
-G0 X1.7691
-G1 F10.0 Z-0.001
-G1 F60.0 Y0.5826
-G1 X1.8826
-G1 Y0.0552
-G1 X2.1514 Y0.3277
-G1 X2.2984
-G1 X2.0422 Y0.0792
-G1 X2.3243 Y-0.3423
-G1 X2.1842
-G1 X1.9627 Y0.0003
-G1 X1.8826 Y-0.0767
-G1 Y-0.3423
-G1 X1.7691
-G1 Y0.0872
-G0 Z0.125
-G0 X2.3737 Y0.0387
-G1 F10.0 Z-0.001
-G2 F60.0 X2.3936 Y0.142 I0.4767 J-0.0383
-G2 X2.4757 Y0.2684 I0.2668 J-0.0833
-G2 X2.5741 Y0.3252 I0.1952 J-0.225
-G2 X2.6864 Y0.3429 I0.109 J-0.3265
-G2 X2.8089 Y0.3214 I0.0042 J-0.3359
-G2 X2.9123 Y0.252 I-0.1045 J-0.2674
-G2 X2.9809 Y0.1358 I-0.2103 J-0.2027
-G2 X3.0 Y0.0022 I-0.4192 J-0.1278
-G2 X2.9922 Y-0.102 I-0.6432 J-0.0046
-G2 X2.9608 Y-0.2016 I-0.3284 J0.0487
-G2 X2.8479 Y-0.3164 I-0.2422 J0.1253
-G2 X2.6864 Y-0.3574 I-0.1586 J0.2861
-G2 X2.563 Y-0.3364 I-0.0045 J0.3461
-G2 X2.4586 Y-0.2672 I0.1004 J0.2648
-G2 X2.3902 Y-0.1456 I0.2134 J0.2001
-G2 X2.3722 Y-0.0073 I0.4726 J0.1318
-G2 X2.3737 Y0.0387 I0.4782 J0.0077
-G0 Z0.125
-G0 X2.4901 Y0.0298
-G1 F10.0 Z-0.001
-G3 F60.0 X2.4889 Y-0.0073 I0.4225 J-0.032
-G3 X2.5 Y-0.1088 I0.4249 J-0.0051
-G3 X2.5451 Y-0.2003 I0.2117 J0.0474
-G3 X2.6864 Y-0.2641 I0.1376 J0.1166
-G3 X2.8271 Y-0.1997 I0.0032 J0.1789
-G3 X2.8724 Y-0.1065 I-0.1677 J0.1391
-G3 X2.8832 Y-0.0035 I-0.432 J0.0977
-G3 X2.8719 Y0.0957 I-0.3951 J0.0049
-G3 X2.8265 Y0.1845 I-0.2065 J-0.0494
-G3 X2.6864 Y0.2489 I-0.1372 J-0.1139
-G3 X2.5451 Y0.1852 I-0.0037 J-0.1803
-G3 X2.4999 Y0.0939 I0.164 J-0.1379
-G3 X2.4901 Y0.0298 I0.4127 J-0.0961
-G0 Z0.125
-M5
-M30
\ No newline at end of file
diff --git a/sim/Makefile b/sim/Makefile
deleted file mode 100644
index 176587b..0000000
--- a/sim/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-# Part of Grbl Simulator
-#
-# Copyright (c) 2012 Jens Geisler
-#
-# Grbl is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Grbl is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Grbl. If not, see .
-
-PLATFORM = WINDOWS
-
-OBJECTS = main.o simulator.o serial.o ../main.o ../protocol.o ../planner.o ../settings.o ../print.o ../nuts_bolts.o eeprom.o ../serial.o avr/pgmspace.o avr/interrupt.o avr/io.o util/delay.o util/floatunsisf.o ../stepper.o ../gcode.o ../spindle_control.o ../motion_control.o ../limits.o ../report.o ../coolant_control.o ../probe.o ../system.o platform_$(PLATFORM).o
-CLOCK = 16000000
-EXE_NAME = grbl_sim.exe
-COMPILE = $(CC) -Wall -g -DF_CPU=$(CLOCK) -include config.h -I. -DPLAT_$(PLATFORM)
-LINUX_LIBRARIES = -lrt -pthread
-WINDOWS_LIBRARIES =
-# symbolic targets:
-all: main
-
-new: clean main
-
-clean:
- rm -f $(EXE_NAME) $(OBJECTS)
-
-# file targets:
-main: $(OBJECTS)
- $(COMPILE) -o $(EXE_NAME) $(OBJECTS) -lm $($(PLATFORM)_LIBRARIES)
-
-%.o: %.c
- $(COMPILE) -c $< -o $@
-
-../planner.o: ../planner.c
- $(COMPILE) -include planner_inject_accessors.c -c $< -o $@
-
-../serial.o: ../serial.c
- $(COMPILE) -include serial_hooks.h -c $< -o $@
-
-../main.o: ../main.c
- $(COMPILE) -include rename_main.h -c $< -o $@
-
-
diff --git a/sim/README.md b/sim/README.md
deleted file mode 100644
index 19fd378..0000000
--- a/sim/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-GRBL SIM : by Jens Geisler
-
-This directory contains an experimental Grbl simulator that compiles the main Grbl source code into a wrapped executable for use on a computer. No Arduino required. When the executable is run, the user should be able to interact with the Grbl simulator as if connected to an Arduino with Grbl.
-
-WARNING: Grbl Sim is under heavy development. So many things may not work, or respond in ways unexpected. At the moment, this code is a proof-of-concept.
-
-What can you do with Grbl Sim?
-- Simply checking out how Grbl works without needing an Arduino.
-- Visualize a g-code program by having the simulator parse and execute to a GUI. Fluctuations in feed rates by the acceleration planner can be viewed as well.
-- A powerful debugging tool for development.
-- Each of the AVR functions are replaced with dummy functions, like the stepper ISR. These could be written to whatever you need. For example, output simulated step pulses over time and examine its performance.
-
-Realtime modifications by Adam Shelly:
-
- Simulates Atmel hardware in separate thread. Runs in aproximate realtime.
-
- On Linux, use `socat PTY,raw,link=/dev/ttyFAKE,echo=0 "EXEC:'./grbl_sim.exe -n -s step.out -b block.out',pty,raw,echo=0"` to create a fake serial port connected to the simulator. This is useful for testing grbl interface software.
-
diff --git a/sim/avr/interrupt.c b/sim/avr/interrupt.c
deleted file mode 100644
index f03c29b..0000000
--- a/sim/avr/interrupt.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- interrupt.c - replacement for the avr library of the same name to provide
- dummy register variables
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-#include "interrupt.h"
-#include "io.h"
-#include "wdt.h"
-
-//pseudo-Interrupt vector table
-isr_fp compa_vect[6]={0};
-isr_fp compb_vect[6]={0};
-isr_fp ovf_vect[6]={0};
-isr_fp wdt_vect = 0;
-isr_fp pc_vect = 0;
-
-void sei() {io.sreg|=SEI;}
-void cli() {io.sreg&=~SEI;}
-
-
-
-int16_t sim_scaling[8]={0,1,8,64,256,1024,1,1}; //clock scalars
-//Timer/Counter modes: these are incomplete, but enough for this application
-enum sim_wgm_mode {
- wgm_NORMAL,
- wgm_CTC,
- wgm_FAST_PWM,
- wgm_PHASE_PWM,
- wgm_PH_F_PWM,
- wgm_RESERVED
-};
-
-//3-bit wgm table for 8-bit timers
-enum sim_wgm_mode sim_wgm_3[] = {wgm_NORMAL,wgm_PHASE_PWM,wgm_CTC,wgm_FAST_PWM,
- wgm_RESERVED,wgm_PHASE_PWM, wgm_RESERVED, wgm_FAST_PWM};
-
-//4-bit wgm modes for 16-bit timers
-enum sim_wgm_mode sim_wgm_4[16] = {wgm_NORMAL,wgm_PHASE_PWM,wgm_PHASE_PWM,wgm_PHASE_PWM,
- wgm_CTC, wgm_FAST_PWM, wgm_FAST_PWM, wgm_FAST_PWM,
- wgm_PH_F_PWM, wgm_PH_F_PWM, wgm_PHASE_PWM, wgm_PHASE_PWM,
- wgm_CTC, wgm_RESERVED, wgm_FAST_PWM, wgm_FAST_PWM};
-
-static const uint16_t timer_bitdepth[SIM_N_TIMERS] = {
- 0xFF,0xFFFF,0xFF,
- //0xFFFF,0xFFFF,0xFFFF 3 more for mega
-};
-
-void timer_interrupts() {
- int i;
- uint8_t ien = io.sreg&SEI; //interrupts enabled?
- io.prescaler++;
-
- //all clocks
- for (i=0;i>1) | (io.tccra[i]&3);
- mode = sim_wgm_3[wgm];
- }
- else {
- uint8_t wgm = ((io.tccrb[i]&0x18)>>1) | (io.tccra[i]&3); //4 wgm bits
- mode = sim_wgm_4[wgm];
- }
-
- //tick
- if (io.tifr[i]&(1<.
-*/
-
-
-#ifndef interrupt_h
-#define interrupt_h
-
-// macros to turn avr interrupts into regular functions
-//#define TIMER1_COMPA_vect
-#define ISR(a) void interrupt_ ## a ()
-
-// Stubs of the hardware interrupt functions we are using
-void interrupt_TIMER0_COMPA_vect();
-void interrupt_TIMER1_COMPA_vect();
-void interrupt_TIMER0_OVF_vect();
-void interrupt_SERIAL_UDRE();
-void interrupt_SERIAL_RX();
-void interrupt_LIMIT_INT_vect();
-void interrupt_WDT_vect();
-
-
-//pseudo-Interrupt vector table
-typedef void(*isr_fp)(void);
-extern isr_fp compa_vect[6];
-extern isr_fp compb_vect[6];
-extern isr_fp ovf_vect[6];
-extern isr_fp wdt_vect;
-extern isr_fp pc_vect; //pin change
-
-// enable interrupts now does something in the simulation environment
-#define SEI 0x80
-void sei();
-void cli();
-
-//simulate timer operation
-void timer_interrupts();
-
-
-#endif
diff --git a/sim/avr/io.c b/sim/avr/io.c
deleted file mode 100644
index 8290fec..0000000
--- a/sim/avr/io.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "io.h"
-
-// dummy register variables
-volatile io_sim_t io={{0}};
diff --git a/sim/avr/io.h b/sim/avr/io.h
deleted file mode 100644
index 29332e4..0000000
--- a/sim/avr/io.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- interrupt.h - replacement for the avr include of the same name to provide
- dummy register variables and macros
-
- Part of Grbl Simulator
-
- Copyright (c) 2012-2104 Jens Geisler, Adam Shelly
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-
-#ifndef io_h
-#define io_h
-
-#include
-
-union hilo16 {
- uint16_t w;
- struct {
- uint8_t l; //TODO: check that these are right order on x86. Doesn't matter for current usage, but might someday
- uint8_t h;
- };
-};
-
-enum {
- SIM_A, SIM_B, SIM_C, SIM_D, SIM_E,
- SIM_F, SIM_G, SIM_H, SIM_J, SIM_K, SIM_L,
- SIM_PORT_COUNT
-};
-
-#define SIM_N_TIMERS 3 //328p has 3, Mega has 6
-
-
-// dummy register variables
-typedef struct io_sim {
- uint8_t ddr[SIM_PORT_COUNT];
- uint8_t port[SIM_PORT_COUNT];
- uint8_t pin[SIM_PORT_COUNT];
- uint8_t timsk[SIM_N_TIMERS];
- uint16_t ocra[SIM_N_TIMERS];
- uint16_t ocrb[SIM_N_TIMERS];
- uint16_t ocrc[SIM_N_TIMERS];
- uint16_t tcnt[SIM_N_TIMERS]; //tcint0 is really only 8bit
- uint8_t tccra[SIM_N_TIMERS];
- uint8_t tccrb[SIM_N_TIMERS];
- uint8_t tifr[SIM_N_TIMERS];
- uint8_t pcicr;
- uint8_t pcmsk[3];
- uint8_t ucsr0[3];
- uint8_t udr[3];
- uint8_t gpior[3];
- uint8_t mcusr;
- uint8_t wdtcsr;
- union hilo16 ubrr0;
-
- uint16_t prescaler; //continuously running
- uint8_t sreg;
-
-} io_sim_t;
-volatile extern io_sim_t io;
-
-
-
-
-// dummy macros for interrupt related registers
-#define PORTA io.port[SIM_A]
-#define PORTB io.port[SIM_B]
-#define PORTC io.port[SIM_C]
-#define PORTD io.port[SIM_D]
-#define PORTE io.port[SIM_E]
-#define PORTF io.port[SIM_F]
-#define PORTG io.port[SIM_G]
-#define PORTH io.port[SIM_H]
-#define PORTJ io.port[SIM_J]
-#define PORTK io.port[SIM_K]
-#define PORTL io.port[SIM_L]
-
-#define DDRA io.ddr[SIM_A]
-#define DDRB io.ddr[SIM_B]
-#define DDRC io.ddr[SIM_C]
-#define DDRD io.ddr[SIM_D]
-#define DDRE io.ddr[SIM_E]
-#define DDRF io.ddr[SIM_F]
-#define DDRG io.ddr[SIM_G]
-#define DDRH io.ddr[SIM_H]
-#define DDRJ io.ddr[SIM_J]
-#define DDRK io.ddr[SIM_K]
-#define DDRL io.ddr[SIM_L]
-
-#define PINA io.pin[SIM_A]
-#define PINB io.pin[SIM_B]
-#define PINC io.pin[SIM_C]
-#define PIND io.pin[SIM_D]
-#define PINE io.pin[SIM_E]
-#define PINF io.pin[SIM_F]
-#define PING io.pin[SIM_G]
-#define PINH io.pin[SIM_H]
-#define PINJ io.pin[SIM_J]
-#define PINK io.pin[SIM_K]
-#define PINL io.pin[SIM_L]
-
-
-#define TIMSK0 io.timsk[0]
-#define TIMSK1 io.timsk[1]
-#define TIMSK2 io.timsk[2]
-#define TIMSK3 io.timsk[3]
-#define TIMSK4 io.timsk[4]
-#define TIMSK5 io.timsk[5]
-
-
-#define SIM_TOV 0
-#define SIM_OCA 1
-#define SIM_OCB 2
-#define SIM_OCC 3
-#define SIM_ICI 5
-#define SIM_ROLL 7 //stealing reserved TIFR bit
-
-#define OCIE0A SIM_OCA
-#define OCIE0B SIM_OCB
-#define TOIE0 SIM_TOV
-
-#define ICIE1 SIM_ICI
-#define OCIE1C SIM_OCC
-#define OCIE1B SIM_OCB
-#define OCIE1A SIM_OCA
-#define TOIE1 SIM_ICI
-
-#define ICIE2 SIM_ICI
-#define OCIE2C SIM_OCC
-#define OCIE2B SIM_OCB
-#define OCIE2A SIM_OCA
-#define TOIE2 SIM_TOV
-
-#define OCR0A io.ocra[0]
-#define OCR1A io.ocra[1]
-#define OCR2A io.ocra[2]
- //There are more..
-
-
-#define TCNT0 io.tcnt[0]
-#define TCNT1 io.tcnt[1]
-#define TCNT2 io.tcnt[2]
-
-#define TCCR0A io.tccra[0]
-#define TCCR0B io.tccrb[0]
-#define TCCR1A io.tccra[1]
-#define TCCR1B io.tccrb[1]
-#define TCCR2A io.tccra[2]
-#define TCCR2B io.tccrb[2]
-
-#define CS00 0
-#define CS01 1
-#define CS12 2
-#define CS11 1
-#define CS10 0
-#define CS21 1
-
-#define WGM13 4
-#define WGM12 3
-#define WGM11 1
-#define WGM10 0
-#define WGM21 1
-
-#define COM1A1 7
-#define COM1A0 6
-#define COM1B1 5
-#define COM1B0 4
-#define COM1C1 3
-#define COM1C0 2
-
-
-#define PCICR io.pcicr
-#define PCIE0 0
-#define PCIE1 1
-#define PCIE2 2
-
-//serial channel
-#define UCSR0A io.ucsr0[SIM_A]
-#define UCSR0B io.ucsr0[SIM_B]
-#define UDR0 io.udr[0]
-#define UDRIE0 0
-#define RXCIE0 1
-#define RXEN0 2
-#define TXEN0 3
-#define U2X0 4
-#define UBRR0H io.ubrr0.h
-#define UBRR0L io.ubrr0.l
-
-#define PCMSK0 io.pcmsk[0]
-#define PCMSK1 io.pcmsk[1]
-#define PCMSK2 io.pcmsk[2]
-
-//GPIO
-#define GPIOR0 io.gpior[0]
-#define GPIOR1 io.gpior[1]
-#define GPIOR2 io.gpior[2]
-
-//MCU Status
-#define MCUSR io.mcusr
-
-#define PORF 0
-#define EXTRF 1
-#define BORF 2
-#define WDRF 3
-#define JTRF 4
-
-//Interrupt Status
-#define SREG io.sreg
-
-
-
-#endif
diff --git a/sim/avr/pgmspace.c b/sim/avr/pgmspace.c
deleted file mode 100644
index 17a49c8..0000000
--- a/sim/avr/pgmspace.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- pgmspace.c - replacement for the avr library of the same name to provide
- dummy functions
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-// this is not really ever called in the simulation
-char pgm_read_byte_near(const char* s) {
- return s[0];
-}
diff --git a/sim/avr/pgmspace.h b/sim/avr/pgmspace.h
deleted file mode 100644
index 450b9f2..0000000
--- a/sim/avr/pgmspace.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- pgmspace.h - replacement for the avr include of the same name to provide
- dummy functions andd macros
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-#ifndef pgmspace_h
-#define pgmspace_h
-
-#define PSTR(s) s
-
-char pgm_read_byte_near(const char* s);
-
-#endif
diff --git a/sim/avr/sleep.h b/sim/avr/sleep.h
deleted file mode 100644
index a9682b4..0000000
--- a/sim/avr/sleep.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- sleep.h - dummy replacement for the avr include of the same name
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
diff --git a/sim/avr/wdt.h b/sim/avr/wdt.h
deleted file mode 100644
index 0df7bcb..0000000
--- a/sim/avr/wdt.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#define WDTCSR wdt
-#define WDP0 0
-#define WDP1 1
-#define WDP2 2
-#define WDE 3
-#define WDCE 4
-#define WDP3 5
-#define WDIE 6
-#define WDIF 7
-
-uint16_t wdt;
diff --git a/sim/config.h b/sim/config.h
deleted file mode 100644
index 5baa20c..0000000
--- a/sim/config.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- config.h - replacement for the include of the same name in grbl
- to define dummy registers
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-#ifndef config_h
-#include "../config.h"
-#include
-
-#define AUTO_REPORT_MOVE_DONE
-#endif
diff --git a/sim/eeprom.c b/sim/eeprom.c
deleted file mode 100644
index 0291e85..0000000
--- a/sim/eeprom.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- eeprom.c - replacement for the avr library of the same name to provide
- dummy functions
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-// These are never called in the simulator
-#include
-#define MAX_EEPROM_SIZE 4096 //4KB EEPROM in Mega
-
-
-FILE* eeprom_create_empty_file(){
- FILE* fp = fopen("EEPROM.DAT","w+b");
- int i;
- if (fp){
- for(i=0;i 0; size--) {
- checksum = (checksum << 1) || (checksum >> 7);
- checksum += *source;
- eeprom_put_char(destination++, *(source++));
- }
- eeprom_put_char(destination, checksum);
-}
-
-int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size) {
- unsigned char data, checksum = 0;
- for(; size > 0; size--) {
- data = eeprom_get_char(source++);
- checksum = (checksum << 1) || (checksum >> 7);
- checksum += data;
- *(destination++) = data;
- }
- return(checksum == eeprom_get_char(source));
-}
-
-// end of file
diff --git a/sim/eeprom.h b/sim/eeprom.h
deleted file mode 100644
index 6b9a562..0000000
--- a/sim/eeprom.h
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#include "../eeprom.h"
-void eeprom_close();
diff --git a/sim/gnuplot.plt b/sim/gnuplot.plt
deleted file mode 100644
index c0b712c..0000000
--- a/sim/gnuplot.plt
+++ /dev/null
@@ -1,6 +0,0 @@
-t_= NaN
-x_= NaN
-y_= NaN
-z_= NaN
-
-splot 'HelloWorldSteps.dat' u 2:3:4:(dx= $2-x_,x_=$2,dy=$3-y_,y_=$3,dz=$4-z_,z_=$4,dt=$1-t_,t_=$1,sqrt(dx*dx+dy*dy+dz*dz)/(dt<0.01?0.01:dt)) title "Simulated steps with speed dependent coloring" with lines palette
\ No newline at end of file
diff --git a/sim/main.c b/sim/main.c
deleted file mode 100644
index e2a4e2e..0000000
--- a/sim/main.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- main.c - main grbl simulator program
-
- Part of Grbl Simulator
-
- Copyright (c) 2012 Jens Geisler
-
- Grbl is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Grbl is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Grbl. If not, see .
-*/
-
-#include
-#include
-#include
-#include "../planner.h"
-#include "../stepper.h"
-#include "../gcode.h"
-#include "../protocol.h"
-#include "../nuts_bolts.h"
-#include "../settings.h"
-#include "../spindle_control.h"
-#include "../limits.h"
-#include "../coolant_control.h"
-#include "simulator.h"
-
-
-arg_vars_t args;
-const char* progname;
-
-int usage(const char* badarg){
- if (badarg){
- printf("Unrecognized option %s\n",badarg);
- }
- printf("Usage: \n"
- "%s [options] [time_step] [block_file]\n"
- " Options:\n"
- " -r : minimum time step for printing stepper values. Default=0=no print.\n"
- " -t