Merge pull request #551 from wolfmanjm/use-pendsv-handler-for-ticker
[clinton/Smoothieware.git] / src / libs / Kernel.h
index 648cc24..520597d 100644 (file)
@@ -7,38 +7,45 @@
 
 #ifndef KERNEL_H
 #define KERNEL_H
-#include "libs/Module.h"
-#include "libs/Config.h"
-#include "libs/SlowTicker.h"
-#include "libs/StreamOutputPool.h"
-#include "libs/StepTicker.h"
-#include "libs/Adc.h"
-#include "libs/Pauser.h"
-#include "modules/communication/SerialConsole.h"
-#include "modules/communication/GcodeDispatch.h"
-#include "modules/robot/Planner.h"
-#include "modules/robot/Robot.h"
-#include "modules/robot/Stepper.h"
-#include "modules/tools/endstops/Endstops.h"
+
+#define THEKERNEL Kernel::instance
+
+#include "Module.h"
 #include <array>
+#include <vector>
+#include <string>
 
 //Module manager
+class Config;
 class Module;
 class Conveyor;
 class SlowTicker;
+class Pauser;
+class SerialConsole;
+class StreamOutputPool;
+class GcodeDispatch;
+class Robot;
+class Stepper;
+class Planner;
+class StepTicker;
+class Adc;
+class PublicData;
+
 class Kernel {
     public:
         Kernel();
+        static Kernel* instance; // the Singleton instance of Kernel usable anywhere
+        const char* config_override_filename(){ return "/sd/config-override"; }
+
         void add_module(Module* module);
-        void register_for_event(_EVENT_ENUM id_event, Modulemodule);
+        void register_for_event(_EVENT_ENUM id_event, Module *module);
         void call_event(_EVENT_ENUM id_event);
         void call_event(_EVENT_ENUM id_event, void * argument);
 
-        // These modules are aviable to all other modules
+        // These modules are available to all other modules
         SerialConsole*    serial;
         StreamOutputPool* streams;
 
-        GcodeDispatch*    gcode_dispatch;
         Robot*            robot;
         Stepper*          stepper;
         Planner*          planner;
@@ -46,16 +53,18 @@ class Kernel {
         Conveyor*         conveyor;
         Pauser*           pauser;
 
-        // This is needed only for debug
-        Endstops*          endstops; 
-
         int debug;
         SlowTicker*       slow_ticker;
         StepTicker*       step_ticker;
         Adc*              adc;
+        bool              use_leds;
+        std::string       current_path;
+        uint32_t          base_stepping_frequency;
+        uint32_t          acceleration_ticks_per_second;
 
     private:
-        std::array<std::vector<Module*>, NUMBER_OF_DEFINED_EVENTS> hooks; // When a module asks to be called for a specific event ( a hook ), this is where that request is remembered
+        // When a module asks to be called for a specific event ( a hook ), this is where that request is remembered
+        std::array<std::vector<Module*>, NUMBER_OF_DEFINED_EVENTS> hooks;
 
 };