2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie 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.
4 Smoothie 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.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
11 #define THEKERNEL Kernel::instance
25 class StreamOutputPool
;
37 static Kernel
* instance
; // the Singleton instance of Kernel usable anywhere
38 const char* config_override_filename(){ return "/sd/config-override"; }
40 void add_module(Module
* module
);
41 void register_for_event(_EVENT_ENUM id_event
, Module
*module
);
42 void call_event(_EVENT_ENUM id_event
, void * argument
= nullptr);
44 bool kernel_has_event(_EVENT_ENUM id_event
, Module
*mod
);
45 void unregister_for_event(_EVENT_ENUM id_event
, Module
*module
);
47 // These modules are available to all other modules
48 SerialConsole
* serial
;
49 StreamOutputPool
* streams
;
59 SlowTicker
* slow_ticker
;
60 StepTicker
* step_ticker
;
63 std::string current_path
;
64 uint32_t base_stepping_frequency
;
65 uint32_t acceleration_ticks_per_second
;
68 // When a module asks to be called for a specific event ( a hook ), this is where that request is remembered
69 std::array
<std::vector
<Module
*>, NUMBER_OF_DEFINED_EVENTS
> hooks
;