From 8529849a5a5f52794781b3af6099d80fe274cfc6 Mon Sep 17 00:00:00 2001 From: pvvx Date: Sun, 4 Mar 2018 18:23:47 +0300 Subject: [PATCH] set adc shl rtl8195am --- ExampleHTM/dygraph/ws_adc2.htm | 177 ++++++++++++++++++++++++++++ ExampleHTM/dygraph/ws_adcs.htm | 16 +-- ExampleHTM/dygraph/ws_test_adc.html | 2 +- project/src/adc_ws/adc_ws.c | 2 +- 4 files changed, 187 insertions(+), 10 deletions(-) create mode 100644 ExampleHTM/dygraph/ws_adc2.htm diff --git a/ExampleHTM/dygraph/ws_adc2.htm b/ExampleHTM/dygraph/ws_adc2.htm new file mode 100644 index 0000000..c74702a --- /dev/null +++ b/ExampleHTM/dygraph/ws_adc2.htm @@ -0,0 +1,177 @@ + + + + + Get ADC data + + + +
+
+ + + + + +
+ Window: ? sec, Sample Rate: ? smps +
+
+ + + diff --git a/ExampleHTM/dygraph/ws_adcs.htm b/ExampleHTM/dygraph/ws_adcs.htm index 50fe7e5..c969712 100644 --- a/ExampleHTM/dygraph/ws_adcs.htm +++ b/ExampleHTM/dygraph/ws_adcs.htm @@ -85,8 +85,8 @@ ws.onmessage = function (event) { oldblkid = blkid + blksz; for (var i=2; i= samples) datau.shift(); - datau.push([cur_idx/smprate, (wordarray[i]-10500)*0.000078, (wordarray[i+1]-10500)*0.000078]); +// datau.push([cur_idx/smprate,wordarray[i],wordarray[i+1]]); + datau.push([cur_idx/smprate, (wordarray[i]-11460)*0.00007757, (wordarray[i+1]-11460)*0.00007757]); } cur_idx++; } @@ -95,17 +95,17 @@ ws.onmessage = function (event) { $("div_v"), datau, { - title: 'RTL871xAx ADCs', + title: 'RTL8195AM ADCs', showRangeSelector: true, showRoller: true, xlabel: 'T(sec)', - ylabel: 'U19(V)', - y2label: 'Uvbat(V)', - colors: ['red','green'], - series : { 'Uvbat': { axis: 'y2' } }, + ylabel: 'U2(V)', + y2label: 'U1(V)', + colors: ['green','red'], + series : { 'U1': { axis: 'y2' } }, axes: { x: {valueFormatter: function(x){return this.getLabels()[0] + ': '+ x.toPrecision(5);}}}, - labels: ['T', 'U19', 'Uvbat'], + labels: ['T', 'U2', 'U1'], labelsDiv: $('labdiv'), legend: 'always', // "follow" digitsAfterDecimal: 3, diff --git a/ExampleHTM/dygraph/ws_test_adc.html b/ExampleHTM/dygraph/ws_test_adc.html index fa0c19d..2485c83 100644 --- a/ExampleHTM/dygraph/ws_test_adc.html +++ b/ExampleHTM/dygraph/ws_test_adc.html @@ -20,7 +20,7 @@ var rdnextflg = false; var cur_idx = 0; ws = new WebSocket('ws://rtl871x0/web.cgi'); ws.binaryType = 'arraybuffer'; -ws.onopen = function(){ws.send('adc');ws.send('adc')}; +ws.onopen = function(){ws.send('adc*');ws.send('adc*')}; ws.onmessage = function (event) { if(event.data instanceof ArrayBuffer) { var wordarray = new Uint16Array(event.data); diff --git a/project/src/adc_ws/adc_ws.c b/project/src/adc_ws/adc_ws.c index 9abe7de..dbcfe8a 100644 --- a/project/src/adc_ws/adc_ws.c +++ b/project/src/adc_ws/adc_ws.c @@ -98,7 +98,7 @@ void adc_int_handler(void *par) { if(p->pbuf) { PADC_DATA pd = p->pbuf + p->buf_tx; pd->us0 = buf.w[3]; - pd->us1 = buf.w[0]; + pd->us1 = buf.w[2]; if(p->buf_tx >= p->buf_idx) p->buf_tx = 0; else p->buf_tx++; if(p->buf_rx == p->buf_tx) {