diff options
Diffstat (limited to 'apps/plugins/lua/include_lua')
-rw-r--r-- | apps/plugins/lua/include_lua/rbcompat.lua | 60 |
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 ]] | ||
25 | if rb.strncasecmp then rb.strcasecmp = function(s1, s2) return rb.strncasecmp(s1, s2) end end | ||
26 | |||
27 | if 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 | ||
30 | end | ||
31 | |||
32 | if 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 | ||
35 | end | ||
36 | |||
37 | if 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 | ||
40 | end | ||
41 | |||
42 | if rb.backlight_onoff then | ||
43 | rb.backlight_on = function() rb.backlight_onoff(true) end | ||
44 | rb.backlight_off = function() rb.backlight_onoff(false) end | ||
45 | end | ||
46 | |||
47 | if 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 | ||
50 | end | ||
51 | |||
52 | if 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 | ||
55 | end | ||
56 | |||
57 | if 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 | ||
60 | end | ||