You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
56 lines
1.3 KiB
6 years ago
|
#include "::/Doc/Comm"
|
||
|
|
||
|
U8 *WebPageBuf[1048576];
|
||
|
I64 port = 2;
|
||
|
CComm *c=CommInit8n1(port,38400);
|
||
|
|
||
|
U0 Browser(U8 *url)
|
||
|
{
|
||
|
WinMax;
|
||
|
I64 WebPageBufSize=0;
|
||
|
I64 WebPageBufPos=0;
|
||
|
|
||
|
CommPutS(port, url);
|
||
|
CommPutS(port, "V5.02");
|
||
|
CommPutS(port, "^");
|
||
|
|
||
|
CDoc *WebPage = DocNew();
|
||
|
I64 b=0;
|
||
|
Bool load=FALSE;
|
||
|
Bool proc=FALSE;
|
||
|
Bool pad=TRUE;
|
||
|
|
||
|
progress1_max=100;
|
||
|
progress1=0;
|
||
|
StrCpy(progress1_desc, "Request sent, waiting for response");
|
||
|
while (!load) {
|
||
|
if (InU8(0x60)==0x01) { WebPageBufSize=0; break; };
|
||
|
Sleep(0);
|
||
|
while (FifoU8Rem(c->RX_fifo,&b)) {
|
||
|
if (b == 0xFF && !pad) { load=TRUE; break; };
|
||
|
if (b != 0xFF && pad) { pad=FALSE; };
|
||
|
if (b != 0xFF && !pad) {
|
||
|
if (!proc) { proc=TRUE; StrCpy(progress1_desc, "Processing DolDoc"); };
|
||
|
WebPageBuf[WebPageBufSize] = b;
|
||
|
WebPageBufSize++;
|
||
|
progress1++;
|
||
|
if (progress1>progress1_max) { progress1=0; };
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ProgressBarsRst;
|
||
|
while (WebPageBufPos<WebPageBufSize) {
|
||
|
DocPrintPartial(WebPage, "%c", WebPageBuf[WebPageBufPos]);
|
||
|
WebPageBufPos++;
|
||
|
}
|
||
|
|
||
|
DocClear;
|
||
|
DocInsDoc(DocPut, WebPage);
|
||
|
DocTop;
|
||
|
DocDel(WebPage);
|
||
|
while (TRUE) {
|
||
|
GetStr;
|
||
|
}
|
||
|
DocBottom;
|
||
|
}
|