diff options
author | Erich Eckner <git@eckner.net> | 2015-10-19 16:31:27 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2015-10-19 16:31:27 +0200 |
commit | 87061f69fd5449dfb57f5f7138de2814f1d5ed55 (patch) | |
tree | c472ba1f2ca2937cfa3cd505efdc118c2a075474 | |
parent | 7b0e121322f9b9ca6ff6d8cc10ef9610d92ee450 (diff) | |
download | Fernbedienung-87061f69fd5449dfb57f5f7138de2814f1d5ed55.tar.xz |
auf irDecoder-Unit umgestellt
-rw-r--r-- | fernbedienung.lpi | 6 | ||||
-rw-r--r-- | fernbedienung.lpr | 23 |
2 files changed, 10 insertions, 19 deletions
diff --git a/fernbedienung.lpi b/fernbedienung.lpi index ba21e25..d2f93b8 100644 --- a/fernbedienung.lpi +++ b/fernbedienung.lpi @@ -30,7 +30,7 @@ <FormatVersion Value="1"/> </local> </RunParams> - <Units Count="2"> + <Units Count="3"> <Unit0> <Filename Value="fernbedienung.lpr"/> <IsPartOfProject Value="True"/> @@ -39,6 +39,10 @@ <Filename Value="../units/lesethreadunit.pas"/> <IsPartOfProject Value="True"/> </Unit1> + <Unit2> + <Filename Value="../units/irdecoderunit.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> </Units> </ProjectOptions> <CompilerOptions> diff --git a/fernbedienung.lpr b/fernbedienung.lpr index 1c86644..48d49be 100644 --- a/fernbedienung.lpr +++ b/fernbedienung.lpr @@ -10,32 +10,19 @@ uses {$ENDIF}{$ENDIF} Classes, lesethreadunit { you can add units after this }, - sysutils, lowlevelunit; + sysutils, lowlevelunit, irdecoderunit; var - ttySLeser: tLeseProzess; - s: string; + irDecoder: tIRDecoder; begin - ttySLeser:=tLeseProzess.create(paramstr(1),1); + irDecoder:=tIRDecoder.create(paramstr(1)); repeat - if ttySLeser.gibZeile(s) then begin - if s='Ha!' then begin - writeln('Empfänger hat sich gemeldet!'); - continue; // Startzeichen - end; - if length(s)=3 then - if base64ToBin(s) then begin - writeln('Bits: '+s); - continue; - end; - writeln('Warnung: Kenne Kommando '''+s+''' nicht!'); - end - else + if not irDecoder.zeileVerarbeitet then sleep(100); until false; - ttySLeser.free; + irDecoder.free; end. |