From 1445173ac6e562817fda8b3890689b1d07a05ceb Mon Sep 17 00:00:00 2001 From: Tectu Date: Wed, 20 Jun 2012 13:51:48 +0200 Subject: graph does now take int instead of int16 arrays --- graph.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'graph.c') diff --git a/graph.c b/graph.c index 440f2507..a9d4a378 100644 --- a/graph.c +++ b/graph.c @@ -35,19 +35,19 @@ void graphDrawSystem(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_ } } -void graphDrawDots(int16_t coord[][2], uint16_t entries, uint16_t radius, uint16_t color) { +void graphDrawDots(int coord[][2], uint16_t entries, uint16_t radius, uint16_t color) { uint16_t i; - for(i=0; i Date: Sat, 23 Jun 2012 21:15:31 +0200 Subject: graphDrawSystem() does take now grid-X and grid-Y values --- graph.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'graph.c') diff --git a/graph.c b/graph.c index a9d4a378..d90eaa95 100644 --- a/graph.c +++ b/graph.c @@ -1,26 +1,26 @@ #include "glcd.h" -#define GRID_X 20 -#define GRID_Y 20 - #define MARKSIZE 5 // half -static uint16_t x, y; // origins in graph +static uint16_t x, y; // origins in graph +static uint16_t grid_X, grid_Y; //grids -void graphDrawSystem(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) { +void graphDrawSystem(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t gridX, uint16_t gridY, uint16_t color) { uint16_t i, length; volatile uint16_t off; x = x0; y = y0; + grid_X = gridX; + grid_Y = gridY; // X-Axis length = x1 - x0; lcdDrawLine(x0, y0, x1, y0, color); lcdDrawLine(x1, y0, x1-5, y0+5, color); lcdDrawLine(x1, y0, x1-5, y0-5, color); - for(i=1; i<(length / GRID_X); i++) { - off = x0 + i*GRID_X; + for(i=1; i<(length / grid_X); i++) { + off = x0 + i * grid_X; lcdDrawLine(off, y0-MARKSIZE, off, y0+MARKSIZE, color); } @@ -29,8 +29,8 @@ void graphDrawSystem(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_ lcdDrawLine(x0, y0, x0, y1, color); lcdDrawLine(x0, y1, x0-5, y1+5, color); lcdDrawLine(x0, y1, x0+5, y1+5, color); - for(i=1; i<(length / GRID_Y); i++) { - off = x0 + i*GRID_Y; + for(i=1; i<(length / grid_Y); i++) { + off = x0 + i * grid_Y; lcdDrawLine(x0-MARKSIZE, off, x0+MARKSIZE, off, color); } } -- cgit v1.2.3 From 609af8f9a8676411e8cd9a591bc2584f5c7b4f8b Mon Sep 17 00:00:00 2001 From: Tectu Date: Sat, 23 Jun 2012 21:34:24 +0200 Subject: some fix, just esthetical --- graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graph.c') diff --git a/graph.c b/graph.c index d90eaa95..b9ce8739 100644 --- a/graph.c +++ b/graph.c @@ -30,7 +30,7 @@ void graphDrawSystem(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_ lcdDrawLine(x0, y1, x0-5, y1+5, color); lcdDrawLine(x0, y1, x0+5, y1+5, color); for(i=1; i<(length / grid_Y); i++) { - off = x0 + i * grid_Y; + off = y0 + i * grid_Y; lcdDrawLine(x0-MARKSIZE, off, x0+MARKSIZE, off, color); } } -- cgit v1.2.3