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
12 #define THECONVEYOR THEKERNEL->conveyor
13 #define THEROBOT THEKERNEL->robot
26 class StreamOutputPool
;
39 static Kernel
* instance
; // the Singleton instance of Kernel usable anywhere
40 const char* config_override_filename(){ return "/sd/config-override"; }
42 void add_module(Module
* module
);
43 void register_for_event(_EVENT_ENUM id_event
, Module
*module
);
44 void call_event(_EVENT_ENUM id_event
, void * argument
= nullptr);
46 bool kernel_has_event(_EVENT_ENUM id_event
, Module
*module
);
47 void unregister_for_event(_EVENT_ENUM id_event
, Module
*module
);
49 bool is_using_leds() const { return use_leds
; }
50 bool is_halted() const { return halted
; }
51 bool is_grbl_mode() const { return grbl_mode
; }
52 bool is_ok_per_line() const { return ok_per_line
; }
54 void set_feed_hold(bool f
) { feed_hold
= f
; }
55 bool get_feed_hold() const { return feed_hold
; }
56 bool is_feed_hold_enabled() const { return enable_feed_hold
; }
58 std::string
get_query_string();
60 // These modules are available to all other modules
61 SerialConsole
* serial
;
62 StreamOutputPool
* streams
;
63 GcodeDispatch
* gcode_dispatch
;
68 Configurator
* configurator
;
69 SimpleShell
* simpleshell
;
71 SlowTicker
* slow_ticker
;
72 StepTicker
* step_ticker
;
74 std::string current_path
;
75 uint32_t base_stepping_frequency
;
78 // When a module asks to be called for a specific event ( a hook ), this is where that request is remembered
79 std::array
<std::vector
<Module
*>, NUMBER_OF_DEFINED_EVENTS
> hooks
;
86 bool enable_feed_hold
:1;