From 7c4472cd94855fe88f5f456997a3bb74d40d2aa1 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 24 Oct 2012 00:12:50 +0200 Subject: [PATCH] added graph dummy --- demos/mandelbrot/main.c | 20 ++++++++++++++++++ demos/mandelbrot/mandelbrot.c | 20 ++++++++++++++++++ demos/notepad/main.c | 20 ++++++++++++++++++ gfx.mk | 1 + include/graph.h | 39 +++++++++++++++++++++++++++++++++++ src/graph.c | 33 +++++++++++++++++++++++++++++ 6 files changed, 133 insertions(+) create mode 100644 include/graph.h create mode 100644 src/graph.c diff --git a/demos/mandelbrot/main.c b/demos/mandelbrot/main.c index 45689df3..c0c699ed 100644 --- a/demos/mandelbrot/main.c +++ b/demos/mandelbrot/main.c @@ -1,3 +1,23 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/GFX is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "ch.h" #include "hal.h" #include "gdisp.h" diff --git a/demos/mandelbrot/mandelbrot.c b/demos/mandelbrot/mandelbrot.c index 2ae2e9da..70417ffa 100644 --- a/demos/mandelbrot/mandelbrot.c +++ b/demos/mandelbrot/mandelbrot.c @@ -1,3 +1,23 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/GFX is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "ch.h" #include "hal.h" #include "gdisp.h" diff --git a/demos/notepad/main.c b/demos/notepad/main.c index 40071719..b84ff2db 100644 --- a/demos/notepad/main.c +++ b/demos/notepad/main.c @@ -1,3 +1,23 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/GFX is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "ch.h" #include "hal.h" #include "gdisp.h" diff --git a/gfx.mk b/gfx.mk index 4e16c16f..ec28df30 100644 --- a/gfx.mk +++ b/gfx.mk @@ -7,5 +7,6 @@ GFXSRC += $(GFXLIB)/src/gdisp.c \ $(GFXLIB)/src/gdisp_fonts.c \ $(GFXLIB)/src/touchpad.c \ $(GFXLIB)/src/console.c \ + $(GFXLIB)/src/graph.c \ GFXINC += $(GFXLIB)/include diff --git a/include/graph.h b/include/graph.h new file mode 100644 index 00000000..e0e0622b --- /dev/null +++ b/include/graph.h @@ -0,0 +1,39 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/GFX is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef GRAPH_H +#define GRAPH_H + +#if GFX_USE_GRAPH + +typedef struct _Graph { + coord_t x0; + coord_t y0; + coord_t x1; + coord_t y1; + uint16_t grid_size; + bool_t full_grid; + color_t color; +} Graph; + +#endif /* GFX_USE_GRAPH */ + +#endif + diff --git a/src/graph.c b/src/graph.c new file mode 100644 index 00000000..9fd3984f --- /dev/null +++ b/src/graph.c @@ -0,0 +1,33 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/GFX is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "gdisp.h" +#include "graph.h" + +#if GFX_USE_GRAPH + +gfxGraphInit(struct graph_t *g) { + (void)g; +} + +#endif /* GFX_USE_GRAPH */ +