{{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Autor: Ingo Kripahle │ │ Copyright (c) 2010 Ingo Kripahle │ │ See end of file for terms of use. │ │ Die Nutzungsbedingungen befinden sich am Ende der Datei │ └──────────────────────────────────────────────────────────────────────────────────────────────────────┘ Informationen : hive-project.de Kontakt : drohne235@googlemail.com System : TriOS Name : sysconf Chip : Regnatix Typ : Programm Version : Subversion : Funktion : Kommandozeilentool für TriOS-Systemeinstellungen Komponenten : - COG's : - Logbuch : 16-04-2010-dr235 - erste version Kommandoliste : /? : Hilfe /p : Konfiguration anzeigen /h 0|1 : hss ab-/anschalten /w 0|1 : wav ab-/anschalten /s 0|1 : systemklänge ab-/anschalten /l 0..100 : wav-lautstärke links /r 0..100 : wav-lautstärke rechts /h 0..15 : hss-lautstärke Notizen : }} OBJ ios: "ios" CON _CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 VAR byte parastr[64] PUB main ios.start 'ios initialisieren ios.parastart 'parameterübergabe starten repeat while ios.paranext(@parastr) 'parameter einlesen if byte[@parastr][0] == "/" 'option? case byte[@parastr][1] "?": ios.print(@help1) '/? "p": printConf "h": setHSS '/h - hss "w": setWAV '/w - wav "s": setSYS '/s - systemklänge "l": set_lvol '/l - wav-lautstärke links "r": set_rvol '/r - wav-lautstärke rechts "v": set_hvol '/v - hss-lautstärke ios.stop DAT 'VOLUME PUB set_lvol if ios.paranext(@parastr) 'parameter? ios.wav_lvol(str2dec(@parastr)) else 'kein parameter: fehlermeldung printErr(@err1) PUB set_rvol if ios.paranext(@parastr) 'parameter? ios.wav_rvol(str2dec(@parastr)) else 'kein parameter: fehlermeldung printErr(@err1) PUB set_hvol if ios.paranext(@parastr) 'parameter? ios.hss_vol(str2dec(@parastr)) else 'kein parameter: fehlermeldung printErr(@err1) DAT 'SOUNDSYSTEM PRI setHSS if ios.paranext(@parastr) 'parameter? case byte[@parastr][0] "0": ios.admsetsound(0) ios.print(@msg4) ios.print(@msg2) "1": ios.admsetsound(1) ios.print(@msg4) ios.print(@msg1) else printErr(@err1) PRI setWAV if ios.paranext(@parastr) 'parameter? case byte[@parastr][0] "0": ios.admsetsound(2) ios.print(@msg5) ios.print(@msg2) "1": ios.admsetsound(3) ios.print(@msg5) ios.print(@msg1) else printErr(@err1) PRI setSYS if ios.paranext(@parastr) 'parameter? case byte[@parastr][0] "0": ios.admsetsyssnd(0) ios.print(@msg7) ios.print(@msg2) "1": ios.admsetsyssnd(1) ios.print(@msg7) ios.print(@msg1) else printErr(@err1) PRI printConf ios.printnl ios.print(@msg3) case ios.admgetsndsys 0: ios.print(@msg6) 1: ios.print(@msg4) 2: ios.print(@msg5) ios.printnl PRI printErr(stradr) ios.print(@err0) ios.print(stradr) ios.print(@help1) PUB str2dec(stradr)|buffer,counter buffer := byte[stradr] counter := (strsize(stradr) <# 11) repeat while(counter--) result *= 10 result += lookdownz(byte[stradr++]: "0".."9") if(buffer == "-") -result DAT msg1 byte "EIN ", 0 msg2 byte "AUS ", 0 msg3 byte "Soundsystem : ",0 msg4 byte "HSS-Engine ",0 msg5 byte "WAV-Engine ",0 msg6 byte "Soundsystem deaktiviert ",0 msg7 byte "Systemklänge ",0 err0 byte 13,"Fehler : " err1 byte "Zu wenig Parameter!",13,0 help1 file "sysconf.txt" byte 13,0 DAT {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}