added dimmodenormal

This commit is contained in:
joBr99
2022-05-29 22:27:50 +02:00
parent 3c132564f8
commit 39c4eed07a
5 changed files with 479 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,159 @@
unicode_ranges="0000-007F," #Basic Latin
unicode_ranges+="0080-00FF," #C1 Controls and Latin-1 Supplement
unicode_ranges+="0100-017F," #Latin Extended-A
unicode_ranges+="0180-024F," #Latin Extended-B
#unicode_ranges+="0250-02AF," #IPA Extensions
#unicode_ranges+="02B0-02FF," #Spacing Modifier Letters
#unicode_ranges+="0300-036F," #Combining Diacritical Marks
unicode_ranges+="0370-03FF," #Greek/Coptic
unicode_ranges+="0400-04FF," #Cyrillic
#unicode_ranges+="0500-052F," #Cyrillic Supplement
#unicode_ranges+="0530-058F," #Armenian
unicode_ranges+="0590-05FF," #Hebrew
unicode_ranges+="0600-06FF," #Arabic
#unicode_ranges+="0700-074F," #Syriac
#unicode_ranges+="0750-077F," #Undefined
#unicode_ranges+="0780-07BF," #Thaana
#unicode_ranges+="07C0-08FF," #Undefined
#unicode_ranges+="0900-097F," #Devanagari
#unicode_ranges+="0980-09FF," #Bengali/Assamese
#unicode_ranges+="0A00-0A7F," #Gurmukhi
#unicode_ranges+="0A80-0AFF," #Gujarati
#unicode_ranges+="0B00-0B7F," #Oriya
#unicode_ranges+="0B80-0BFF," #Tamil
#unicode_ranges+="0C00-0C7F," #Telugu
#unicode_ranges+="0C80-0CFF," #Kannada
#unicode_ranges+="0D00-0DFF," #Malayalam
#unicode_ranges+="0D80-0DFF," #Sinhala
#unicode_ranges+="0E00-0E7F," #Thai
#unicode_ranges+="0E80-0EFF," #Lao
#unicode_ranges+="0F00-0FFF," #Tibetan
#unicode_ranges+="1000-109F," #Myanmar
unicode_ranges+="10A0-10FF," #Georgian
#unicode_ranges+="1100-11FF," #Hangul Jamo
#unicode_ranges+="1200-137F," #Ethiopic
#unicode_ranges+="1380-139F," #Undefined
#unicode_ranges+="13A0-13FF," #Cherokee
#unicode_ranges+="1400-167F," #Unified Canadian Aboriginal Syllabics
#unicode_ranges+="1680-169F," #Ogham
#unicode_ranges+="16A0-16FF," #Runic
#unicode_ranges+="1700-171F," #Tagalog
#unicode_ranges+="1720-173F," #Hanunoo
#unicode_ranges+="1740-175F," #Buhid
#unicode_ranges+="1760-177F," #Tagbanwa
#unicode_ranges+="1780-17FF," #Khmer
#unicode_ranges+="1800-18AF," #Mongolian
#unicode_ranges+="18B0-18FF," #Undefined
#unicode_ranges+="1900-194F," #Limbu
#unicode_ranges+="1950-197F," #Tai Le
#unicode_ranges+="1980-19DF," #Undefined
#unicode_ranges+="19E0-19FF," #Khmer Symbols
#unicode_ranges+="1A00-1CFF," #Undefined
#unicode_ranges+="1D00-1D7F," #Phonetic Extensions
#unicode_ranges+="1D80-1DFF," #Undefined
#unicode_ranges+="1E00-1EFF," #Latin Extended Additional
#unicode_ranges+="1F00-1FFF," #Greek Extended
#unicode_ranges+="2000-206F," #General Punctuation
#unicode_ranges+="2070-209F," #Superscripts and Subscripts
#unicode_ranges+="20A0-20CF," #Currency Symbols
#unicode_ranges+="20D0-20FF," #Combining Diacritical Marks for Symbols
#unicode_ranges+="2100-214F," #Letterlike Symbols
#unicode_ranges+="2150-218F," #Number Forms
#unicode_ranges+="2190-21FF," #Arrows
#unicode_ranges+="2200-22FF," #Mathematical Operators
#unicode_ranges+="2300-23FF," #Miscellaneous Technical
#unicode_ranges+="2400-243F," #Control Pictures
#unicode_ranges+="2440-245F," #Optical Character Recognition
#unicode_ranges+="2460-24FF," #Enclosed Alphanumerics
#unicode_ranges+="2500-257F," #Box Drawing
#unicode_ranges+="2580-259F," #Block Elements
#unicode_ranges+="25A0-25FF," #Geometric Shapes
#unicode_ranges+="2600-26FF," #Miscellaneous Symbols
#unicode_ranges+="2700-27BF," #Dingbats
#unicode_ranges+="27C0-27EF," #Miscellaneous Mathematical Symbols-A
#unicode_ranges+="27F0-27FF," #Supplemental Arrows-A
#unicode_ranges+="2800-28FF," #Braille Patterns
#unicode_ranges+="2900-297F," #Supplemental Arrows-B
#unicode_ranges+="2980-29FF," #Miscellaneous Mathematical Symbols-B
#unicode_ranges+="2A00-2AFF," #Supplemental Mathematical Operators
#unicode_ranges+="2B00-2BFF," #Miscellaneous Symbols and Arrows
#unicode_ranges+="2C00-2E7F," #Undefined
#unicode_ranges+="2E80-2EFF," #CJK Radicals Supplement
#unicode_ranges+="2F00-2FDF," #Kangxi Radicals
#unicode_ranges+="2FE0-2EEF," #Undefined
#unicode_ranges+="2FF0-2FFF," #Ideographic Description Characters
#unicode_ranges+="3000-303F," #CJK Symbols and Punctuation
#unicode_ranges+="3040-309F," #Hiragana
#unicode_ranges+="30A0-30FF," #Katakana
#unicode_ranges+="3100-312F," #Bopomofo
#unicode_ranges+="3130-318F," #Hangul Compatibility Jamo
#unicode_ranges+="3190-319F," #Kanbun (Kunten)
#unicode_ranges+="31A0-31BF," #Bopomofo Extended
#unicode_ranges+="31C0-31EF," #Undefined
#unicode_ranges+="31F0-31FF," #Katakana Phonetic Extensions
#unicode_ranges+="3200-32FF," #Enclosed CJK Letters and Months
#unicode_ranges+="3300-33FF," #CJK Compatibility
#unicode_ranges+="3400-4DBF," #CJK Unified Ideographs Extension A
#unicode_ranges+="4DC0-4DFF," #Yijing Hexagram Symbols
#unicode_ranges+="4E00-9FAF," #CJK Unified Ideographs
#unicode_ranges+="9FB0-9FFF," #Undefined
#unicode_ranges+="A000-A48F," #Yi Syllables
#unicode_ranges+="A490-A4CF," #Yi Radicals
#unicode_ranges+="A4D0-ABFF," #Undefined
#unicode_ranges+="AC00-D7AF," #Hangul Syllables
#unicode_ranges+="D7B0-D7FF," #Undefined
#unicode_ranges+="D800-DBFF," #High Surrogate Area
#unicode_ranges+="DC00-DFFF," #Low Surrogate Area
#unicode_ranges+="E000-F8FF," #Private Use Area
#unicode_ranges+="F900-FAFF," #CJK Compatibility Ideographs
#unicode_ranges+="FB00-FB4F," #Alphabetic Presentation Forms
#unicode_ranges+="FB50-FDFF," #Arabic Presentation Forms-A
#unicode_ranges+="FE00-FE0F," #Variation Selectors
#unicode_ranges+="FE10-FE1F," #Undefined
#unicode_ranges+="FE20-FE2F," #Combining Half Marks
#unicode_ranges+="FE30-FE4F," #CJK Compatibility Forms
#unicode_ranges+="FE50-FE6F," #Small Form Variants
#unicode_ranges+="FE70-FEFF," #Arabic Presentation Forms-B
#unicode_ranges+="FF00-FFEF," #Halfwidth and Fullwidth Forms
#unicode_ranges+="FFF0-FFFF," #Specials
#unicode_ranges+="10000-1007F," #Linear B Syllabary
#unicode_ranges+="10080-100FF," #Linear B Ideograms
#unicode_ranges+="10100-1013F," #Aegean Numbers
#unicode_ranges+="10140-102FF," #Undefined
#unicode_ranges+="10300-1032F," #Old Italic
#unicode_ranges+="10330-1034F," #Gothic
#unicode_ranges+="10380-1039F," #Ugaritic
#unicode_ranges+="10400-1044F," #Deseret
#unicode_ranges+="10450-1047F," #Shavian
#unicode_ranges+="10480-104AF," #Osmanya
#unicode_ranges+="104B0-107FF," #Undefined
#unicode_ranges+="10800-1083F," #Cypriot Syllabary
#unicode_ranges+="10840-1CFFF," #Undefined
#unicode_ranges+="1D000-1D0FF," #Byzantine Musical Symbols
#unicode_ranges+="1D100-1D1FF," #Musical Symbols
#unicode_ranges+="1D200-1D2FF," #Undefined
#unicode_ranges+="1D300-1D35F," #Tai Xuan Jing Symbols
#unicode_ranges+="1D360-1D3FF," #Undefined
#unicode_ranges+="1D400-1D7FF," #Mathematical Alphanumeric Symbols
#unicode_ranges+="1D800-1FFFF," #Undefined
#unicode_ranges+="20000-2A6DF," #CJK Unified Ideographs Extension B
#unicode_ranges+="2A6E0-2F7FF," #Undefined
#unicode_ranges+="2F800-2FA1F," #CJK Compatibility Ideographs Supplement
#unicode_ranges+="2FAB0-DFFFF," #Unused
#unicode_ranges+="E0000-E007F," #Tags
#unicode_ranges+="E0080-E00FF," #Unused
#unicode_ranges+="E0100-E01EF," #Variation Selectors Supplement
#unicode_ranges+="E01F0-EFFFF," #Unused
#unicode_ranges+="F0000-FFFFD," #Supplementary Private Use Area-A
#unicode_ranges+="FFFFE-FFFFF," #Unused
#unicode_ranges+="100000-10FFFD," #Supplementary Private Use Area-B
char_res_string = ""
for r in unicode_ranges[:-1].split(","):
start = int('0x'+r.split('-')[0], 16)
end = int('0x'+r.split('-')[1], 16)+1
print(start, end)
char_res_string += ''.join(chr(i) for i in range(start, end))
print(char_res_string)

Binary file not shown.

Binary file not shown.

320
out.txt Normal file
View File

@@ -0,0 +1,320 @@
// data available
if(usize>1)
{
bufferPos=0
while(bufferPos<usize)
{
// check for 0x55 0xBB - Command Init Secuence
if(u[bufferPos]==187&&u[bufferPos-1]==85)
{
//remove garbage at the start of the buffer if there's any to free buffer for command
if(u[bufferPos]!=1)
{
udelete bufferPos-1
}
//instruction is now aligned with buffer, because we deleted garbage before instrcution
//get length after init sequence (check if there are more than to bytes in buffer)
if(3<usize)
{
// check if serial buffer has reached the announced length
ucopy payloadLength,2,2,0
// we are only checking payload length so we have to skip first 3 bytes (init+payload length) (-1 because of < instead of <=)
payloadLength+=3
// payload length does also not contain crc, so we are adding another 2 bytes for crc
payloadLength+=2
if(payloadLength<usize)
{
// calculate crc
crcrest 1,0xFFFF
// u[2] contains payload legth at 3rd pos in buffer, we are calculating crc from 3rd pos with number of bytes from payload length
//crcputu 3,u[2]
// u[2] cotnains payload length, we are calculating a crc over the whole message, so we have to add 3 to the length from u[2]
crcputu 0,payloadLength-1
// get recived crc to be able to compare it
ucopy recvCrc,payloadLength-1,2,0
// compare crc with recived value
if(crcval==recvCrc)
{
// crc is okay
// here is the location where acual code should be
// write command to variable strCommand
ucopy strCommand.txt,4,payloadLength-5,0
// write instruction to tInstuction (debug output, but used as variable here, ui elements will be disabled by default)
spstr strCommand.txt,tInstruction.txt,"~",0
if(tInstruction.txt=="entityUpd")
{
// command format: entityUpd,heading,navigation,[,type,internalName,iconId,iconColor,displayName,optionalValue]x6
spstr strCommand.txt,tHeading.txt,"~",1
// navigation icons
spstr strCommand.txt,tId.txt,"~",2
spstr tId.txt,tTmp.txt,"|",0
if(tTmp.txt=="0")
{
vis bPrev,0
tsw mSwipePrev,0
tsw mSwipeUp,0
}
if(tTmp.txt=="1")
{
vis bPrev,1
tsw mSwipePrev,1
tsw mSwipeUp,0
bPrev.txt=""
}
if(tTmp.txt=="2")
{
vis bPrev,1
tsw mSwipePrev,0
tsw mSwipeUp,1
bPrev.txt=""
}
spstr tId.txt,tTmp.txt,"|",1
if(tTmp.txt=="0")
{
vis bNext,0
tsw mSwipeNext,0
}
if(tTmp.txt=="1")
{
vis bNext,1
tsw mSwipeNext,1
bNext.txt=""
}
// get Type
spstr strCommand.txt,type1.txt,"~",3
// get internal name
spstr strCommand.txt,entn1.txt,"~",4
if(type1.txt=="delete"||type1.txt=="")
{
vis tEntity1,0
vis bEntity1,0
}else
{
// change icon
spstr strCommand.txt,bEntity1.txt,"~",5
vis bEntity1,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",6
covx tTmp.txt,sys0,0,0
bEntity1.pco=sys0
// set name
spstr strCommand.txt,tEntity1.txt,"~",7
vis tEntity1,1
}
// get Type
spstr strCommand.txt,type2.txt,"~",9
// get internal name
spstr strCommand.txt,entn2.txt,"~",10
if(type2.txt=="delete"||type2.txt=="")
{
vis tEntity2,0
vis bEntity2,0
}else
{
// change icon
spstr strCommand.txt,bEntity2.txt,"~",11
vis bEntity2,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",12
covx tTmp.txt,sys0,0,0
bEntity2.pco=sys0
// set name
spstr strCommand.txt,tEntity2.txt,"~",13
vis tEntity2,1
}
// get Type
spstr strCommand.txt,type3.txt,"~",15
// get internal name
spstr strCommand.txt,entn3.txt,"~",16
if(type3.txt=="delete"||type3.txt=="")
{
vis tEntity3,0
vis bEntity3,0
}else
{
// change icon
spstr strCommand.txt,bEntity3.txt,"~",17
vis bEntity3,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",18
covx tTmp.txt,sys0,0,0
bEntity3.pco=sys0
// set name
spstr strCommand.txt,tEntity3.txt,"~",19
vis tEntity3,1
}
// get Type
spstr strCommand.txt,type4.txt,"~",21
// get internal name
spstr strCommand.txt,entn4.txt,"~",22
if(type4.txt=="delete"||type4.txt=="")
{
vis tEntity4,0
vis bEntity4,0
}else
{
// change icon
spstr strCommand.txt,bEntity4.txt,"~",23
vis bEntity4,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",24
covx tTmp.txt,sys0,0,0
bEntity4.pco=sys0
// set name
spstr strCommand.txt,tEntity4.txt,"~",25
vis tEntity4,1
}
// get Type
spstr strCommand.txt,type5.txt,"~",27
// get internal name
spstr strCommand.txt,entn5.txt,"~",28
if(type5.txt=="delete"||type5.txt=="")
{
vis tEntity5,0
vis bEntity5,0
}else
{
// change icon
spstr strCommand.txt,bEntity5.txt,"~",29
vis bEntity5,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",30
covx tTmp.txt,sys0,0,0
bEntity5.pco=sys0
// set name
spstr strCommand.txt,tEntity5.txt,"~",31
vis tEntity5,1
}
// get Type
spstr strCommand.txt,type6.txt,"~",33
// get internal name
spstr strCommand.txt,entn6.txt,"~",34
if(type6.txt=="delete"||type6.txt=="")
{
vis tEntity6,0
vis bEntity6,0
}else
{
// change icon
spstr strCommand.txt,bEntity6.txt,"~",35
vis bEntity6,1
// change icon color
spstr strCommand.txt,tTmp.txt,"~",36
covx tTmp.txt,sys0,0,0
bEntity6.pco=sys0
// set name
spstr strCommand.txt,tEntity6.txt,"~",37
vis tEntity6,1
}
}
if(tInstruction.txt=="pageType")
{
//command format pageType,specialPageName
//write name of speical page to tId
spstr strCommand.txt,tId.txt,"~",1
//save second arg if there's one
spstr strCommand.txt,tTmp.txt,"~",2
//save third arg if there's one
spstr strCommand.txt,pageIcons.tTmp2.txt,"~",3
//we are going to exit this page with this command, so we have to clear the buffer, so we are not getting into a stupid loop ...
udelete payloadLength-1
bufferPos=0
if(tId.txt=="pageStartup")
{
page pageStartup
}
if(tId.txt=="screensaver")
{
page screensaver
}
if(tId.txt=="cardEntities")
{
page cardEntities
}
if(tId.txt=="cardGrid")
{
page cardGrid
}
if(tId.txt=="popupLight")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupLight
}
if(tId.txt=="popupShutter")
{
pageIcons.tTmp1.txt=tTmp.txt
page popupShutter
}
if(tId.txt=="popupNotify")
{
page popupNotify
}
if(tId.txt=="cardThermo")
{
page cardThermo
}
if(tId.txt=="cardMedia")
{
page cardMedia
}
if(tId.txt=="cardAlarm")
{
page cardAlarm
}
if(tId.txt=="cardQR")
{
page cardQR
}
}
if(tInstruction.txt=="time")
{
// get set time to global variable
spstr strCommand.txt,pageIcons.vaTime.txt,"~",1
}
if(tInstruction.txt=="date")
{
// get set date to global variable
spstr strCommand.txt,pageIcons.vaDate.txt,"~",1
}
if(tInstruction.txt=="dimmode")
{
// get value
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,dimValue,0,0
}
if(tInstruction.txt=="timeout")
{
//set timeout to global var
spstr strCommand.txt,tTmp.txt,"~",1
covx tTmp.txt,sleepTimeout,0,0
}
// end of user code
udelete payloadLength-1
bufferPos=0
}
}
}
}
// next character
bufferPos++
}
}