diff options
author | Franklin Wei <franklin@rockbox.org> | 2020-06-26 20:53:15 -0400 |
---|---|---|
committer | Franklin Wei <franklin@rockbox.org> | 2020-06-27 13:27:40 -0400 |
commit | a65a341a0036737f161bfdd30adeab25faed3134 (patch) | |
tree | ba255c7d2ce392ca451c83f78a69caa50ba8e8a7 /apps/plugin.h | |
parent | f49442d7b739e13985e0d0054aa27865c0acff0c (diff) |
button: allow disabling software poweroff
On some devices, the button driver allows a "software poweroff" by long-
pressing a certain key. This behavior is inconvnient when that button needs
to be held down for other purposes, such as moving the cursor in rockpaint
or sgt-untangle.
This patch allows selectively disabling the software poweroff (enabled by
default) from both core and plugin code.
Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index c737d7adeb..430c15a2a6 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -161,12 +161,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 237 +#define PLUGIN_API_VERSION 238 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 237 +#define PLUGIN_MIN_API_VERSION 238 /* plugin return codes */ /* internal returns start at 0x100 to make exit(1..255) work */ @@ -435,6 +435,10 @@ struct plugin_api { #ifdef HAS_BUTTON_HOLD bool (*button_hold)(void); #endif +#ifdef HAVE_SW_POWEROFF + void (*button_set_sw_poweroff_state)(bool enable); + bool (*button_get_sw_poweroff_state)(void); +#endif #ifdef HAVE_TOUCHSCREEN void (*touchscreen_set_mode)(enum touchscreen_mode); enum touchscreen_mode (*touchscreen_get_mode)(void); |