diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be index 5e91278fe..5809ed3f3 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be +++ b/lib/libesp32/berry_tasmota/src/embedded/animate_0_core.be @@ -62,6 +62,28 @@ class Animate_core self.animators.push(anim) end + # remove a specific animator + # remove all animators if no parameter or nil + # silently ignores if the animator can't be found + def remove_animator(anim) + var animators = self.animators + if (anim != nil) + animators.remove(animators.find(anim)) + else + animators.clear() + end + end + + def remove_painter(p) + var painters = self.painters + if (p != nil) + painters.remove(painters.find(p)) + else + painters.clear() + end + end + + def add_painter(painter) self.painters.push(painter) end diff --git a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be index 45f22b81b..aa9ef07e6 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be +++ b/lib/libesp32/berry_tasmota/src/embedded/animate_9_module.be @@ -444,6 +444,11 @@ class Animate_oscillator : Animate_animator self.b = b end + def set_form(form) + if (form == nil) form = 1 end + self.form = form + end + def animate(millis) if (self.duration_ms == nil) return end if millis == nil millis = tasmota.millis() end diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h index d124cc5b3..2221e785c 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_0_core.h @@ -6,450 +6,6 @@ extern const bclass be_class_Animate_core; -/******************************************************************** -** Solidified function: remove -********************************************************************/ -be_local_closure(Animate_core_remove, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(clear), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(remove_fast_loop), - /* K3 */ be_nested_str_weak(fast_loop_cb), - }), - be_str_weak(remove), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0xB8060200, // 0002 GETNGBL R1 K1 - 0x8C040302, // 0003 GETMET R1 R1 K2 - 0x880C0103, // 0004 GETMBR R3 R0 K3 - 0x7C040400, // 0005 CALL R1 2 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_background_animator -********************************************************************/ -be_local_closure(Animate_core_add_background_animator, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(set_cb), - /* K1 */ be_nested_str_weak(set_back_color), - /* K2 */ be_nested_str_weak(add_animator), - }), - be_str_weak(add_background_animator), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x8C080300, // 0000 GETMET R2 R1 K0 - 0x5C100000, // 0001 MOVE R4 R0 - 0x88140101, // 0002 GETMBR R5 R0 K1 - 0x7C080600, // 0003 CALL R2 3 - 0x8C080102, // 0004 GETMET R2 R0 K2 - 0x5C100200, // 0005 MOVE R4 R1 - 0x7C080400, // 0006 CALL R2 2 - 0x80000000, // 0007 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clear -********************************************************************/ -be_local_closure(Animate_core_clear, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(stop), - /* K1 */ be_nested_str_weak(strip), - /* K2 */ be_nested_str_weak(clear), - }), - be_str_weak(clear), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0x88040101, // 0002 GETMBR R1 R0 K1 - 0x8C040302, // 0003 GETMET R1 R1 K2 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_animator -********************************************************************/ -be_local_closure(Animate_core_add_animator, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(animators), - /* K1 */ be_nested_str_weak(push), - }), - be_str_weak(add_animator), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: animate -********************************************************************/ -be_local_closure(Animate_core_animate, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(animate), - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_bri -********************************************************************/ -be_local_closure(Animate_core_set_bri, /* name */ - be_nested_proto( - 2, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(bri), - }), - be_str_weak(set_bri), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: stop -********************************************************************/ -be_local_closure(Animate_core_stop, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(running), - /* K1 */ be_nested_str_weak(animators), - /* K2 */ be_const_int(0), - /* K3 */ be_nested_str_weak(stop), - /* K4 */ be_const_int(1), - /* K5 */ be_nested_str_weak(tasmota), - /* K6 */ be_nested_str_weak(remove_fast_loop), - /* K7 */ be_nested_str_weak(fast_loop_cb), - }), - be_str_weak(stop), - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0x50040000, // 0000 LDBOOL R1 0 0 - 0x90020001, // 0001 SETMBR R0 K0 R1 - 0x88040101, // 0002 GETMBR R1 R0 K1 - 0x58080002, // 0003 LDCONST R2 K2 - 0x600C000C, // 0004 GETGBL R3 G12 - 0x5C100200, // 0005 MOVE R4 R1 - 0x7C0C0200, // 0006 CALL R3 1 - 0x140C0403, // 0007 LT R3 R2 R3 - 0x780E0004, // 0008 JMPF R3 #000E - 0x940C0202, // 0009 GETIDX R3 R1 R2 - 0x8C0C0703, // 000A GETMET R3 R3 K3 - 0x7C0C0200, // 000B CALL R3 1 - 0x00080504, // 000C ADD R2 R2 K4 - 0x7001FFF5, // 000D JMP #0004 - 0xB80E0A00, // 000E GETNGBL R3 K5 - 0x8C0C0706, // 000F GETMET R3 R3 K6 - 0x88140107, // 0010 GETMBR R5 R0 K7 - 0x7C0C0400, // 0011 CALL R3 2 - 0x80000000, // 0012 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_back_color -********************************************************************/ -be_local_closure(Animate_core_set_back_color, /* name */ - be_nested_proto( - 2, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(back_color), - }), - be_str_weak(set_back_color), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_cb -********************************************************************/ -be_local_closure(Animate_core_set_cb, /* name */ - be_nested_proto( - 3, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(obj), - /* K1 */ be_nested_str_weak(mth), - }), - be_str_weak(set_cb), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90020202, // 0001 SETMBR R0 K1 R2 - 0x80000000, // 0002 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Animate_core_init, /* name */ - be_nested_proto( - 7, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - be_nested_proto( - 2, /* nstack */ - 0, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(fast_loop), - }), - be_str_weak(_anonymous_), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x68000000, // 0000 GETUPV R0 U0 - 0x8C000100, // 0001 GETMET R0 R0 K0 - 0x7C000200, // 0002 CALL R0 1 - 0x80000000, // 0003 RET 0 - }) - ), - }), - 1, /* has constants */ - ( &(const bvalue[13]) { /* constants */ - /* K0 */ be_nested_str_weak(animate), - /* K1 */ be_nested_str_weak(strip), - /* K2 */ be_nested_str_weak(bri), - /* K3 */ be_nested_str_weak(running), - /* K4 */ be_nested_str_weak(pixel_count), - /* K5 */ be_nested_str_weak(animators), - /* K6 */ be_nested_str_weak(painters), - /* K7 */ be_nested_str_weak(clear), - /* K8 */ be_nested_str_weak(frame), - /* K9 */ be_nested_str_weak(layer), - /* K10 */ be_nested_str_weak(fast_loop_cb), - /* K11 */ be_nested_str_weak(back_color), - /* K12 */ be_const_int(0), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[33]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0x90020201, // 0001 SETMBR R0 K1 R1 - 0x4C100000, // 0002 LDNIL R4 - 0x1C100404, // 0003 EQ R4 R2 R4 - 0x78120000, // 0004 JMPF R4 #0006 - 0x540A0031, // 0005 LDINT R2 50 - 0x90020402, // 0006 SETMBR R0 K2 R2 - 0x50100000, // 0007 LDBOOL R4 0 0 - 0x90020604, // 0008 SETMBR R0 K3 R4 - 0x8C100304, // 0009 GETMET R4 R1 K4 - 0x7C100200, // 000A CALL R4 1 - 0x90020804, // 000B SETMBR R0 K4 R4 - 0x60100012, // 000C GETGBL R4 G18 - 0x7C100000, // 000D CALL R4 0 - 0x90020A04, // 000E SETMBR R0 K5 R4 - 0x60100012, // 000F GETGBL R4 G18 - 0x7C100000, // 0010 CALL R4 0 - 0x90020C04, // 0011 SETMBR R0 K6 R4 - 0x8C100107, // 0012 GETMET R4 R0 K7 - 0x7C100200, // 0013 CALL R4 1 - 0x8C100708, // 0014 GETMET R4 R3 K8 - 0x88180104, // 0015 GETMBR R6 R0 K4 - 0x7C100400, // 0016 CALL R4 2 - 0x90021004, // 0017 SETMBR R0 K8 R4 - 0x8C100708, // 0018 GETMET R4 R3 K8 - 0x88180104, // 0019 GETMBR R6 R0 K4 - 0x7C100400, // 001A CALL R4 2 - 0x90021204, // 001B SETMBR R0 K9 R4 - 0x84100000, // 001C CLOSURE R4 P0 - 0x90021404, // 001D SETMBR R0 K10 R4 - 0x9002170C, // 001E SETMBR R0 K11 K12 - 0xA0000000, // 001F CLOSE R0 - 0x80000000, // 0020 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_painter -********************************************************************/ -be_local_closure(Animate_core_add_painter, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(painters), - /* K1 */ be_nested_str_weak(push), - }), - be_str_weak(add_painter), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_bri -********************************************************************/ -be_local_closure(Animate_core_get_bri, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(bri), - }), - be_str_weak(get_bri), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x80040400, // 0001 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: fast_loop ********************************************************************/ @@ -583,6 +139,189 @@ be_local_closure(Animate_core_fast_loop, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: add_animator +********************************************************************/ +be_local_closure(Animate_core_add_animator, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(animators), + /* K1 */ be_nested_str_weak(push), + }), + be_str_weak(add_animator), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_painter +********************************************************************/ +be_local_closure(Animate_core_remove_painter, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(painters), + /* K1 */ be_nested_str_weak(remove), + /* K2 */ be_nested_str_weak(find), + /* K3 */ be_nested_str_weak(clear), + }), + be_str_weak(remove_painter), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x200C0203, // 0002 NE R3 R1 R3 + 0x780E0005, // 0003 JMPF R3 #000A + 0x8C0C0501, // 0004 GETMET R3 R2 K1 + 0x8C140502, // 0005 GETMET R5 R2 K2 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x7C140400, // 0007 CALL R5 2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x70020001, // 0009 JMP #000C + 0x8C0C0503, // 000A GETMET R3 R2 K3 + 0x7C0C0200, // 000B CALL R3 1 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_animator +********************************************************************/ +be_local_closure(Animate_core_remove_animator, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(animators), + /* K1 */ be_nested_str_weak(remove), + /* K2 */ be_nested_str_weak(find), + /* K3 */ be_nested_str_weak(clear), + }), + be_str_weak(remove_animator), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x4C0C0000, // 0001 LDNIL R3 + 0x200C0203, // 0002 NE R3 R1 R3 + 0x780E0005, // 0003 JMPF R3 #000A + 0x8C0C0501, // 0004 GETMET R3 R2 K1 + 0x8C140502, // 0005 GETMET R5 R2 K2 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x7C140400, // 0007 CALL R5 2 + 0x7C0C0400, // 0008 CALL R3 2 + 0x70020001, // 0009 JMP #000C + 0x8C0C0503, // 000A GETMET R3 R2 K3 + 0x7C0C0200, // 000B CALL R3 1 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove +********************************************************************/ +be_local_closure(Animate_core_remove, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(clear), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(remove_fast_loop), + /* K3 */ be_nested_str_weak(fast_loop_cb), + }), + be_str_weak(remove), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0xB8060200, // 0002 GETNGBL R1 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x880C0103, // 0004 GETMBR R3 R0 K3 + 0x7C040400, // 0005 CALL R1 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_background_animator +********************************************************************/ +be_local_closure(Animate_core_add_background_animator, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(set_cb), + /* K1 */ be_nested_str_weak(set_back_color), + /* K2 */ be_nested_str_weak(add_animator), + }), + be_str_weak(add_background_animator), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C080300, // 0000 GETMET R2 R1 K0 + 0x5C100000, // 0001 MOVE R4 R0 + 0x88140101, // 0002 GETMBR R5 R0 K1 + 0x7C080600, // 0003 CALL R2 3 + 0x8C080102, // 0004 GETMET R2 R0 K2 + 0x5C100200, // 0005 MOVE R4 R1 + 0x7C080400, // 0006 CALL R2 2 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: start ********************************************************************/ @@ -636,42 +375,387 @@ be_local_closure(Animate_core_start, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: clear +********************************************************************/ +be_local_closure(Animate_core_clear, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(stop), + /* K1 */ be_nested_str_weak(strip), + /* K2 */ be_nested_str_weak(clear), + }), + be_str_weak(clear), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Animate_core_init, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(fast_loop), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80000000, // 0003 RET 0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[13]) { /* constants */ + /* K0 */ be_nested_str_weak(animate), + /* K1 */ be_nested_str_weak(strip), + /* K2 */ be_nested_str_weak(bri), + /* K3 */ be_nested_str_weak(running), + /* K4 */ be_nested_str_weak(pixel_count), + /* K5 */ be_nested_str_weak(animators), + /* K6 */ be_nested_str_weak(painters), + /* K7 */ be_nested_str_weak(clear), + /* K8 */ be_nested_str_weak(frame), + /* K9 */ be_nested_str_weak(layer), + /* K10 */ be_nested_str_weak(fast_loop_cb), + /* K11 */ be_nested_str_weak(back_color), + /* K12 */ be_const_int(0), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[33]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0x90020201, // 0001 SETMBR R0 K1 R1 + 0x4C100000, // 0002 LDNIL R4 + 0x1C100404, // 0003 EQ R4 R2 R4 + 0x78120000, // 0004 JMPF R4 #0006 + 0x540A0031, // 0005 LDINT R2 50 + 0x90020402, // 0006 SETMBR R0 K2 R2 + 0x50100000, // 0007 LDBOOL R4 0 0 + 0x90020604, // 0008 SETMBR R0 K3 R4 + 0x8C100304, // 0009 GETMET R4 R1 K4 + 0x7C100200, // 000A CALL R4 1 + 0x90020804, // 000B SETMBR R0 K4 R4 + 0x60100012, // 000C GETGBL R4 G18 + 0x7C100000, // 000D CALL R4 0 + 0x90020A04, // 000E SETMBR R0 K5 R4 + 0x60100012, // 000F GETGBL R4 G18 + 0x7C100000, // 0010 CALL R4 0 + 0x90020C04, // 0011 SETMBR R0 K6 R4 + 0x8C100107, // 0012 GETMET R4 R0 K7 + 0x7C100200, // 0013 CALL R4 1 + 0x8C100708, // 0014 GETMET R4 R3 K8 + 0x88180104, // 0015 GETMBR R6 R0 K4 + 0x7C100400, // 0016 CALL R4 2 + 0x90021004, // 0017 SETMBR R0 K8 R4 + 0x8C100708, // 0018 GETMET R4 R3 K8 + 0x88180104, // 0019 GETMBR R6 R0 K4 + 0x7C100400, // 001A CALL R4 2 + 0x90021204, // 001B SETMBR R0 K9 R4 + 0x84100000, // 001C CLOSURE R4 P0 + 0x90021404, // 001D SETMBR R0 K10 R4 + 0x9002170C, // 001E SETMBR R0 K11 K12 + 0xA0000000, // 001F CLOSE R0 + 0x80000000, // 0020 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(Animate_core_stop, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 8]) { /* constants */ + /* K0 */ be_nested_str_weak(running), + /* K1 */ be_nested_str_weak(animators), + /* K2 */ be_const_int(0), + /* K3 */ be_nested_str_weak(stop), + /* K4 */ be_const_int(1), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(remove_fast_loop), + /* K7 */ be_nested_str_weak(fast_loop_cb), + }), + be_str_weak(stop), + &be_const_str_solidified, + ( &(const binstruction[19]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x58080002, // 0003 LDCONST R2 K2 + 0x600C000C, // 0004 GETGBL R3 G12 + 0x5C100200, // 0005 MOVE R4 R1 + 0x7C0C0200, // 0006 CALL R3 1 + 0x140C0403, // 0007 LT R3 R2 R3 + 0x780E0004, // 0008 JMPF R3 #000E + 0x940C0202, // 0009 GETIDX R3 R1 R2 + 0x8C0C0703, // 000A GETMET R3 R3 K3 + 0x7C0C0200, // 000B CALL R3 1 + 0x00080504, // 000C ADD R2 R2 K4 + 0x7001FFF5, // 000D JMP #0004 + 0xB80E0A00, // 000E GETNGBL R3 K5 + 0x8C0C0706, // 000F GETMET R3 R3 K6 + 0x88140107, // 0010 GETMBR R5 R0 K7 + 0x7C0C0400, // 0011 CALL R3 2 + 0x80000000, // 0012 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: animate +********************************************************************/ +be_local_closure(Animate_core_animate, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(animate), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_cb +********************************************************************/ +be_local_closure(Animate_core_set_cb, /* name */ + be_nested_proto( + 3, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(obj), + /* K1 */ be_nested_str_weak(mth), + }), + be_str_weak(set_cb), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x90020202, // 0001 SETMBR R0 K1 R2 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_painter +********************************************************************/ +be_local_closure(Animate_core_add_painter, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(painters), + /* K1 */ be_nested_str_weak(push), + }), + be_str_weak(add_painter), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bri +********************************************************************/ +be_local_closure(Animate_core_get_bri, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(bri), + }), + be_str_weak(get_bri), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x80040400, // 0001 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_back_color +********************************************************************/ +be_local_closure(Animate_core_set_back_color, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(back_color), + }), + be_str_weak(set_back_color), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_bri +********************************************************************/ +be_local_closure(Animate_core_set_bri, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(bri), + }), + be_str_weak(set_bri), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Animate_core ********************************************************************/ be_local_class(Animate_core, 13, NULL, - be_nested_map(28, + be_nested_map(30, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(bri, 8), be_const_var(2) }, - { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) }, - { be_const_key_weak(start, 11), be_const_closure(Animate_core_start_closure) }, - { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) }, - { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) }, - { be_const_key_weak(FAST_LOOP_MIN, 9), be_const_int(20) }, - { be_const_key_weak(obj, -1), be_const_var(8) }, + { be_const_key_weak(running, -1), be_const_var(3) }, { be_const_key_weak(pixel_count, -1), be_const_var(1) }, - { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) }, - { be_const_key_weak(animators, -1), be_const_var(4) }, - { be_const_key_weak(fast_loop_cb, -1), be_const_var(6) }, - { be_const_key_weak(get_bri, 24), be_const_closure(Animate_core_get_bri_closure) }, - { be_const_key_weak(back_color, 13), be_const_var(12) }, + { be_const_key_weak(fast_loop, -1), be_const_closure(Animate_core_fast_loop_closure) }, + { be_const_key_weak(animators, 8), be_const_var(4) }, + { be_const_key_weak(fast_loop_cb, 7), be_const_var(6) }, + { be_const_key_weak(set_back_color, 26), be_const_closure(Animate_core_set_back_color_closure) }, + { be_const_key_weak(add_animator, -1), be_const_closure(Animate_core_add_animator_closure) }, { be_const_key_weak(frame, -1), be_const_var(10) }, - { be_const_key_weak(set_cb, 23), be_const_closure(Animate_core_set_cb_closure) }, + { be_const_key_weak(strip, 27), be_const_var(0) }, + { be_const_key_weak(remove_animator, 5), be_const_closure(Animate_core_remove_animator_closure) }, { be_const_key_weak(init, -1), be_const_closure(Animate_core_init_closure) }, - { be_const_key_weak(running, 21), be_const_var(3) }, - { be_const_key_weak(strip, 14), be_const_var(0) }, - { be_const_key_weak(fast_loop_next, -1), be_const_var(7) }, - { be_const_key_weak(set_back_color, 15), be_const_closure(Animate_core_set_back_color_closure) }, - { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) }, + { be_const_key_weak(start, -1), be_const_closure(Animate_core_start_closure) }, { be_const_key_weak(mth, -1), be_const_var(9) }, - { be_const_key_weak(layer, 12), be_const_var(11) }, + { be_const_key_weak(add_painter, -1), be_const_closure(Animate_core_add_painter_closure) }, + { be_const_key_weak(clear, -1), be_const_closure(Animate_core_clear_closure) }, + { be_const_key_weak(remove_painter, 23), be_const_closure(Animate_core_remove_painter_closure) }, + { be_const_key_weak(layer, -1), be_const_var(11) }, { be_const_key_weak(stop, -1), be_const_closure(Animate_core_stop_closure) }, + { be_const_key_weak(fast_loop_next, 16), be_const_var(7) }, + { be_const_key_weak(FAST_LOOP_MIN, -1), be_const_int(20) }, + { be_const_key_weak(animate, -1), be_const_closure(Animate_core_animate_closure) }, + { be_const_key_weak(back_color, -1), be_const_var(12) }, + { be_const_key_weak(obj, 21), be_const_var(8) }, + { be_const_key_weak(set_cb, 10), be_const_closure(Animate_core_set_cb_closure) }, + { be_const_key_weak(bri, 13), be_const_var(2) }, + { be_const_key_weak(get_bri, -1), be_const_closure(Animate_core_get_bri_closure) }, + { be_const_key_weak(painters, 28), be_const_var(5) }, + { be_const_key_weak(add_background_animator, 1), be_const_closure(Animate_core_add_background_animator_closure) }, + { be_const_key_weak(remove, -1), be_const_closure(Animate_core_remove_closure) }, { be_const_key_weak(set_bri, -1), be_const_closure(Animate_core_set_bri_closure) }, - { be_const_key_weak(painters, -1), be_const_var(5) }, - { be_const_key_weak(clear, 3), be_const_closure(Animate_core_clear_closure) }, - { be_const_key_weak(add_background_animator, 2), be_const_closure(Animate_core_add_background_animator_closure) }, })), be_str_weak(Animate_core) ); diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h index a337b5f82..a1def1f3d 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_animate_9_module.h @@ -1106,11 +1106,11 @@ void be_load_Animate_palette_class(bvm *vm) { extern const bclass be_class_Animate_oscillator; /******************************************************************** -** Solidified function: set_b +** Solidified function: set_duty_cycle ********************************************************************/ -be_local_closure(Animate_oscillator_set_b, /* name */ +be_local_closure(Animate_oscillator_set_duty_cycle, /* name */ be_nested_proto( - 2, /* nstack */ + 3, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -1118,14 +1118,22 @@ be_local_closure(Animate_oscillator_set_b, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(b), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(duty_cycle), }), - be_str_weak(set_b), + be_str_weak(set_duty_cycle), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 + ( &(const binstruction[ 9]) { /* code */ + 0x14080300, // 0000 LT R2 R1 K0 + 0x780A0000, // 0001 JMPF R2 #0003 + 0x58040000, // 0002 LDCONST R1 K0 + 0x540A0063, // 0003 LDINT R2 100 + 0x24080202, // 0004 GT R2 R1 R2 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x90020201, // 0007 SETMBR R0 K1 R1 + 0x80000000, // 0008 RET 0 }) ) ); @@ -1159,6 +1167,100 @@ be_local_closure(Animate_oscillator_set_a, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: set_b +********************************************************************/ +be_local_closure(Animate_oscillator_set_b, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(b), + }), + be_str_weak(set_b), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_form +********************************************************************/ +be_local_closure(Animate_oscillator_set_form, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_const_int(1), + /* K1 */ be_nested_str_weak(form), + }), + be_str_weak(set_form), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x1C080202, // 0001 EQ R2 R1 R2 + 0x780A0000, // 0002 JMPF R2 #0004 + 0x58040000, // 0003 LDCONST R1 K0 + 0x90020201, // 0004 SETMBR R0 K1 R1 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_phase +********************************************************************/ +be_local_closure(Animate_oscillator_set_phase, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_const_int(0), + /* K1 */ be_nested_str_weak(phase), + }), + be_str_weak(set_phase), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x14080300, // 0000 LT R2 R1 K0 + 0x780A0000, // 0001 JMPF R2 #0003 + 0x58040000, // 0002 LDCONST R1 K0 + 0x540A0063, // 0003 LDINT R2 100 + 0x24080202, // 0004 GT R2 R1 R2 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x90020201, // 0007 SETMBR R0 K1 R1 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -1400,76 +1502,6 @@ be_local_closure(Animate_oscillator_animate, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: set_duty_cycle -********************************************************************/ -be_local_closure(Animate_oscillator_set_duty_cycle, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_nested_str_weak(duty_cycle), - }), - be_str_weak(set_duty_cycle), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x14080300, // 0000 LT R2 R1 K0 - 0x780A0000, // 0001 JMPF R2 #0003 - 0x58040000, // 0002 LDCONST R1 K0 - 0x540A0063, // 0003 LDINT R2 100 - 0x24080202, // 0004 GT R2 R1 R2 - 0x780A0000, // 0005 JMPF R2 #0007 - 0x54060063, // 0006 LDINT R1 100 - 0x90020201, // 0007 SETMBR R0 K1 R1 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_phase -********************************************************************/ -be_local_closure(Animate_oscillator_set_phase, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_const_int(0), - /* K1 */ be_nested_str_weak(phase), - }), - be_str_weak(set_phase), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x14080300, // 0000 LT R2 R1 K0 - 0x780A0000, // 0001 JMPF R2 #0003 - 0x58040000, // 0002 LDCONST R1 K0 - 0x540A0063, // 0003 LDINT R2 100 - 0x24080202, // 0004 GT R2 R1 R2 - 0x780A0000, // 0005 JMPF R2 #0007 - 0x54060063, // 0006 LDINT R1 100 - 0x90020201, // 0007 SETMBR R0 K1 R1 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: Animate_oscillator ********************************************************************/ @@ -1477,20 +1509,21 @@ extern const bclass be_class_Animate_animator; be_local_class(Animate_oscillator, 6, &be_class_Animate_animator, - be_nested_map(12, + be_nested_map(13, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(phase, -1), be_const_var(0) }, - { be_const_key_weak(b, -1), be_const_var(3) }, - { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) }, - { be_const_key_weak(set_a, 10), be_const_closure(Animate_oscillator_set_a_closure) }, + { be_const_key_weak(animate, -1), be_const_closure(Animate_oscillator_animate_closure) }, { be_const_key_weak(a, -1), be_const_var(2) }, - { be_const_key_weak(set_phase, -1), be_const_closure(Animate_oscillator_set_phase_closure) }, + { be_const_key_weak(init, 11), be_const_closure(Animate_oscillator_init_closure) }, + { be_const_key_weak(duty_cycle, 10), be_const_var(1) }, + { be_const_key_weak(b, -1), be_const_var(3) }, { be_const_key_weak(value, -1), be_const_var(5) }, - { be_const_key_weak(duty_cycle, -1), be_const_var(1) }, - { be_const_key_weak(animate, 7), be_const_closure(Animate_oscillator_animate_closure) }, - { be_const_key_weak(set_duty_cycle, -1), be_const_closure(Animate_oscillator_set_duty_cycle_closure) }, - { be_const_key_weak(init, -1), be_const_closure(Animate_oscillator_init_closure) }, - { be_const_key_weak(form, 5), be_const_var(4) }, + { be_const_key_weak(set_duty_cycle, 2), be_const_closure(Animate_oscillator_set_duty_cycle_closure) }, + { be_const_key_weak(set_a, -1), be_const_closure(Animate_oscillator_set_a_closure) }, + { be_const_key_weak(set_b, -1), be_const_closure(Animate_oscillator_set_b_closure) }, + { be_const_key_weak(set_form, -1), be_const_closure(Animate_oscillator_set_form_closure) }, + { be_const_key_weak(phase, -1), be_const_var(0) }, + { be_const_key_weak(form, -1), be_const_var(4) }, + { be_const_key_weak(set_phase, 0), be_const_closure(Animate_oscillator_set_phase_closure) }, })), be_str_weak(Animate_oscillator) ); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino index 47d80c98f..9ac9c4c45 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_leds.ino @@ -348,13 +348,16 @@ extern "C" { uint32_t r = (color_a >> 16) & 0xFF; uint32_t g = (color_a >> 8) & 0xFF; uint32_t b = (color_a ) & 0xFF; + uint32_t a = (color_a >> 24) & 0xFF; uint32_t r2 = (color_b >> 16) & 0xFF; uint32_t g2 = (color_b >> 8) & 0xFF; uint32_t b2 = (color_b ) & 0xFF; + uint32_t a2 = (color_b >> 24) & 0xFF; uint32_t r3 = changeUIntScale(alpha, 0, 255, r2, r); uint32_t g3 = changeUIntScale(alpha, 0, 255, g2, g); uint32_t b3 = changeUIntScale(alpha, 0, 255, b2, b); - uint32_t rgb = (r3 << 16) | (g3 << 8) | b3; + uint32_t a3 = changeUIntScale(alpha, 0, 255, a2, a); + uint32_t rgb = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3; be_pushint(vm, rgb); be_return(vm); }