Add configuration option kill_button_poll_frequency, see #1212.
[clinton/Smoothieware.git] / src / modules / utils / killbutton / KillButton.h
1 #pragma once
2
3 #include "libs/Pin.h"
4
5 class KillButton : public Module {
6 public:
7 KillButton();
8
9 void on_module_loaded();
10 void on_idle(void *argument);
11 uint32_t button_tick(uint32_t dummy);
12
13 private:
14 Pin kill_button;
15 enum STATE {
16 IDLE,
17 KILL_BUTTON_DOWN,
18 KILLED_BUTTON_DOWN,
19 KILLED_BUTTON_UP,
20 UNKILL_BUTTON_DOWN,
21 UNKILL_TIMING_BUTTON_DOWN,
22 UNKILL_FIRE,
23 UNKILLED_BUTTON_DOWN
24 };
25
26 struct {
27 uint8_t unkill_timer:6;
28 volatile STATE state:4;
29 bool unkill_enable:1;
30 bool toggle_enable:1;
31 };
32
33 uint32_t poll_frequency;
34 };