Demo of low res colour vga video for stm32f3 discovery board
Dependencies: STM32F3-Discovery-minimal
Fork of Space_Invaders_Demo by
Diff: gdi.c
- Revision:
- 10:8ffcefda667a
- Parent:
- 8:34fb94209517
--- a/gdi.c Tue May 29 23:52:40 2018 +0000 +++ b/gdi.c Wed May 30 03:23:47 2018 +0000 @@ -29,6 +29,8 @@ extern u8 *fb[VID_VSIZE];// *(VID_HSIZE+2)]; extern const u8 gdiSystemFont[]; +extern const u8 font6x8[]; + #define CCM __attribute__ ((section (".ccmram"))) const u8 gdiCloseBm[] = { 0x7f, 0xC0, @@ -395,6 +397,12 @@ gdiVLine(x1,y0,y1,rop); } +void gdiFilledRectangle(i16 x0, i16 y0, i16 x1, i16 y1, u16 rop) { + + for(int y=y0;y<y1;y++) + gdiHLine(x0,y,x1,rop); +} + //***************************************************************************** // Function gdiRectangleEx(PGDI_RECT rc, u16 rop) // @@ -603,4 +611,13 @@ gdiRectangleEx(&rc,GDI_ROP_COPY); } - +int buttonstate=0; +int buttonPress() { + int b=GPIOA->IDR&1; + if(b!=buttonstate && b) { + buttonstate=b; + return 1; + } + buttonstate=b; + return 0; +}