summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/include_lua/rbcompat.lua
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/include_lua/rbcompat.lua')
-rw-r--r--apps/plugins/lua/include_lua/rbcompat.lua60
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/plugins/lua/include_lua/rbcompat.lua b/apps/plugins/lua/include_lua/rbcompat.lua
new file mode 100644
index 0000000000..377bc2e4e0
--- /dev/null
+++ b/apps/plugins/lua/include_lua/rbcompat.lua
@@ -0,0 +1,60 @@
1--[[ Lua RB Compatibility Operations
2/***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
10 *
11 * Copyright (C) 2018 William Wilgus
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22]]
23
24-- [[ compatibility with old functions ]]
25if rb.strncasecmp then rb.strcasecmp = function(s1, s2) return rb.strncasecmp(s1, s2) end end
26
27if rb.backlight_brightness_set then
28 rb.backlight_set_brightness = function(brightness) rb.backlight_brightness_set(brightness) end
29 rb.backlight_brightness_use_setting = function() rb.backlight_brightness_set(nil) end
30end
31
32if rb.buttonlight_brightness_set then
33 rb.buttonlight_set_brightness = function(brightness) rb.buttonlight_brightness_set(brightness) end
34 rb.buttonlight_brightness_use_setting = function() rb.buttonlight_brightness_set(nil) end
35end
36
37if rb.mixer_frequency then
38 rb.mixer_set_frequency = function(freq) rb.mixer_frequency(freq) end
39 rb.mixer_get_frequency = function() return rb.mixer_frequency(nil) end
40end
41
42if rb.backlight_onoff then
43 rb.backlight_on = function() rb.backlight_onoff(true) end
44 rb.backlight_off = function() rb.backlight_onoff(false) end
45end
46
47if rb.buttonlight_brightness_set then
48 rb.buttonlight_set_brightness = function(brightness) rb.buttonlight_brightness_set(brightness) end
49 rb.buttonlight_brightness_use_setting = function() rb.buttonlight_brightness_set(nil) end
50end
51
52if rb.touchscreen_mode then
53 rb.touchscreen_set_mode = function(mode) rb.touchscreen_mode(mode) end
54 rb.touchscreen_get_mode = function() return rb.touchscreen_mode(nil) end
55end
56
57if rb.schedule_cpu_boost then
58 rb.trigger_cpu_boost = function() rb.schedule_cpu_boost(true) end
59 rb.cancel_cpu_boost = function() rb.schedule_cpu_boost(false) end
60end