git-svn-id: https://spexeah.com:8443/svn/Asuro@746 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron
2018-05-22 03:33:51 +00:00
parent 4a1d7a942d
commit 8066634367
97 changed files with 422 additions and 123 deletions

View File

@ -3,7 +3,7 @@ unit serial;
interface
uses
util, isrmanager;
util, isrmanager, strings;
const
COM1 = $3F8;
@ -14,6 +14,7 @@ const
procedure init();
function receive(PORT : uint16; timeout : uint32) : uint8;
function send(PORT : uint16; data : uint8; timeout : uint32) : boolean;
function sendString(str : pchar) : boolean;
implementation
@ -85,4 +86,17 @@ begin
end;
end;
function sendString(str : pchar) : boolean;
var
i : uint32;
begin
sendString:= true;
for i:=0 to StringSize(str)-1 do begin
sendString:= sendString AND send(COM1, uint8(str[i]), 10000);
end;
sendString:= sendString AND send(COM1, uint8(13), 10000);
sendString:= sendString AND send(COM1, uint8(10), 10000);
end;
end.