X-Git-Url: https://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/e799360878781d1aaa1a5e4be42def59cd24834a..de2ee57c0ce72d22638efe7edfb88c5377f562d1:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 4e4dc687..351f965e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ #include "modules/tools/endstops/Endstops.h" #include "modules/tools/zprobe/ZProbe.h" #include "modules/tools/scaracal/SCARAcal.h" +#include "RotaryDeltaCalibration.h" #include "modules/tools/switch/SwitchPool.h" #include "modules/tools/temperatureswitch/TemperatureSwitch.h" #include "modules/tools/drillingcycles/Drillingcycles.h" @@ -33,6 +34,7 @@ #include "checksumm.h" #include "ConfigValue.h" #include "StepTicker.h" +#include "SlowTicker.h" // #include "libs/ChaNFSSD/SDFileSystem.h" #include "libs/nuts_bolts.h" @@ -54,6 +56,7 @@ #include "version.h" #include "system_LPC17xx.h" +#include "platform_memory.h" #include "mbed.h" @@ -86,11 +89,6 @@ GPIO leds[5] = { GPIO(P4_28) }; -// debug pins, only used if defined in src/makefile -#ifdef STEPTICKER_DEBUG_PIN -GPIO stepticker_debug_pin(STEPTICKER_DEBUG_PIN); -#endif - void init() { // Default pins to low status @@ -99,16 +97,14 @@ void init() { leds[i]= 0; } -#ifdef STEPTICKER_DEBUG_PIN - stepticker_debug_pin.output(); - stepticker_debug_pin= 0; -#endif - Kernel* kernel = new Kernel(); kernel->streams->printf("Smoothie Running @%ldMHz\r\n", SystemCoreClock / 1000000); Version version; kernel->streams->printf(" Build version %s, Build date %s\r\n", version.get_build(), version.get_build_date()); +#ifdef CNC + kernel->streams->printf(" CNC Build\r\n"); +#endif bool sdok= (sd.disk_initialize() == 0); if(!sdok) kernel->streams->printf("SDCard failed to initialize\r\n"); @@ -133,16 +129,17 @@ void init() { // Create and add main modules - kernel->add_module( new SimpleShell() ); - kernel->add_module( new Configurator() ); - kernel->add_module( new CurrentControl() ); - kernel->add_module( new KillButton() ); - kernel->add_module( new PlayLed() ); - kernel->add_module( new Endstops() ); - kernel->add_module( new Player() ); + kernel->add_module( new(AHB0) Player() ); + kernel->add_module( new(AHB0) CurrentControl() ); + kernel->add_module( new(AHB0) KillButton() ); + kernel->add_module( new(AHB0) PlayLed() ); // these modules can be completely disabled in the Makefile by adding to EXCLUDE_MODULES + #ifndef NO_TOOLS_ENDSTOPS + kernel->add_module( new(AHB0) Endstops() ); + #endif + #ifndef NO_TOOLS_SWITCH SwitchPool *sp= new SwitchPool(); sp->load_tools(); @@ -167,16 +164,16 @@ void init() { kernel->add_module( new Spindle() ); #endif #ifndef NO_UTILS_PANEL - kernel->add_module( new Panel() ); - #endif - #ifndef NO_TOOLS_TOUCHPROBE - kernel->add_module( new Touchprobe() ); + kernel->add_module( new(AHB0) Panel() ); #endif #ifndef NO_TOOLS_ZPROBE - kernel->add_module( new ZProbe() ); + kernel->add_module( new(AHB0) ZProbe() ); #endif #ifndef NO_TOOLS_SCARACAL - kernel->add_module( new SCARAcal() ); + kernel->add_module( new(AHB0) SCARAcal() ); + #endif + #ifndef NO_TOOLS_ROTARYDELTACALIBRATION + kernel->add_module( new RotaryDeltaCalibration() ); #endif #ifndef NONETWORK kernel->add_module( new Network() ); @@ -227,13 +224,16 @@ void init() { kernel->add_module( &u ); + // memory before cache is cleared + //SimpleShell::print_mem(kernel->streams); + // clear up the config cache to save some memory kernel->config->config_cache_clear(); if(kernel->is_using_leds()) { - // set some leds to indicate status... led0 init doe, led1 mainloop running, led2 idle loop running, led3 sdcard ok + // set some leds to indicate status... led0 init done, led1 mainloop running, led2 idle loop running, led3 sdcard ok leds[0]= 1; // indicate we are done with init - leds[3]= sdok?1:0; // 4th led inidicates sdcard is available (TODO maye should indicate config was found) + leds[3]= sdok?1:0; // 4th led indicates sdcard is available (TODO maye should indicate config was found) } if(sdok) { @@ -254,7 +254,10 @@ void init() { } } + // start the timers and interrupts + THEKERNEL->conveyor->start(); THEKERNEL->step_ticker->start(); + THEKERNEL->slow_ticker->start(); } int main()